Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp456179ybi; Thu, 30 May 2019 01:07:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+G1BCpQyn28jglGvHwBqHGuN+lqdEDXoKdOs16OCWQqBA2yICDgN/r7+qIcWgmJ6PFd62 X-Received: by 2002:a17:902:3064:: with SMTP id u91mr2595913plb.244.1559203644070; Thu, 30 May 2019 01:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559203644; cv=none; d=google.com; s=arc-20160816; b=MLc0XxVXQL8dNFB36+dsCH21+jOWacpAU7BCNI91PMDkRmYQZ+AFOFe5RrrlZUjZjN H3HeujG1QYVk1EPjJLTD9nDl4cUwewuoayw1q4OBHd7tWchyy5K0tNzsnc+IsSdNMc9g YLOjhhZEv1zG3idA2fzUUGxag6iXSNDIrFlbdNKTVjzS3MLW5k89atyKxJsIj9cK3ijR t3BjT6iWeWFsrd773iSIIEgoJctW9wYwDyHF7KUQfrLOVhvtrOlxme7awVuroF3sulx+ FZZPg1cYaPXeYb6HttzGXWRg0tKGbAwCmQvUaC76IKxqo2mViewY2T0sBND1aNGpjJ8R tRaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZNHljSo+xuO+rijXANsB4tJFe4vq/fcU3WZ/qW7T1K4=; b=WA3w0faDSw3soYpxwLGnm/msIJytL9PkKmrK0zeH1WXlDUL5C7Oq9WbAosMTX5fGW2 fxTRpi9tfRsp2dzMB6eDfhDBOhbEwx+Cgxsb0VL6fj4AfkUeX/nKGTcLgDnT05TWsNVB FWRXN4bymML2/fv+NIifNj9lFb0KHI4H1B7BW8ama2+Rvssa2rEwOomtGiOL9SlepbRw 8KDPvCPMhxTZ4DP86rJqjUTq9R2gSORjJXO145JHUdrWhX4Gjgoc3sLkYGTx23hynAv8 2ndD9YTy7pqYoCNtvqm0GPj3pwSKWg60zyY6q/aMHjXBobi++iuUbysbx0C9LKtxKEqQ wtCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=wxvteZMt; 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 w185si3099956pfb.170.2019.05.30.01.07.05; Thu, 30 May 2019 01:07:24 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=wxvteZMt; 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 S1727814AbfE3IES (ORCPT + 99 others); Thu, 30 May 2019 04:04:18 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46660 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbfE3IES (ORCPT ); Thu, 30 May 2019 04:04:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZNHljSo+xuO+rijXANsB4tJFe4vq/fcU3WZ/qW7T1K4=; b=wxvteZMtqs4EUcTAMJWHqixz6 mFlqd2lJn4cAJwAR/hiRZrEL1HzdpfpSWviOKW76MazUqLmiCOX0GXm9QTDDGduA5qdqBmPAd1R7/ gtqvGkRUITnXCQaDqEVvt5XPaHTg+ZT+AMGLgBcwFJMbrTOd+9sLivPTHl8mHadihGFP0gX7iwini Q8Pj3wSK1+yjR342xlFv6RVYcZ+uBZY/cOmdfazWIwbFvd8oxQeWoMEc04vYPX77/yQa648a+tnc3 5OW0ffbHO3MaepHn+iCGQ4H+GGlo9+ea+OgZeFcCBAVm+/3fFP9eqtKq+q2nEJa3OQDIFlizD1mXZ w34kI7GWQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hWG2a-0004nX-GI; Thu, 30 May 2019 08:04:00 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D70FB201B3992; Thu, 30 May 2019 10:03:58 +0200 (CEST) Date: Thu, 30 May 2019 10:03:58 +0200 From: Peter Zijlstra To: Qian Cai Cc: axboe@kernel.dk, akpm@linux-foundation.org, hch@lst.de, oleg@redhat.com, gkohli@codeaurora.org, mingo@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] block: fix a crash in do_task_dead() Message-ID: <20190530080358.GG2623@hirez.programming.kicks-ass.net> References: <1559161526-618-1-git-send-email-cai@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1559161526-618-1-git-send-email-cai@lca.pw> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 29, 2019 at 04:25:26PM -0400, Qian Cai wrote: > Fixes: 0619317ff8ba ("block: add polled wakeup task helper") What is the purpose of that patch ?! The Changelog doesn't mention any benefit or performance gain. So why not revert that? > Signed-off-by: Qian Cai > --- > include/linux/blkdev.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 592669bcc536..290eb7528f54 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -1803,7 +1803,7 @@ static inline void blk_wake_io_task(struct task_struct *waiter) > * that case, we don't need to signal a wakeup, it's enough to just > * mark us as RUNNING. > */ > - if (waiter == current) > + if (waiter == current && in_task()) > __set_current_state(TASK_RUNNING); NAK, No that's broken too. The right fix is something like: if (waiter == current) { barrier(); if (current->state & TASK_NORAL) __set_current_state(TASK_RUNNING); } But even that is yuck to do outside of the scheduler code, as it looses tracepoints and stats. So can we please just revert that original patch and start over -- if needed? > else > wake_up_process(waiter); > -- > 1.8.3.1 >