Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp81127ybg; Wed, 18 Mar 2020 17:49:57 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt3J4XpVp3eF3D0sFTFwb5T1uPSZ/tvDV2LUnZ4ZHrn4ijqZk1Sf/Lp11hlYOs3+2+TiBoH X-Received: by 2002:a54:4e9a:: with SMTP id c26mr519642oiy.144.1584578996950; Wed, 18 Mar 2020 17:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584578996; cv=none; d=google.com; s=arc-20160816; b=EqoypPSbMvLL9mSUt44sTz9zuL8qS+6SjCA8FTqNHDS9twYkVC4uEhMsqvnesA+TRJ B2nEbN++Or7QxCJLOMVfmeWNr91bEEB3oj9rPJKYnBEYGah2yqljZIBaEu9klfGWOYhs CiSJejblne/UC1F6sienL/KtqpVSXo7ZfS++gs53smEZ4OcTx7t4XOJrRlzAmi6jcNNe 3aEktD+4NJU040llX1DUwUJZ+W78OR/sCJMZwpqWGsjtlHcNJxIbkAQWE1XLGpFBurqf NwOPQJhGCMOm1Bf0YssxCABANBaREqAm9J+74eMcdrdli9Qr6yPNeJyPLpPukeyPRN1g pJ5g== 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; bh=Nikfs2mITY1YnXregatCfjsnN0VxQx1MLHWWy5mZepo=; b=luLl+iba6s5nSyLDsZdehZvMJEpoqUdG284dcH6v7aBGxQMrLX/PtWww7YMx5I1i8E df0OuCywNP84EfLoHVh/ZgFas+lbDWI6Lyp/i5op2hbD5VnRccthOnrubmnXQYIRbZYB 0em8KtCgt9LR1jMzrpwJXQqyXijfIZkvR7AlWcFA81a3EiDxVMNai4mNkKwR5klxhk1D t/qBmhUO6SY8S56d96VVoMWaNUobAO/I7bAv3wNTReADCGhmR/BGdZFI8juNFMUUrwvf 6hS6ctxhI5DSVI0cmnQoC0OYdOVCl4I1aMaO1pfPmCuWipsauu0elJtgOkInCLJOx2Mn xL8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=UyUB0eHG; 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 v9si343008otn.120.2020.03.18.17.49.44; Wed, 18 Mar 2020 17:49:56 -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=UyUB0eHG; 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 S1727099AbgCSArc (ORCPT + 99 others); Wed, 18 Mar 2020 20:47:32 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:42709 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726866AbgCSArb (ORCPT ); Wed, 18 Mar 2020 20:47:31 -0400 Received: by mail-io1-f66.google.com with SMTP id q128so484589iof.9 for ; Wed, 18 Mar 2020 17:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Nikfs2mITY1YnXregatCfjsnN0VxQx1MLHWWy5mZepo=; b=UyUB0eHGnGw9m1dq+wwqfipb+e49FVRrNMBxA7casT2HN+Z9yLj4EKGNR9lyGbcx55 KkQujx6BOLkfj/DMsoWnz4gc8HQgeuNk7J/Ymzcgcr9a3WZRujV1KBRPHVHqxxFqrHsL rC6cZTsbs2NrBW6LkZ8snTeMclPM8M1h3wAvA= 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=Nikfs2mITY1YnXregatCfjsnN0VxQx1MLHWWy5mZepo=; b=bGDjDKyyFtBRVHSbZAIwc6xKvhBL7JaRg3W92Swaal7kdlAlL1vnCncy15pOxq2t2B 7gw3pnLxUxAT0a3wZxLIn1HUwsiXv3w+/MWMFhCJb9Gai4/1J97jKYySGlEdwDMRPl0d aK3heSTNlQ3L1HtmsFjBJsCN/+MvVl9svUNV80fhEHavUIm7g4bODmp26MuLihebggT4 WThyL2cIu+BKT0ky6iD0+TAi6OvCihLAq6VY12DktChZWagsRsblybQ9VzltLUY7QRMl yzddR830ZpXry4+AdUdCPeAm+pJhg1v2WuVNu/I1rzmunlbi+fr0KcbgF0zp5hiSsZjZ 0I8A== X-Gm-Message-State: ANhLgQ0wEtcpZxfE0oMOvyVBXH+0vO9aR9LsN1+RZVXutoRGRY/J76Cl krZpDhGfSDFcChZXIE1A/myuyUV1JfrqZCz5lTokVA== X-Received: by 2002:a02:c85a:: with SMTP id r26mr829137jao.74.1584578849973; Wed, 18 Mar 2020 17:47:29 -0700 (PDT) MIME-Version: 1.0 References: <20200305003526.GA20601@paulmck-ThinkPad-P72> <20200305081135.yg7wryd3hrqzocrm@linutronix.de> In-Reply-To: <20200305081135.yg7wryd3hrqzocrm@linutronix.de> From: Joel Fernandes Date: Wed, 18 Mar 2020 20:47:18 -0400 Message-ID: Subject: Re: RCU use of swait To: Sebastian Andrzej Siewior Cc: "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Thomas Glexiner , Scott Wood , Clark Williams , Juri Lelli , linux-rt-users@vger.kernel.org, rcu , LKML , Ingo Molnar 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 Thu, Mar 5, 2020 at 3:11 AM Sebastian Andrzej Siewior wrote: > > On 2020-03-04 16:35:26 [-0800], Paul E. McKenney wrote: > > Hello! > Hi Paul, > > > Or is there some other reason why {S,}RCU needs to use swait that I > > am forgetting? > > swait can be used in hardirq-context (on RT) that is in a section within > local_irq_save() / raw_spin_lock() and so. > wait on the hand uses spinlock_t which can not be used in this context. > So if you have no users which fall into that category then you could > move back to wait.h. In RCU, there are some truly-atomic code sections containing an swake_upXX() call, which would be considered atomic also on PREEMPT_RT, one example is: rcu_core() contains an local_irq_{save,restore}() section. /* No grace period and unregistered callbacks? */ if (!rcu_gp_in_progress() && rcu_segcblist_is_enabled(&rdp->cblist) && !offloaded) { local_irq_save(flags); if (!rcu_segcblist_restempty(&rdp->cblist, RCU_NEXT_READY_TAIL)) rcu_accelerate_cbs_unlocked(rnp, rdp); local_irq_restore(flags); } And rcu_accelerate_cbs_unlocked(rnp, rdp) calls rcu_gp_kthread_wake() which does an swake_up_one(), so I think we will have to leave it as swake_up() the way it is. thanks, - Joel