Thread (39 messages) 39 messages, 7 authors, 2018-06-18

Re: [PATCH] bdi: Fix another oops in wb_workfn()

From: Jan Kara <jack@suse.cz>
Date: 2018-06-14 10:11:08
Also in: linux-fsdevel, lkml

Possibly related (same subject, not in this thread)

On Thu 14-06-18 06:04:04, Tetsuo Handa wrote:
On 2018/06/14 1:45, Jan Kara wrote:
quoted
On Wed 13-06-18 09:25:03, Linus Torvalds wrote:
quoted
On Wed, Jun 13, 2018 at 9:21 AM Tetsuo Handa
[off-list ref] wrote:
quoted
Since multiple addresses share bit_wait_table[256], isn't it possible that
cgwb_start_shutdown() prematurely returns false due to wake_up_bit() by
hash-conflicting addresses (i.e. not limited to clear_and_wake_up_bit() from
wb_shutdown())? I think that we cannot be sure without confirming that
test_bit(WB_shutting_down, &wb->state) == false after returning from schedule().
Right.

That's _always_ true, btw. Something else entirely could have woken
you up. TASK_UNINTERRUPTIBLE does not mean "nothing else wakes me", it
just means "_signals_ don't wake me".

So every single sleep always needs to be in a loop. Always.
Agreed and in my patch it actually is in a loop - the one iterating the
list of active writeback structures. If we get a false wakeup, we find the
same structure in the list again and wait again...
Indeed. I overlooked that wb = list_first_entry() will select same wb again
if cgwb_remove_from_bdi_list() is not yet called. Well, we could update
"(in which case we also wait for it to finish)" part or move the body of
cgwb_start_shutdown() to cgwb_bdi_unregister() so that it becomes clear
that false wake-up is not a problem in this case.
I prefer to keep the wb shutdown in a separate function but I've added some
comments to explain that.

								Honza

-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help