Re: Problems with huge_pages and IBM Power8

From: reiner peterke <zedaardv(at)drizzle(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Problems with huge_pages and IBM Power8
Date: 2016-04-12 20:35:12
Message-ID: 34326D2B-6E83-4695-9C63-6CA15C913D1F@drizzle.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On Apr 12, 2016, at 10:20 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> On 2016-04-12 21:58:14 +0200, reiner peterke wrote:
>> Hi
>>
>> We have been doing some testing with Postgres (9.5.2) compiled on a Power8 running Centos 7
>>
>> When working with huge_pages, we initially got this error.
>>
>> munmap(0x3efbe4000000) failed: Invalid argument
>
> *munmap*, not mmap failed? that's odd; because there the hugepagesize
> shouldn't have much of an influence. If something fails it should be the
> initial mmap.
I’ll double check in the morning, but i did copy it from the log.

> Could you show a strace of a failed start with an
> unmodified postgres?

we didn’t have the error when not using huge_pages.

>> after a bit of investigation we noticed that hugepagesize is har coded
>> to 2MB
>
> Note it's not actually hardcoded to some size. It's just about rounding
> the size to a multiple of 2MB due to an older kernel bug:
> /*
> * Round up the request size to a suitable large value.
> *
> * Some Linux kernel versions are known to have a bug, which causes
> * mmap() with MAP_HUGETLB to fail if the request size is not a
> * multiple of any supported huge page size. To work around that, we
> * round up the request size to nearest 2MB. 2MB is the most common
> * huge page page size on affected systems.
>
>
>> Going further, we tried testing hugepages also on Ubuntu 16.04, also on the power8. On Ubuntu Postgres did not like the hugepages at all (set also to 16MB) and consistently crashed.
>
>> Looking for some insight into this issue. the error from the postgres
>> log on ubuntu is below. It apperas to be related to semephores.
>
> I've a bit of a hard time believing that this is related to huge pages.

Well all i have at the moment is that when we disabled huge pages on the kernel level and then restarted postgres there were no additional crashes.
Unfortunately I cannot access the server now. I will look further tomorrow.

>
>
> Greetings,
>
> Andres Freund

Sincerely,

Reiner Peterke

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-04-12 20:41:35 Re: Problems with huge_pages and IBM Power8
Previous Message David G. Johnston 2016-04-12 20:32:04 Re: Lets (not) break all the things. Was: [pgsql-advocacy] 9.6 -> 10.0