Thread

Commits

  1. Add CHECK_FOR_INTERRUPTS in Evict{Rel,All}UnpinnedBuffers.

  2. Add CHECK_FOR_INTERRUPTS in contrib/pg_buffercache functions.

  1. Add CHECK_FOR_INTERRUPTS in Evict{Rel,All}UnpinnedBuffers

    邱宇航 <iamqyh@gmail.com> — 2025-11-03T02:15:09Z

    The pg_buffercache_evict_{relation,all} operations can become extremely
    slow when dealing with large buffer pools containing many dirty buffers.
    This commit adds CHECK_FOR_INTERRUPTS calls within the underlying
    Evict{Rel,All}UnpinnedBuffers functions to ensure these operations
    cancellable.
    
    And this should be backpatched through v18 where
    pg_buffercache_evict_{relation,all} operations are introduced.
    
    
    
  2. Re: Add CHECK_FOR_INTERRUPTS in Evict{Rel,All}UnpinnedBuffers

    Masahiko Sawada <sawada.mshk@gmail.com> — 2025-11-03T20:06:45Z

    On Sun, Nov 2, 2025 at 6:15 PM 邱宇航 <iamqyh@gmail.com> wrote:
    >
    > The pg_buffercache_evict_{relation,all} operations can become extremely
    > slow when dealing with large buffer pools containing many dirty buffers.
    > This commit adds CHECK_FOR_INTERRUPTS calls within the underlying
    > Evict{Rel,All}UnpinnedBuffers functions to ensure these operations
    > cancellable.
    >
    > And this should be backpatched through v18 where
    > pg_buffercache_evict_{relation,all} operations are introduced.
    
    Commit eab9e4e27c0c added CFI for pg_buffercache functions such as
    pg_buffercache_pages, but it seems not to cover
    pg_buffercache_evict_relation() and pg_buffercache_evict_all().
    EvictRelUnpinnedBuffers() and EvictAllUnpinnedBuffers() are used only
    by pg_buffercache and they are for testing/development use, so it
    makes sense to add CFI to these functions as well. I'll push the patch
    barring any objections.
    
    Regards,
    
    -- 
    Masahiko Sawada
    Amazon Web Services: https://aws.amazon.com
    
    
    
    
  3. Re: Add CHECK_FOR_INTERRUPTS in Evict{Rel,All}UnpinnedBuffers

    Masahiko Sawada <sawada.mshk@gmail.com> — 2025-11-04T23:50:11Z

    On Mon, Nov 3, 2025 at 12:06 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
    >
    > On Sun, Nov 2, 2025 at 6:15 PM 邱宇航 <iamqyh@gmail.com> wrote:
    > >
    > > The pg_buffercache_evict_{relation,all} operations can become extremely
    > > slow when dealing with large buffer pools containing many dirty buffers.
    > > This commit adds CHECK_FOR_INTERRUPTS calls within the underlying
    > > Evict{Rel,All}UnpinnedBuffers functions to ensure these operations
    > > cancellable.
    > >
    > > And this should be backpatched through v18 where
    > > pg_buffercache_evict_{relation,all} operations are introduced.
    >
    > Commit eab9e4e27c0c added CFI for pg_buffercache functions such as
    > pg_buffercache_pages, but it seems not to cover
    > pg_buffercache_evict_relation() and pg_buffercache_evict_all().
    > EvictRelUnpinnedBuffers() and EvictAllUnpinnedBuffers() are used only
    > by pg_buffercache and they are for testing/development use, so it
    > makes sense to add CFI to these functions as well. I'll push the patch
    > barring any objections.
    
    Pushed (backpatched to v18).
    
    Regards,
    
    -- 
    Masahiko Sawada
    Amazon Web Services: https://aws.amazon.com