Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3560465pxp; Tue, 8 Mar 2022 17:28:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxY1t3O5M7vEjmn2ArlaHIu6v7LzQ+NKSZ448LFhlSJq4yADznaEEpgInMTfZhL5u2AiImW X-Received: by 2002:a17:90b:1e05:b0:1bf:4673:7e7d with SMTP id pg5-20020a17090b1e0500b001bf46737e7dmr7955227pjb.10.1646789318157; Tue, 08 Mar 2022 17:28:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646789318; cv=none; d=google.com; s=arc-20160816; b=vYPVfETFWj7OdoBzJ5Pwv1OyFGoH2JmhgM7ROKDz+AErFANgtDTkoBZCHzEkeP5yMQ 2eOGX9jzpL6H+jzIWRCf1H0TK7Zyd0WjBEV0CNI6heG4Ef9RX7E2I/ve9chKvNaiDs/a CFc6Ipa8BPOdocYjEgR/pVK0LYoS4b7LCd67qFArPRvlPZEWUibN9Y2h1IFMfSQtcT+R 5xe21IgfWkhVlGmdqnfzP9leXoRldnKAxLOhr2iXFi1FfJUseS+2qNuVjHZqgbfT7Ybo gp7NVfy0HS2DOlQmzAU5TWGM5oPRvpJ5knMc5i9/70gHcgrm0nkqBphQL6qnxx2Do0HN 8GZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=vvffHUrzjEmVtlp+Y2Xsgt8CHrDNJiwaK1f48maOz2U=; b=fjsnYzBtPLKbtbJoKtWORhgI3UQEi8r22CK7Z5QIjdfvVovQuoWNYoKacxsMV/YreR kIB/6NFG/ZKyvNJtuzJabNw85eRlgbrDcMLjNU6mLpvsMMfV8JLR197Pm9aqfid9yj9l UXOvzBlHlc77GvFz5J093WqxtG/lURcnx2qfVYvKdFT/M+gaBUTsQRI5fMfF9EX8kEpJ Wq13LHstKHnnbAG/MsJvzrGZiWGBIlk9dOlKWX5NtYCt7ewKhq9XpClaH1nPU3PMS+A7 3OBnIDHZWLuLsdAHK9fO1QXej4Nd7DX6ugsK4ATKkH1FSrJcgffBv3RGczOqjhxje6KO l5lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SWQLN6PW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m22-20020a17090b069600b001bf73a5460csi664280pjz.0.2022.03.08.17.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:28:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SWQLN6PW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9C49A175829; Tue, 8 Mar 2022 16:17:28 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237613AbiCHS1E (ORCPT + 99 others); Tue, 8 Mar 2022 13:27:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349696AbiCHS0n (ORCPT ); Tue, 8 Mar 2022 13:26:43 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C70326112; Tue, 8 Mar 2022 10:25:21 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id w12so9419457lfr.9; Tue, 08 Mar 2022 10:25:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vvffHUrzjEmVtlp+Y2Xsgt8CHrDNJiwaK1f48maOz2U=; b=SWQLN6PWd4COaUmnVPN0qI4SG70QpRqNhN3jZOQtYhbB8vQuhsbTjOHjfwj0QJlbvN 0OWiTH9oFkO61pTm+hykxIEeA3D0kyc9g/MZS1mMO94+oH28LioTw9QXtYXRsOcgwARW cxUfA71CzkG13WLm3kp4ZcjLyMA2QgsB33Y/OxmxgXRfW8I05Am2GBPDIhHvj/B4axFx +6e+QUgB7ZRjyZyNsAV9Pg8Ih2kVy7/wjTGUQgjlEDpLUFWjpqXawfW2uP0jRl2WcEKQ Is+dxioyCnfhAC0x/u1z6Vo0zj5i1mGF09w01ZguNXs5mpWMtia9NOPbZKSTciX1Shiq S4Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vvffHUrzjEmVtlp+Y2Xsgt8CHrDNJiwaK1f48maOz2U=; b=QIm8d0pNMXn3cUvJfvW01dtvHIVzyCYrv6YoHxZw+vT2J6LsamQe3kgDnj75/dGKLj f9GW50tYgYWuxOj9f6+Q3q2SzblHRuAneBwRCtown2nh8Z/mbdvZeIWBXqXq/cyXuJqZ BPGXmxLdL7HTilHEgvsMg9zV6eHKUtCq4OUzHPaI9ZDUWsjhgq/uLDVooSscAK/DTKx9 nvd73WiOkCWLZBeQKakZx5rFSww1MFPzyyFhuvaGyvS1syR2yWqUx/P00YFqoDc1HAg7 7J79Rk7JXL1+ivBeyediHLiIfQrd4Dzkg+okA/jsQloyKpX50VsYCsO8yG2weyl1OYQ3 mbLA== X-Gm-Message-State: AOAM53137HcHexaqXBPQgLQK+7ouqx1jPQR3x2A9XLqkTeYTzikSLXEP n0AIK+/En3nIxFAM6jzMIXg= X-Received: by 2002:a05:6512:348f:b0:441:e30:82c8 with SMTP id v15-20020a056512348f00b004410e3082c8mr11725536lfr.451.1646763918105; Tue, 08 Mar 2022 10:25:18 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id h6-20020a2e5306000000b00247e893075asm1374434ljb.37.2022.03.08.10.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 10:25:17 -0800 (PST) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Tue, 8 Mar 2022 19:25:15 +0100 To: "Paul E. McKenney" Cc: Uladzislau Rezki , "Zhang, Qiang1" , Neeraj Upadhyay , "frederic@kernel.org" , "linux-kernel@vger.kernel.org" , rcu@vger.kernel.org, bigeasy@linutronix.de, juri.lelli@redhat.com Subject: Re: [PATCH] rcu: Only boost rcu reader tasks with lower priority than boost kthreads Message-ID: References: <20220304092631.4123188-1-qiang1.zhang@intel.com> <81f69dd4-6ca9-760c-bec5-5cb27afbe788@quicinc.com> <20220307191512.GN4285@paulmck-ThinkPad-P17-Gen-1> <20220308181355.GW4285@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220308181355.GW4285@paulmck-ThinkPad-P17-Gen-1> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 08, 2022 at 10:13:55AM -0800, Paul E. McKenney wrote: > On Tue, Mar 08, 2022 at 07:04:21PM +0100, Uladzislau Rezki wrote: > > > On Mon, Mar 07, 2022 at 02:03:17AM +0000, Zhang, Qiang1 wrote: > > > > On 3/4/2022 2:56 PM, Zqiang wrote: > > > > > When RCU_BOOST is enabled, the boost kthreads will boosting readers > > > > > who are blocking a given grace period, if the current reader tasks > > > > > have a higher priority than boost kthreads(the boost kthreads priority > > > > > not always 1, if the kthread_prio is set), boosting is useless, skip > > > > > current task and select next task to boosting, reduce the time for a > > > > > given grace period. > > > > > > > > > > Signed-off-by: Zqiang > > > > > > Adding to CC to get more eyes on this. I am not necessarily opposed to > > > it, but I don't do that much RT work myself these days. > > > > > > Thanx, Paul > > > > > > > > --- > > > > > kernel/rcu/tree_plugin.h | 10 +++++++++- > > > > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > > > > > > > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > > > > > index c3d212bc5338..d35b6da66bbd 100644 > > > > > --- a/kernel/rcu/tree_plugin.h > > > > > +++ b/kernel/rcu/tree_plugin.h > > > > > @@ -12,6 +12,7 @@ > > > > > */ > > > > > > > > > > #include "../locking/rtmutex_common.h" > > > > > +#include > > > > > > > > > > static bool rcu_rdp_is_offloaded(struct rcu_data *rdp) > > > > > { > > > > > @@ -1065,13 +1066,20 @@ static int rcu_boost(struct rcu_node *rnp) > > > > > * section. > > > > > */ > > > > > t = container_of(tb, struct task_struct, rcu_node_entry); > > > > > + if (!rnp->exp_tasks && (dl_task(t) || t->prio <= current->prio)) { > > > > > + tb = rcu_next_node_entry(t, rnp); > > > > > + WRITE_ONCE(rnp->boost_tasks, tb); > > > > > + raw_spin_unlock_irqrestore_rcu_node(rnp, flags); > > > > > + goto end; > > > > > + } > > > > > + > > Why do you bypass the expedited grace period and boost any tasks anyway? > > Same way the expedited gp can be blocked by higher prior tasks SCHED_DEADLINE > > or SCHED_FIFO. > > Just to make sure that I understand... > > Are you pointing out that a SCHED_DEADLINE task might have exhausted > its budget, so that boosting might nonetheless be helpful? > SCHED_DEADLINE we can not preempt nor stop it somehow(highest prio class), it has some budget it makes use of. If it is in critical section then it will leave asap, i do not take into account here IRQs and so on. I do not see a reason to boost it. > > Me, I honestly don't know what happens in that case, so I am just asking > the question. And adding Juri on CC. ;-) > Juri should know more :) -- Vlad Rezki