Re: NUMA packaging and patch - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: NUMA packaging and patch
Date
Msg-id 20140701090104.GA15590@msg.df7cb.de
Whole thread Raw
In response to NUMA packaging and patch  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: NUMA packaging and patch  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Re: Kevin Grittner 2014-06-09 <1402267501.41111.YahooMailNeo@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 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.

The numactl manpage even has this example:
numactl --interleave=all bigdatabase arguments Run bigdatabase 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.

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Autonomous Transaction (WIP)
Next
From: Ronan Dunklau
Date:
Subject: Re: Array of composite types returned from python