public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: Tejun Heo <tj@kernel.org>
Cc: guro@fb.com, lizefan.x@bytedance.com, hannes@cmpxchg.org,
	cgroups@vger.kernel.org, jack@suse.cz,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	viro@zeniv.linux.org.uk, brauner@kernel.org, willy@infradead.org,
	joseph.qi@linux.alibaba.com
Subject: Re: [PATCH] writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs
Date: Fri, 13 Oct 2023 07:55:53 +0800	[thread overview]
Message-ID: <a6c1a1d7-870a-32ce-0ae1-44c2f5f15dbb@linux.alibaba.com> (raw)
In-Reply-To: <ZSgtW0wGZZ3N3oKl@slm.duckdns.org>



On 10/13/23 1:31 AM, Tejun Heo wrote:
> On Wed, Oct 11, 2023 at 04:42:28PM +0800, Jingbo Xu wrote:
>> The cgwb cleanup routine will try to release the dying cgwb by switching
>> the attached inodes.  It fetches the attached inodes from wb->b_attached
>> list, omitting the fact that inodes only with dirty timestamps reside in
>> wb->b_dirty_time list, which is the case when lazytime is enabled.  This
>> causes enormous zombie memory cgroup when lazytime is enabled, as inodes
>> with dirty timestamps can not be switched to a live cgwb for a long time.
>>
>> It is reasonable not to switch cgwb for inodes with dirty data, as
>> otherwise it may break the bandwidth restrictions.  However since the
>> writeback of inode metadata is not accounted, let's also switch inodes
>> with dirty timestamps to avoid zombie memory and block cgroups when
>> laztytime is enabled.
>>
>> Fixs: c22d70a162d3 ("writeback, cgroup: release dying cgwbs by switching attached inodes")
>> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
> 
> The patch looks fine to me.
> 
> ...
>> +	restart = isw_prepare_wbs_switch(isw, &wb->b_attached, &nr);
>> +	if (!restart)
>> +		restart = isw_prepare_wbs_switch(isw, &wb->b_dirty_time, &nr);
> 
> But can you add a comment explaining why we're also migrating b_dirty_time?

Will add the comment in the next version.  Thanks.


-- 
Thanks,
Jingbo

      reply	other threads:[~2023-10-12 23:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11  8:42 [PATCH] writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs Jingbo Xu
2023-10-12 17:31 ` Tejun Heo
2023-10-12 23:55   ` Jingbo Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6c1a1d7-870a-32ce-0ae1-44c2f5f15dbb@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=brauner@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=jack@suse.cz \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox