From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751128AbeEAVbH (ORCPT ); Tue, 1 May 2018 17:31:07 -0400 Received: from mail-pg0-f52.google.com ([74.125.83.52]:35974 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750743AbeEAVbE (ORCPT ); Tue, 1 May 2018 17:31:04 -0400 X-Google-Smtp-Source: AB8JxZpOkQxgETPsMs0p+G/mbev+ekqj+ssU9lQgFZUcez94UZtUXHYsWHIHidieJaaj08yVbi7Egw== Subject: Re: INFO: task hung in wb_shutdown (2) To: Linus Torvalds , Tetsuo Handa Cc: Jan Kara , Tejun Heo , syzbot+c0cf869505e03bdf1a24@syzkaller.appspotmail.com, christophe.jaillet@wanadoo.fr, Linux Kernel Mailing List , linux-mm , syzkaller-bugs@googlegroups.com, zhangweiping@didichuxing.com, Andrew Morton , Dmitry Vyukov , linux-block References: <94eb2c05b2d83650030568cc8bd9@google.com> <43302799-1c50-4cab-b974-9fe1ca584813@I-love.SAKURA.ne.jp> From: Jens Axboe Message-ID: Date: Tue, 1 May 2018 15:30:59 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/1/18 10:06 AM, Linus Torvalds wrote: > On Tue, May 1, 2018 at 3:27 AM Tetsuo Handa < > penguin-kernel@i-love.sakura.ne.jp> wrote: > >> Can you review this patch? syzbot has hit this bug for nearly 4000 times > but >> is still unable to find a reproducer. Therefore, the only way to test > would be >> to apply this patch upstream and test whether the problem is solved. > > Looks ok to me, except: > >>> smp_wmb(); >>> clear_bit(WB_shutting_down, &wb->state); >>> + smp_mb(); /* advised by wake_up_bit() */ >>> + wake_up_bit(&wb->state, WB_shutting_down); > > This whole sequence really should just be a pattern with a helper function. > > And honestly, the pattern probably *should* be > > clear_bit_unlock(bit, &mem); > smp_mb__after_atomic() > wake_up_bit(&mem, bit); > > which looks like it is a bit cleaner wrt memory ordering rules. Agree, that construct looks saner than introducing a "random" smp_mb(). As a pattern helper, should probably be introduced after the fact. -- Jens Axboe