Received: by 10.192.165.148 with SMTP id m20csp481733imm; Fri, 4 May 2018 13:34:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr47CVOEXoCV7gVTMvPg65/tYzvii4+z+PAsEZd3Bs7oLtlwgQUJ5KFjcDQvduR0JQGvYOn X-Received: by 2002:a17:902:6505:: with SMTP id b5-v6mr29048450plk.147.1525466049007; Fri, 04 May 2018 13:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525466048; cv=none; d=google.com; s=arc-20160816; b=qYsA1c/qLqqlZaOZCI9e7tKPWPsvNlv7+vXZCT5zssDITWG6797qF3VfNSLbyi/dvi o/NwiIzQVoiycCGIeFDy9bevP3mLUUhHwtrvE3LQ2FJZgde6+0y6M6INBU020ymVOeNu pv4fuHcjc5WSOR38fvQXWYnT5KLQgHvbTmvvxtVlg/rIda0GarrcfU1sVcoykG/wlwTs oEKGJwVlHKCzma7/iOU4rf/ZGBRbDYw7z58iYYZedq99/b0Y/yL2RaO8lRfd2W32P53x yjUcMPNyS6q8yX3lyM/hPAgPKjvw5H98jfyZdPW6WJbt33A/RZFWD3n31HPxAAtMjk+D feyw== 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 :arc-authentication-results; bh=EUQwhPPropaPUtaSzr9/VK3ajzt+biO6Cd3D61Nf6d4=; b=d4mxELtBmFjxqIDOJxpAqVxsD0OO1KANfmpQ7rzd4+uPqowycILl6TiAChxjOVacWi F3u3WicE20SqeaW0iVqAGxo1vx4brHqdfdXyOLZ+4C4W1ms7gGoFJlOagQg7Msu5I/Zr pOKfAjZuxS9C8Ykr+7WQPjGi8D19dllg4ikwxHsnSj0UVV/UxyGGWkV9DsXJH7y01uYt jLBWsWJfE6d9MEHeDOaqVrtoV8KqfaJ9xzRGsKi1z0IaFBe1v0CRrUH12TavDJbuAsff t+stp5LVQyeM8Zn/OS4nBhccMjc8ukY1he9msDnE6A7xKHyeHGcUhToVh4ZLiy403E0x 52ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=T4FVTX1q; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3-v6si16229277plb.478.2018.05.04.13.33.41; Fri, 04 May 2018 13:34:08 -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=@google.com header.s=20161025 header.b=T4FVTX1q; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbeEDUdc (ORCPT + 99 others); Fri, 4 May 2018 16:33:32 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:44773 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751651AbeEDUdb (ORCPT ); Fri, 4 May 2018 16:33:31 -0400 Received: by mail-io0-f182.google.com with SMTP id d11-v6so27067437iof.11 for ; Fri, 04 May 2018 13:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EUQwhPPropaPUtaSzr9/VK3ajzt+biO6Cd3D61Nf6d4=; b=T4FVTX1qHDwMjZ2a8ka3h8q9vW21VPW5hHSWNJjODADVkRmSgAi5AJeBuDT9+1zYjW QpOaQOFwtSHPA/1DaSdFOTUFuMwGA2F/+kHmZ/c2wn0droY5XIQV1y6zpWxKvBVWOh3N qhkWN8StANVGPvuM7cnKUbD3c8sYe/tZXyHKpjjFyJ1hAhP8L4sXZEBCRt96BYuGFS66 AWVvJ6dfVl9Y3ilEVhqyIzmoe7EUUyK5ghq45zaDVjZ0VwS0iHDW3inF3HgOJJ2QL2Gk 7sxhsqgAcDImA/jG17pSbd36jKYkOQsmFpkPoojMDPlhxph66XVYnBznVgsi79+JOfc/ mHpQ== 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=EUQwhPPropaPUtaSzr9/VK3ajzt+biO6Cd3D61Nf6d4=; b=HjIpPK/4tEQ3UoUTcZlfAdKc+9LllmH9iZXzM4MSPS3FErZqt3NefP7ITBWEHUbtmi ffJFi+wLoRnkNme5VqiU42wqpw8TYDTEMUpQnmowiEwQGlUaAa1WaHYu5R4Q5L7eqAVL cMnq14Wf5LYpxL5FT7b5X2apLn0CNKms4QUapa6YxkBmftKx8/0TB0wQzh4wd8LETR51 JJk3KyNHbhwOqeDXt0BIlC7y8YScHDE2L/em5KkwTStrf9qVXwQDTi86hd1PkyDGl0h/ fHuEUZgGjK8dHbBNEbxoPCxuvZYfRnVSVk5CSLy4CANuCfPfynYvQFb6oAgk7UgMVLX+ 2y+A== X-Gm-Message-State: ALQs6tBtxdaKtoM0LdSZgvi69ipBTZkP0sJhD3i5eifT2R0h6tLZH06+ HtgfA5ntpCxZyk1v1O6OTou8iypJ1IqksDLIRbaB9g== X-Received: by 2002:a6b:2251:: with SMTP id i78-v6mr29173765ioi.276.1525466010574; Fri, 04 May 2018 13:33:30 -0700 (PDT) MIME-Version: 1.0 References: <20180504123050.2841f80d@gandalf.local.home> <20180504174330.GS26088@linux.vnet.ibm.com> <20180504184951.GU26088@linux.vnet.ibm.com> <20180504201129.GX26088@linux.vnet.ibm.com> In-Reply-To: <20180504201129.GX26088@linux.vnet.ibm.com> From: Joel Fernandes Date: Fri, 04 May 2018 20:33:19 +0000 Message-ID: Subject: Re: rcu-bh design To: Paul McKenney Cc: "Joel Fernandes (Google)" , Steven Rostedt , Mathieu Desnoyers , LKML 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 Fri, May 4, 2018 at 1:10 PM Paul E. McKenney wrote: [...] > > >> > Almost. All context switches in an RCU-preempt read-side critical section > > >> > must be subject to priority boosting. Preemption is one example, because > > >> > boosting the priority of the preempted task will make it runnable. > > >> > The priority-inheritance -rt "spinlock" is another example, because > > >> > boosting the priority of the task holding the lock will eventually make > > >> > runnable the task acquiring the lock within the RCU-preempt read-side > > >> > critical section. > > >> > > >> Yes I understand priority boosting is needed with preemptible RCU so that > > >> read-sections are making forward progress. I meant (and correct me if I'm > > >> wrong) that, as long as a task doesn't sleep in a preemptible RCU > > >> read-section (rcu-preempt flavor), then bad things wont happen and RCU will > > >> work correctly. > > > > > > The exception is -rt "spinlock" acquisition. If the "spinlock" is held, > > > the task acquiring it will block, which is legal within an RCU-preempt > > > read-side critical section. > > > > > > This exception is why I define bad things in terms of lack of > > > susceptibility to priority boosting instead of sleeping. > > > > Oh, that's a tricky situation. Thanks for letting me know. I guess my > > view was too idealistic. Makes sense now. > Well, let me put it this way... > Here is your nice elegant little algorithm: > https://upload.wikimedia.org/wikipedia/commons/6/6e/Golde33443.jpg > Here is your nice elegant little algorithm equipped to survive within > the Linux kernel: > https://totatema.files.wordpress.com/2012/06/feeling_grizzly-1600x1200.jpg A picture speaks a 1000 words! :-D > Any questions? ;-) Yes just one more ;-). I am trying to write a 'probetorture' test inspired by RCU torture that whacks the tracepoints in various scenarios. One of the things I want to do is verify the RCU callbacks are queued and secondly, they are executed. Just to verify that the garbage collect was done and we're not leaking the function probe table (not that I don't have confidence in the chained callback technique which you mentioned, but it would be nice to assure this mechanism is working for tracepoints). Is there a way to detect this given a reference to srcu_struct? Mathieu and we were chatting about srcu_barrier which is cool but that just tells me that if there was a callback queued, it would have executed after the readers were done. But not whether something was queued. thanks, - Joel PS: I remember Paul, you mentioned you are testing this chained callback case in rcutorture, so if the answer is "go read rcutorture", that's totally Ok I could just do that ;-)