Re: [External] Re: [PATCH 0/3] memcg, writeback: Don't wait writeback completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




`memory.stat:writeback` already gives you the exact real-time count of pages still waiting to finish write-back for that cgroup, and it is updated atomically in the hot path (`set_page_writeback()` / `end_page_writeback()`). Reading it is just an `atomic_long_read()` (or per-cpu equivalent), so the extra CPU cost of exposing it is essentially zero. I was thinking that extra additional info would help us

Thanks,
Giorgi

On 8/21/2025 6:37 AM, Julian Sun wrote:
Hi, thanks for your review.

On Wed, Aug 20, 2025 at 8:17 PM Giorgi Tchankvetadze
<giorgitchankvetadze1997@xxxxxxxxx> wrote:

Could we add wb_pending_pages to memory.events?
Very cheap and useful.
A single atomic counter is already kept internally; exposing it is one
line in memcontrol.c plus one line in the ABI doc.

Not sure what do you mean by wb_pending_pages? Another counter besides
existing MEMCG_LOW MEMCG_HIGH MEMCG_MAX, etc.? And AFAIK there's no
pending pages in this patch set. Could you give more details?

Thanks,


On 8/20/2025 3:19 PM, Julian Sun wrote:
This patch series aims to eliminate task hangs in mem_cgroup_css_free()
caused by calling wb_wait_for_completion().
This is because there may be a large number of writeback tasks in the
foreign memcg, involving millions of pages, and the situation is
exacerbated by WBT rate limiting—potentially leading to task hangs
lasting several hours.

Patch 1 is preparatory work and involves no functional changes.
Patch 2 implements the automatic release of wb_completion.
Patch 3 removes wb_wait_for_completion() from mem_cgroup_css_free().


Julian Sun (3):
    writeback: Rename wb_writeback_work->auto_free to free_work.
    writeback: Add wb_writeback_work->free_done
    memcg: Don't wait writeback completion when release memcg.

   fs/fs-writeback.c                | 22 ++++++++++++++--------
   include/linux/backing-dev-defs.h |  6 ++++++
   include/linux/memcontrol.h       |  2 +-
   mm/memcontrol.c                  | 29 ++++++++++++++++++++---------
   4 files changed, 41 insertions(+), 18 deletions(-)







[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux