Re: [HACKERS] NUMA packaging and patch

2014-07-01 Thread Christoph Berg
Re: Kevin Grittner 2014-06-09 1402267501.4.yahoomail...@web122304.mail.ne1.yahoo.com @@ -536,6 +539,24 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port, */ } +#ifdef USE_LIBNUMA + /* + * If this is not a private segment and we are using

Re: [HACKERS] NUMA packaging and patch

2014-07-01 Thread Andres Freund
On 2014-07-01 11:01:04 +0200, Christoph Berg wrote: Re: Kevin Grittner 2014-06-09 1402267501.4.yahoomail...@web122304.mail.ne1.yahoo.com @@ -536,6 +539,24 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port, */ } +#ifdef USE_LIBNUMA + /* +

Re: [HACKERS] NUMA packaging and patch

2014-07-01 Thread Kevin Grittner
Andres Freund and...@2ndquadrant.com wrote: On 2014-07-01 11:01:04 +0200, Christoph Berg wrote: How much difference would it make if numactl --interleave=all was used instead of using numa_interleave_memory() on the shared memory segments? I guess that would make backend-local memory also

Re: [HACKERS] NUMA packaging and patch

2014-07-01 Thread Christoph Berg
Re: Kevin Grittner 2014-07-01 1404213492.98740.yahoomail...@web122306.mail.ne1.yahoo.com Andres Freund and...@2ndquadrant.com wrote: On 2014-07-01 11:01:04 +0200, Christoph Berg wrote: How much difference would it make if numactl --interleave=all was used instead of using

Re: [HACKERS] NUMA packaging and patch

2014-06-26 Thread Kohei KaiGai
Hello, Let me comment on this patch. It can be applied on head of the master branch, built and run regression test successfully. What this patch tries to do is quite simple and obvious. It suggests operating system to distribute physical pages to every numa nodes on allocation. One thing I

Re: [HACKERS] NUMA packaging and patch

2014-06-26 Thread Claudio Freire
On Thu, Jun 26, 2014 at 11:18 AM, Kohei KaiGai kai...@kaigai.gr.jp wrote: One thing I concern is, it may conflict with numa-balancing features that is supported in the recent Linux kernel; that migrates physical pages according to the location of tasks which references the page beyond the numa

Re: [HACKERS] NUMA packaging and patch

2014-06-26 Thread Kevin Grittner
Claudio Freire klaussfre...@gmail.com wrote: Sadly, it excludes the OS cache explicitly (when it mentions libc.so), which is one of the hottest sources of memory bandwidth consumption in a database. Agreed.  On the bright side, the packagers and/or sysadmins can fix this without any changes

Re: [HACKERS] NUMA packaging and patch

2014-06-10 Thread Robert Haas
On Mon, Jun 9, 2014 at 1:00 PM, Kevin Grittner kgri...@ymail.com wrote: Andres Freund and...@2ndquadrant.com wrote: On 2014-06-09 08:59:03 -0700, Kevin Grittner wrote: *) There is a lot of advice floating around (for example here:

Re: [HACKERS] NUMA packaging and patch

2014-06-10 Thread Josh Berkus
On 06/08/2014 03:45 PM, Kevin Grittner wrote: By default, the OS cache and buffers are allocated in the memory node with the shortest distance from the CPU a process is running on. Note that this will stop being the default in future Linux kernels. However, we'll have to deal with the old

Re: [HACKERS] NUMA packaging and patch

2014-06-10 Thread Kevin Grittner
Josh Berkus j...@agliodbs.com wrote: On 06/08/2014 03:45 PM, Kevin Grittner wrote: By default, the OS cache and buffers are allocated in the memory node with the shortest distance from the CPU a process is running on. Note that this will stop being the default in future Linux kernels.

Re: [HACKERS] NUMA packaging and patch

2014-06-09 Thread Merlin Moncure
On Sun, Jun 8, 2014 at 5:45 PM, Kevin Grittner kgri...@ymail.com wrote: I ran into a situation where a machine with 4 NUMA memory nodes and 40 cores had performance problems due to NUMA. The problems were worst right after they rebooted the OS and warmed the cache by running a script of

Re: [HACKERS] NUMA packaging and patch

2014-06-09 Thread Kevin Grittner
Merlin Moncure mmonc...@gmail.com wrote: On Sun, Jun 8, 2014 at 5:45 PM, Kevin Grittner kgri...@ymail.com wrote: Hm, your patch seems to boil down to    interleave_memory(start, size, numa_all_nodes_ptr) inside PGSharedMemoryCreate(). That's the functional part -- the rest is about not

Re: [HACKERS] NUMA packaging and patch

2014-06-09 Thread Andres Freund
On 2014-06-09 08:59:03 -0700, Kevin Grittner wrote: *) There is a lot of advice floating around (for example here: http://frosty-postgres.blogspot.com/2012/08/postgresql-numa-and-zone-reclaim-mode.html ) to instruct operators to disable zone_reclaim.  Will your changes invalidate any of

Re: [HACKERS] NUMA packaging and patch

2014-06-09 Thread Kevin Grittner
Andres Freund and...@2ndquadrant.com wrote: On 2014-06-09 08:59:03 -0700, Kevin Grittner wrote: *) There is a lot of advice floating around (for example here: http://frosty-postgres.blogspot.com/2012/08/postgresql-numa-and-zone-reclaim-mode.html ) to instruct operators to disable