Received: by 10.192.165.148 with SMTP id m20csp5104625imm; Tue, 1 May 2018 09:07:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpJunQ0YWvATKaVeL1llAQs8WcgySY7uzXr9PxbmWnFKz2h5IfBCDJzVt8WHXJSOVJuBlG9 X-Received: by 2002:a65:5088:: with SMTP id r8-v6mr8264126pgp.80.1525190851100; Tue, 01 May 2018 09:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525190851; cv=none; d=google.com; s=arc-20160816; b=otSCAtpf+cfipc8/od8ebXa/+2z6BQj68FXc/FWcbYeQd8cq0tDOxUF6C14jhwT/w2 /8hQlI7h3wnV+MjbCrFGXCozjDAseiZVqDvsCqSmCg7EfNZIReKTPV8EvItarMfMBbf9 8JkVKRGLdVgbrkJ1mKzWwwWjmyQTsVsdx6eI3T4Bgpnc7m5qAia2802K0Ysxn5MkxptE QOD6Cb6kTBFOQ6K4HmUEqtQUp1CmOX5Z4ETHABU2RasHaGu43YnmW7R0LP+DdSrjFdLp MG/U73XBx2bRhE3+x8aWl9WSq53e24DofAr8Qu8l1UoFcJal5KzGVqLtrDX4DPbSPZhR dzkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=OD1w3MEU/uA+RUlAg3T4ueSTAGC/kGUfhu8q0AMOvI4=; b=gGi0dU8HnWy/x8HZUswY0HRjpkdMz6e63zN32g8y5DR1gdlZ47uJ+jLUqOcZpzJwPO X2GM6xV1nNgjMdMuVo5ZLWpX0K0DcSZcrHD75JIXy2CLjyHEXfk4C+JpjYZM6usXzRYV ZiVqxvwUyRxI+uBie/VhWlpRHkZ4Zynaoo/6MrbC0bhGkj65uPTHskofC+WcmjAhj5/X pk25sth/NBnfmr3ePW+7mzgJSokPvzYqjMCNeDkXvfAyjDiodD1iv/401KEl0bSt1Ziz ZdW919Oa+rU5z4YFzmzpXLogrTChv7fouTfLBMCwE+LOoh+DJqz5QXftwviQ+sz1tit6 06Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=bi1DVlX/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z20si9493923pfh.251.2018.05.01.09.07.16; Tue, 01 May 2018 09:07:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=bi1DVlX/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755658AbeEAQHC (ORCPT + 99 others); Tue, 1 May 2018 12:07:02 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:45678 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751071AbeEAQG7 (ORCPT ); Tue, 1 May 2018 12:06:59 -0400 Received: by mail-io0-f176.google.com with SMTP id c9-v6so7800531iob.12; Tue, 01 May 2018 09:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OD1w3MEU/uA+RUlAg3T4ueSTAGC/kGUfhu8q0AMOvI4=; b=bi1DVlX/rXVgZKyJv4skRZTtBcLoxfMC+3n9llwe19guNr7Ynz8NVexHkFVBczHj8p YVuh6UV6YvMZD5sLoMzrPS3Fx/lmUUzM0JJcs+tlkgyinzEdMP4uTplgkaMozX138RNL V6KChP7j+uRTM9O71KZlGr4FMSWodjGBz2FxA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OD1w3MEU/uA+RUlAg3T4ueSTAGC/kGUfhu8q0AMOvI4=; b=oBdIsxJFVlK27IRydiA9HPg5I4wnJrBDVGzaVjHDoSMBQFn2bt6kAGoiZKff4rn5mr xjPzFM9unP9IEcjY7h2QtO7yUJLfV91lcXB4PAl8RRTAWovGEXMWBdo8C0oJPkZH/8jG ku0T335RuXDc4iwBeakT/swjJWu3p/0FYPkOYHvpKRkmOFVy1O0EJNxMIovRWjEjJh0z hv/BcswmENdPx+wDLyPzlx40wzqtlKW2OGlhtofii1oXxfWOVoH5po7/RB3B0+bltlBl 36s6KrY7MGt7YdUk+vFEPwiN8GsPgPJLEDH6g85QtVK3FWshq7V01YMZVIiUO5GdpTSF h4QA== X-Gm-Message-State: ALQs6tCzNbdLZ1BMkzdOfe7BFKs4RMlsbcF43KApTCqGwtYnh/sGWaCu l0JFTS62C6+s8Vr0XkRgdNla/JEISQ7xZWfUqPE= X-Received: by 2002:a6b:afe4:: with SMTP id p97-v6mr15517195ioo.257.1525190818944; Tue, 01 May 2018 09:06:58 -0700 (PDT) MIME-Version: 1.0 References: <94eb2c05b2d83650030568cc8bd9@google.com> <43302799-1c50-4cab-b974-9fe1ca584813@I-love.SAKURA.ne.jp> In-Reply-To: <43302799-1c50-4cab-b974-9fe1ca584813@I-love.SAKURA.ne.jp> From: Linus Torvalds Date: Tue, 01 May 2018 16:06:48 +0000 Message-ID: Subject: Re: INFO: task hung in wb_shutdown (2) To: Tetsuo Handa Cc: Jens Axboe , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Linus