Re: Checkpointer write combining - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Checkpointer write combining
Date
Msg-id CAAKRu_ZfneK9hEQs-ht2696aJ3ZSJs1c_-rXzBmyKjPDYRnqgA@mail.gmail.com
Whole thread Raw
In response to Re: Checkpointer write combining  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: Checkpointer write combining
List pgsql-hackers
On Thu, Nov 13, 2025 at 3:30 AM Chao Li <li.evan.chao@gmail.com> wrote:
>
> > On Nov 4, 2025, at 07:34, Melanie Plageman <melanieplageman@gmail.com> wrote:
> >
> >
> > uint32
> > StrategyMaxWriteBatchSize(BufferAccessStrategy strategy)
> > {
> >    uint32        max_write_batch_size = Min(io_combine_limit,
> > MAX_IO_COMBINE_LIMIT);
> >    int            strategy_pin_limit = GetAccessStrategyPinLimit(strategy);
> >    uint32        max_possible_buffer_limit = GetPinLimit();
> >
> >    /* Identify the minimum of the above */
> >    max_write_batch_size = Min(strategy_pin_limit, max_write_batch_size);
> >    max_write_batch_size = Min(max_possible_buffer_limit, max_write_batch_size);
> >
> >    /* Must allow at least 1 IO for forward progress */
> >    max_write_batch_size = Max(1, max_write_batch_size);
> >
> >    return max_write_batch_size;
> > }
> >
> > Is this better?
>
> Yes, I think your version is safer because it enforces the max limit at runtime instead of only asserting it in debug
builds.

Cool. I've attached a v9 which is rebased over recent bufmgr.c
changes. In the process, I found a bit of cleanup to do.

> I quickly went through 0001-0006, looks good to me now. As 0007 has WIP in the subject, I skipped it.

I no longer remember why I made that patch WIP, so I've removed that
designation.

- Melanie

Attachment

pgsql-hackers by date:

Previous
From: Roman Khapov
Date:
Subject: Re: *_LAST in enums to define NUM* macross
Next
From: Sami Imseih
Date:
Subject: Re: pg_utility ?