Re: [PATCH v5 04/12] f2fs: cache: introduce writeback thread
From: Wenjie Qi
Date: Wed Sep 02 2026 - 08:01:09 EST
Hi Chao,
> static int f2fs_cache_writeback_kthread(void *data)
> {
> unsigned int interval = cache_thread->cache_wb_interval;
> }
and startup initializes the field after `kthread_run()`:
> task = kthread_run(f2fs_cache_writeback_kthread, sbi, "%s", name);
> if (IS_ERR(task))
> return PTR_ERR(task);
>
> cache_thread->cache_wb_task = task;
> cache_thread->cache_wb_interval = DEF_DIRTY_CACHE_TIMEOUT;
`kthread_run()` wakes the new thread before returning, while
`cache_wb_interval` is initially zero. The worker copies the field only
once, and the sysfs store later updates the field rather than the local
`interval`.
Can the worker observe zero at startup, and can a later
`cache_wb_interval` write change the interval used by that worker?