Re: pgsql: Dramatically reduce System V shared memory consumption.
От | Andres Freund |
---|---|
Тема | Re: pgsql: Dramatically reduce System V shared memory consumption. |
Дата | |
Msg-id | 201206291934.05319.andres@2ndquadrant.com обсуждение исходный текст |
Ответ на | pgsql: Dramatically reduce System V shared memory consumption. (Robert Haas <rhaas@postgresql.org>) |
Ответы |
Re: pgsql: Dramatically reduce System V shared memory consumption.
|
Список | pgsql-committers |
Hi Robert, You have a small typo in the patch: + /* + * pagesize will, for practical purposes, always be a power of two. + * But just in case it isn't, we do it this way instead of using + * TYPEALIGN(). + */ + AnonymousShmemSize = size; + if (size % pagesize != 0) + AnonymousShmemSize += pagesize - (size % pagesize); + + /* + * We assume that no one will attempt to run PostgreSQL 9.3 or later + * on systems that are ancient enough that anonymous shared memory is + * not supported, such as pre-2.4 versions of Linux. If that turns out + * to be false, we might need to add a run-time test here and do this + * only if the running kernel supports it. + */ + AnonymousShmem = mmap(NULL, size, PROT_READ|PROT_WRITE, PG_MMAP_FLAGS, + -1, 0); Note that you use size in the mmap... Andres -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-committers по дате отправления: