[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <64ceb2b1-a120-dcf1-0e5f-033033b47685@huaweicloud.com>
Date: Wed, 28 Feb 2024 09:46:18 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: Tim Chen <tim.c.chen@...ux.intel.com>, viro@...iv.linux.org.uk,
brauner@...nel.org, jack@...e.cz
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/7] fs/writeback: avoid to writeback non-expired inode in
kupdate writeback
on 2/18/2024 10:01 AM, Kemeng Shi wrote:
>
>
> on 2/9/2024 2:29 AM, Tim Chen wrote:
>> On Fri, 2024-02-09 at 01:20 +0800, Kemeng Shi wrote:
>>>
>>>
>>> +static void filter_expired_io(struct bdi_writeback *wb)
>>> +{
>>> + struct inode *inode, *tmp;
>>> + unsigned long expired_jiffies = jiffies -
>>> + msecs_to_jiffies(dirty_expire_interval * 10);
>>
>> We have kupdate trigger time hard coded with a factor of 10 to expire interval here.
>> The kupdate trigger time "mssecs_to_jiffies(dirty_expire_interval * 10)" is
>> also used in wb_writeback(). It will be better to have a macro or #define
>> to encapsulate the trigger time so if for any reason we need
>> to tune the trigger time, we just need to change it at one place.
> Hi Tim. Sorry for the late reply, I was on vacation these days.
> I agree it's better to have a macro and I will add it in next version.
> Thanks!
Hi Tim,
After a deep look, I plan to set dirty_expire_interval in jiffies within sysctl
handler. Then we could use dirty_expire_interval directly instead of
"mssecs_to_jiffies(dirty_expire_interval * 10)" and macro is not needed.
Similar, dirty_writeback_interval and dirtytime_expire_interval could be set in
jiffies to remove repeat convertion from centisecs to jiffies. I will submit a
new series to do this if no one is against this.
Thanks!
>>
>> Tim
>>
>>> +
>>> + spin_lock(&wb->list_lock);
>>> + list_for_each_entry_safe(inode, tmp, &wb->b_io, i_io_list)
>>> + if (inode_dirtied_after(inode, expired_jiffies))
>>> + redirty_tail(inode, wb);
>>> +
>>> + list_for_each_entry_safe(inode, tmp, &wb->b_more_io, i_io_list)
>>> + if (inode_dirtied_after(inode, expired_jiffies))
>>> + redirty_tail(inode, wb);
>>> + spin_unlock(&wb->list_lock);
>>> +}
>>> +
>>> /*
>>> * Explicit flushing or periodic writeback of "old" data.
>>> *
>>> @@ -2070,6 +2087,9 @@ static long wb_writeback(struct bdi_writeback *wb,
>>> long progress;
>>> struct blk_plug plug;
>>>
>>> + if (work->for_kupdate)
>>> + filter_expired_io(wb);
>>> +
>>> blk_start_plug(&plug);
>>> for (;;) {
>>> /*
>>
Powered by blists - more mailing lists