From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B905C4332B for ; Thu, 19 Mar 2020 00:47:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A2052076C for ; Thu, 19 Mar 2020 00:47:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="UyUB0eHG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726973AbgCSAra (ORCPT ); Wed, 18 Mar 2020 20:47:30 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:42708 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726866AbgCSAra (ORCPT ); Wed, 18 Mar 2020 20:47:30 -0400 Received: by mail-io1-f65.google.com with SMTP id q128so484588iof.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=fy/U0Hkyk5Vs6kTCx0a+jUvcQNFBJLmMaMSEV1SW9JknTbPxPmMaGttvzznMVKbcOA HxpE+YZUY5S/VXL1O9Q7RkTjTZEXdtzt774mwKN1pBP+FB8iYZHXQVUO9zsYr+5F1Js+ NLGFpuUAX2sEbDSqJG9GCIj2qOhuvY42RaNRNrSxEHqPC2RsmuVFk5b3EGIGQTBcjiQr MVbTc1UW4RpFMey3YB1sW0CHxWIU0hNPu36CS9uNVsLE8V+7rSCSI9mz55bd+ReZ9lQa XvHmxCoYb3oMMJ/ZLHtA0Yhn52Z/PBrqE7Nnndc6eQA48msvuF2NWjCh2naaaeoPTeUS PwMA== X-Gm-Message-State: ANhLgQ1wG4rhuHJm0Jf1iNUe8Vm34TSZaeOm53KlHwTYWuv8ud36s44K X4gaSIjvct92AaX50rLb9MIKIfYGjIb5XSIj1V4iAw== X-Google-Smtp-Source: ADFU+vsUlxX18RINXbTIKk/71K/n1UmMkxX3JU9OJ9HNcL+q/mSD0Gp2PA3I1g/jz2/K2Yt2Ke+h8g36hOL7IzNEeJg= 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: rcu-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: rcu@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