From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Cen Zhang <zzzccc427@gmail.com>, jaegeuk@kernel.org
Cc: baijiaju1990@gmail.com, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: annotate lockless last_time[] accesses
Date: Sat, 9 May 2026 21:17:27 +0800 [thread overview]
Message-ID: <13da11c4-c6a5-46c3-b2c4-3a3dcb92cb5d@kernel.org> (raw)
In-Reply-To: <20260506010709.3287111-1-zzzccc427@gmail.com>
On 5/6/26 09:07, Cen Zhang wrote:
> f2fs stores mount-wide activity timestamps in sbi->last_time[] and
> samples them from background discard, GC, and balance paths without a
> dedicated lock. The timestamps are used as best-effort heuristics to
> decide whether background work should run now or sleep a bit longer.
>
> The current helpers use plain loads and stores, so KCSAN can report races
> between frequent foreground updates and background readers. Exact
> freshness is not required here, but the intentional lockless accesses
> should be marked explicitly.
>
> Use WRITE_ONCE() in f2fs_update_time() and READ_ONCE() in
> f2fs_time_over() and f2fs_time_to_wait(). This preserves the existing
> heuristic behavior and avoids adding locking to hot paths.
>
> Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2026-05-09 13:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 1:07 [f2fs-dev] [PATCH] f2fs: annotate lockless last_time[] accesses Cen Zhang
2026-05-09 13:17 ` Chao Yu via Linux-f2fs-devel [this message]
2026-05-11 1:41 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
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=13da11c4-c6a5-46c3-b2c4-3a3dcb92cb5d@kernel.org \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=baijiaju1990@gmail.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zzzccc427@gmail.com \
/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