From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Fan Liu <fan.liu@ericsson.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: [Bus error] huge_pages default value (try) not fall back
Date: Tue, 18 Feb 2020 10:32:40 +0100
Message-ID: <20200218093240.jd3lgoxmisyl2tt5@localhost> (raw)
In-Reply-To: <HE1PR0701MB256920EEAA3B2A9C06249F339E110@HE1PR0701MB2569.eurprd07.prod.outlook.com>
References: <HE1PR0701MB256920EEAA3B2A9C06249F339E110@HE1PR0701MB2569.eurprd07.prod.outlook.com>
> On Tue, Feb 18, 2020 at 07:52:50AM +0000, Fan Liu wrote:
> Hi,
>
> We have seen a bus error when running postgresql in container (where on K8s). According current finding, there is bug on K8s, they are working on it.
> But we also want to know why huge_pages default value(try) didn't fall back.
>
> K8s BUG https://github.com/kubernetes/kubernetes/issues/71233
>
> Problem quick summary:
> When hugepage not working, initdb produce bus error.
Thanks for reporting!
This one is fun. If I understand everything correctly, Postgres will
fall back to non huge pages if it fails to allocate some. But in this
case kernel actually allocates everything without problems (there are
some available huge pages on a node after all), and return SIGBUS only
when a first page fault within this cgroup happened, see the docs [1]:
The HugeTLB controller allows to limit the HugeTLB usage per control
group and enforces the controller limit during page fault. Since
HugeTLB doesn't support page reclaim, enforcing the limit at page
fault time implies that, the application will get SIGBUS signal if
it tries to access HugeTLB pages beyond its limit. This requires the
application to know beforehand how much HugeTLB pages it would
require for its use.
Unfortunately I'm not sure what would be the best solution in this
situation.
[1]: https://www.kernel.org/doc/html/latest/_sources/admin-guide/cgroup-v1/hugetlb.rst.txt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: 9erthalion6@gmail.com, fan.liu@ericsson.com, pgsql-bugs@lists.postgresql.org
Subject: Re: [Bus error] huge_pages default value (try) not fall back
In-Reply-To: <20200218093240.jd3lgoxmisyl2tt5@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox