Re: Compiling on Termux

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Compiling on Termux
Date: 2018-12-28 05:45:20
Message-ID: CAEepm=1vQhcSPwzToFjCTzehG-k0ysSv-RgEdrXyU68SC_ubaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 22, 2018 at 11:51 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> writes:
> > On Sat, Dec 22, 2018 at 9:19 AM David Fetter <david(at)fetter(dot)org> wrote:
> >> I don't know precisely how it's going to play with Postgres, but
> >> Termux does supply a Postgres in its native packages. That package
> >> appears to work, at least in the single-connection case, so they're
> >> doing something somehow to get it up and running.
>
> > They use libandroid-shmem which emulates SysV shmem.
>
> Interesting. I wonder how well it emulates the aspect we actually
> care about, ie counting the number of attached processes correctly ...

I hadn't paid much attention to Android before, but it's quite
impressive that it can run PostgreSQL. One interesting thing (to me
at least) is that although it's some kind of Linux kernel, it has a
new libc called Bionic that is a mixture of cleanroom bits and *BSD
bits, probably because they liked the licence better[1]. The
allocator is jemalloc so I wonder if it eats 40k for every 32k hash
join chunk.

I wonder if we could mmap a small file created by initdb under pgdata
and do a new kind of interlocking in there, so you don't need SysV shm
at all. That would work for Android (which is obviously just a
curiosity for now, but kinda neat), and maybe also some other
interesting new platforms like CloudABI[2] that get rid of global
stuff like the System V facilities, so that you can trap software
entirely inside a root directory identified by an inherited file
descriptor (not that I have seriously studied what else would be
required to run in that environment).

[1] https://en.wikipedia.org/wiki/Bionic_(software)
[2] https://archive.fosdem.org/2017/schedule/event/cloudabi/

--
Thomas Munro
http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2018-12-28 06:50:29 Re: Problems with plan estimates in postgres_fdw
Previous Message Michael Paquier 2018-12-28 04:43:14 Re: removal of dangling temp tables