Re: Proposal: Limitations of palloc inside checkpointer

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proposal: Limitations of palloc inside checkpointer
Дата
Msg-id 1439188.1754506714@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Proposal: Limitations of palloc inside checkpointer  (Alexander Korotkov <aekorotkov@gmail.com>)
Ответы Re: Proposal: Limitations of palloc inside checkpointer
Список pgsql-hackers
Alexander Korotkov <aekorotkov@gmail.com> writes:
> I'm going to push this if no objections.

I looked at these patches while preparing release notes, and
found an oversight.  CheckpointerShmemInit does

        CheckpointerShmem->max_requests = Min(NBuffers, MAX_CHECKPOINT_REQUESTS);

but CheckpointerShmemSize still does

    size = add_size(size, mul_size(NBuffers, sizeof(CheckpointerRequest)));

So if NBuffers is more than MAX_CHECKPOINT_REQUESTS, we will allocate
extra CheckpointerRequest array entries that we will never use,
wasting shared memory.  Admittedly the amount is small relative to the
shared buffers themselves, but at the very least this is confusing.

The comment in CheckpointerShmemSize needs adjustment, too.

Also, the reason I was studying it so carefully is that I could not
figure out who to credit for the back-patched fix.  It looks like
the original suggestion for the minimal fix was Alexander's, but
other people seem to have had their fingers in the actual patch
writing --- or am I misreading the thread?

            regards, tom lane



В списке pgsql-hackers по дате отправления: