[PATCH] Use MAP_HUGETLB where supported (v3) - Mailing list pgsql-hackers

From Abhijit Menon-Sen
Subject [PATCH] Use MAP_HUGETLB where supported (v3)
Date
Msg-id 20131024060313.GA21888@toroid.org
Whole thread Raw
In response to patch: add MAP_HUGETLB to mmap() where supported (WIP)  (Richard Poole <richard@2ndQuadrant.com>)
Responses Re: [PATCH] Use MAP_HUGETLB where supported (v3)  (Abhijit Menon-Sen <ams@2ndquadrant.com>)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)  (Sergey Konoplev <gray.ru@gmail.com>)
List pgsql-hackers
Hi.

This is a slightly reworked version of the patch submitted by Richard
Poole last month, which was based on Christian Kruse's earlier patch.

Apart from doing various minor cleanups and documentation fixes, I also
tested this patch against HEAD on a machine with 256GB of RAM. Here's an
overview of the results.

I set nr_hugepages to 32768 (== 64GB), which (took a very long time and)
allowed me to set shared_buffers to 60GB. I then ran pgbench -s 1000 -i,
and did some runs of "pgbench -c 100 -j 10 -t 1000" with huge_tlb_pages
set to off and on respectively.

With huge_tlb_pages=off, this is the best result I got:

    tps = 8680.771068 (including connections establishing)
    tps = 8721.504838 (excluding connections establishing)

With huge_tlb_pages=on, this is the best result I got:

    tps = 9932.245203 (including connections establishing)
    tps = 9983.190304 (excluding connections establishing)

(Even the worst result I got in the latter case was a smidgen faster
than the best with huge_tlb_pages=off: 8796.344078 vs. 8721.504838.)

>From /proc/$pid/status, VmPTE was 2880kb with huge_tlb_pages=off, and
56kb with it turned on.

One open question is what to do about rounding up the size. It should
not be necessary, but for the fairly recent bug described at the link
in the comment (https://bugzilla.kernel.org/show_bug.cgi?id=56881). I
tried it without the rounding-up, and it fails on Ubuntu's 3.5.0-28
kernel (mmap returns EINVAL).

Any thoughts?

-- Abhijit

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: CLUSTER FREEZE
Next
From: Abhijit Menon-Sen
Date:
Subject: Re: [PATCH] Use MAP_HUGETLB where supported (v3)