Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751204AbcLELnn (ORCPT ); Mon, 5 Dec 2016 06:43:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48965 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750816AbcLELnm (ORCPT ); Mon, 5 Dec 2016 06:43:42 -0500 Date: Mon, 5 Dec 2016 12:32:13 +0100 From: Oleg Nesterov To: Peter Zijlstra Cc: Davidlohr Bueso , mingo@kernel.org, john.stultz@linaro.org, dimitrysh@google.com, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake to not use wait-queues Message-ID: <20161205113212.GA31288@redhat.com> References: <1479495277-9075-1-git-send-email-dave@stgolabs.net> <1479495277-9075-3-git-send-email-dave@stgolabs.net> <20161203021839.GB30078@linux-80c1.suse> <20161205083605.GQ3092@twins.programming.kicks-ass.net> <20161205112636.GA30280@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161205112636.GA30280@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 05 Dec 2016 11:32:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 424 Lines: 17 On 12/05, Oleg Nesterov wrote: > > Yes, but on a second thought task_rcu_dereference() won't really help, I forgot to explain why, see below. > #define xxx_wait_event(xxx, event) { > // comment to explain why > WARN_ON(current->exit_state); Otherwise this process/thread can be already (auto)reaped and wakeup can't rely on rcu. And task_rcu_dereference() can't help because it can return NULL in this case. Oleg.