Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp902192ybl; Wed, 28 Aug 2019 07:01:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqybjdXkd24kIjn28IHEPcZV3YFXBybIfQH+pEuwHDsS9JCHnTYtFd4QOHzaGHEGTGEgCD26 X-Received: by 2002:a17:902:a706:: with SMTP id w6mr4684898plq.166.1567000865311; Wed, 28 Aug 2019 07:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567000865; cv=none; d=google.com; s=arc-20160816; b=eIOgbBYPZM76CFaWndSb5L+8XwmW+lCzOgOv9FDMgBOQPL8Y3BrRMkS4wNoKf1C1PL pXkKrBxsqUXkIhib3Mj4XE+DE1rPDxGP10y8nyO0+gGXl+5EW+s/HZf/D1oDIMVf4LIr Jq14sOS3Iri4IzuJDeRmBqSROn/s0ulTXA/8xSyxpGKMkyoqhXIijRHdU3gxXfS2I4pB T6qxA/s631Yiaj0jnTF1rzpJfI3WEDMZ1vCXlcZ2W0JADeef5crThmr0+0aIfd4m4Dlv kULKhKrECpB5EIj7PmOAhBzK/6VuFlf1Bt7SihlB13nZ/Q0XPUGhxEmeqOaOFJgDxMUe TtDQ== 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=IdGG/Tv13HB/jDILsDDPH2sexv8IMLLCw/Cf3bLI1Rc=; b=ca6HXA5MaE6RA7uuatj+FonxgU7ws0yvkFHpIlXycnbr8eZQAwJO56wKqdTgFQZOdm YIkev3GG+pxvSknusUQMS1I6EOL3r8BzQ4keQkDWiZ9iAD+y7PQ8fpkoWXSiY49Bcew5 lw3FOE6lPS3b7vqzBo1KU5R3q52sMbLdEiR3l9+f+lUvjp5xUYnwP5GBiMmc2nAY2iKP LkmgNlV8v6ylE/xPaUvNuIxeMzmCyIVyeM1FA7nrNfv0Fadn5TTfbwzuAEDbqtsihfzH y6rO4iIoyZCL4r8AwsbJz48rimj++xvbXePvvx6Ga0WNM3EvU9BpfUx8ES88tCpwfSDs cprA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=AbjIeNTJ; 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 x1si2344723pgt.258.2019.08.28.07.00.49; Wed, 28 Aug 2019 07:01:05 -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=@joelfernandes.org header.s=google header.b=AbjIeNTJ; 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 S1726894AbfH1N7m (ORCPT + 99 others); Wed, 28 Aug 2019 09:59:42 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36728 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726541AbfH1N7l (ORCPT ); Wed, 28 Aug 2019 09:59:41 -0400 Received: by mail-pl1-f196.google.com with SMTP id f19so38426plr.3 for ; Wed, 28 Aug 2019 06:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=IdGG/Tv13HB/jDILsDDPH2sexv8IMLLCw/Cf3bLI1Rc=; b=AbjIeNTJdvT8UsPdHGTT12NNasMgExZWYbimmHn3akOFWqZo5wgbHDHcXXpGroWQB2 uptGhkTezCH1ZayGgMAm+32q4TEMahdbAhHBxApgA/EJzqTfT3X+1/EzxAgoJCK2QhBr VWfMYhFTKIVBBwHtx7miec3zKod/pMhBqXPMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=IdGG/Tv13HB/jDILsDDPH2sexv8IMLLCw/Cf3bLI1Rc=; b=NLpR+oGieE7S36K/j8gOvgBLX22RXU7gmStvRth14han7IUr57Ab9zJbnzSEiXvO1k OvbuwelH0Ro4nmI6KybZvyqPTH1UDlJaJ4eTvQBUXny+PP2zoCrcNLMlroifoqfu2ETp yCGxRi7AEp3VR7BE+tB9wG2A5NPBRAUNjrst5XRGPNtXsoueZ0123aKMsTH6kmD+vvAm C8opEFtSMreaBhEo4f4Tw7QwDiqwayGwsGsRd3wZ7vTx9Ev1iHtdPCRr8ZNLE0gyrIFe wOdc4vcEU6XwxAyQ7G8UvYHqA7gmU0HHwobfDAb2ZSNM9LDWLJwW9VTfArGIG14B5N0l UTfA== X-Gm-Message-State: APjAAAUGpvcOU5i7E88iIDG/vwITIxBfi9dylebFZrGtdmckKez9cqP5 x28iEIdrj/VO7ZZb4tsDie9RFrJacec= X-Received: by 2002:a17:902:e9:: with SMTP id a96mr4579817pla.169.1567000781303; Wed, 28 Aug 2019 06:59:41 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id p5sm2805452pfg.184.2019.08.28.06.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2019 06:59:40 -0700 (PDT) Date: Wed, 28 Aug 2019 09:59:38 -0400 From: Joel Fernandes To: Sebastian Andrzej Siewior Cc: "Paul E. McKenney" , Scott Wood , linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Peter Zijlstra , Juri Lelli , Clark Williams Subject: Re: [PATCH RT v2 2/3] sched: migrate_enable: Use sleeping_lock to indicate involuntary sleep Message-ID: <20190828135938.GA230957@google.com> References: <20190823162024.47t7br6ecfclzgkw@linutronix.de> <433936e4c720e6b81f9b297fefaa592fd8a961ad.camel@redhat.com> <20190824031014.GB2731@google.com> <20190826152523.dcjbsgyyir4zjdol@linutronix.de> <20190826162945.GE28441@linux.ibm.com> <20190827092333.jp3darw7teyyw67g@linutronix.de> <20190827155306.GF26530@linux.ibm.com> <20190828092739.46mrffvzjv6v3de5@linutronix.de> <20190828125426.GO26530@linux.ibm.com> <20190828131433.3gi4debho5zc7hgc@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190828131433.3gi4debho5zc7hgc@linutronix.de> 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, Aug 28, 2019 at 03:14:33PM +0200, Sebastian Andrzej Siewior wrote: > On 2019-08-28 05:54:26 [-0700], Paul E. McKenney wrote: > > On Wed, Aug 28, 2019 at 11:27:39AM +0200, Sebastian Andrzej Siewior wrote: > > > On 2019-08-27 08:53:06 [-0700], Paul E. McKenney wrote: > > > > Am I understanding this correctly? > > > > > > Everything perfect except that it is not lockdep complaining but the > > > WARN_ON_ONCE() in rcu_note_context_switch(). > > > > This one, right? > > > > WARN_ON_ONCE(!preempt && t->rcu_read_lock_nesting > 0); > > > > Another approach would be to change that WARN_ON_ONCE(). This fix might > > be too extreme, as it would suppress other issues: > > > > WARN_ON_ONCE(IS_ENABLED(CONFIG_PREEMPT_RT_BASE) && !preempt && t->rcu_read_lock_nesting > 0); > > > > But maybe what is happening under the covers is that preempt is being > > set when sleeping on a spinlock. Is that the case? > > I would like to keep that check and that is why we have: > > | #if defined(CONFIG_PREEMPT_RT_FULL) > | sleeping_l = t->sleeping_lock; > | #endif > | WARN_ON_ONCE(!preempt && t->rcu_read_lock_nesting > 0 && !sleeping_l); > > in -RT and ->sleeping_lock is that counter that is incremented in > spin_lock(). And the only reason why sleeping_lock_inc() was used in the > patch was to disable _this_ warning. Makes sense, Sebastian. Paul, you meant "!" in front of the IS_ENABLED right in your code snippet right? The other issue with: WARN_ON_ONCE(!IS_ENABLED(CONFIG_PREEMPT_RT_BASE) && !preempt && t->rcu_read_lock_nesting > 0); .. could be that, the warning will be disabled for -rt entirely, not just for sleeping locks. And we probably do want to keep this warning for the cases in -rt where we are blocking but it is not a sleeping lock. Right? thanks, - Joel