Re: NUMA packaging and patch

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Christoph Berg <cb(at)df7cb(dot)de>, Kevin Grittner <kgrittn(at)ymail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: NUMA packaging and patch
Date: 2014-07-01 10:57:52
Message-ID: 20140701105752.GC26930@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-07-01 11:01:04 +0200, Christoph Berg wrote:
> Re: Kevin Grittner 2014-06-09 <1402267501(dot)41111(dot)YahooMailNeo(at)web122304(dot)mail(dot)ne1(dot)yahoo(dot)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 libnuma, make the
> > + * large memory segment interleaved.
> > + */
> > + if (!makePrivate && numa_available())
> > + {
> > + void *start;
> > +
> > + if (AnonymousShmem == NULL)
> > + start = memAddress;
> > + else
> > + start = AnonymousShmem;
> > +
> > + numa_interleave_memory(start, size, numa_all_nodes_ptr);
> > + }
> > +#endif
>
> 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
> interleaved, but it would avoid having a dependency on libnuma in the
> packages.

I've tested this a while ago, and it's rather painful if you have a OLAP
workload with lots of backend private memory.

> The numactl manpage even has this example:
>
> numactl --interleave=all bigdatabase arguments Run big
> database with its memory interleaved on all CPUs.
>
> It is probably better to have native support in the postmaster, though
> this could be mentioned as an alternative in the documentation.

I wonder if we shouldn't backpatch such a notice.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2014-07-01 11:18:12 Re: NUMA packaging and patch
Previous Message Andres Freund 2014-07-01 10:40:58 Re: better atomics - v0.5