Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp935098pxp; Wed, 16 Mar 2022 21:52:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztK4N2GHTeZLDWn5X/kck2u2C8KqfY+ApU2ye2DJP18g+c9+k9sIEFMrWRDR5dYZZdlLcc X-Received: by 2002:a63:235b:0:b0:380:5d91:6cc with SMTP id u27-20020a63235b000000b003805d9106ccmr2255985pgm.183.1647492725403; Wed, 16 Mar 2022 21:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647492725; cv=none; d=google.com; s=arc-20160816; b=uiqY5BCQMEgwzswibyveCSCUNa8U6CJuh8RDB53R9SGGed0FOZhZ2SQFWR4f+yKGt/ 0ohIWEiZryCPL4bKbeGP14K0dPKWxNkA3m3vDljI3tnrSilV0kW0Qo5IXFh5Q+RC0Uch 6TEJpQ4YMU/HHPBtq8A87z2xjG6uJYPeWmGiBZsXoWpTfQtAYutMDPZfLWhqvHx7ub/+ IERen10UjX9WLcLGVjzwj2aG1Lqm+HEH5up/GuvelRcrQIUWlaB9dpD24DFwkhzxCGIE fw2jd9ujW7HCX33/3YWh5T3zDCTNDoXfvyHlhotKPOlTlNI7NErQ4wIDTr+yCD8Uwv4A IedQ== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=EhRjbNmzy3kvjkHFQBsumk6swAB5iNIQQGbDCpbXpvk=; b=v6Nz/eiAJXPbr+8jG3c4AeNDejzHvS/P1uVOhm+/65bJYNt5PRvsS0OLNVZ4DfjGa/ 11xbJSNjaFmkJcrgTxMcCxelsU+UMSGQLBf7EsgzBbeSj+9CTHchSM0pGuzBmOZKuQAP NBSabqp2fpEFG0CjZMkNYSvhbccQdzIv+rBCX+RjCT5gO5t2c2n5oXS97UlrRRUNydSB mlGVAyotJOR3ES3TVZLSSICAKgvIsC+sYp+MPVDw9I3dGdUAKJOFtuUuKnvmA7ihvoOH HE9zUBtPqX/NJm+XRhGrZWdpDQDoge0N8PT0HfZEnW0sMmrgtcTchDsM5SRmt9W3Jr+f Fjvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Asm6Trp5; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d13-20020a170902cecd00b00153a65188e0si3875433plg.575.2022.03.16.21.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 21:52:05 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=Asm6Trp5; 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=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 343A3164D39; Wed, 16 Mar 2022 21:10:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347106AbiCPRAu (ORCPT + 99 others); Wed, 16 Mar 2022 13:00:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232373AbiCPRAu (ORCPT ); Wed, 16 Mar 2022 13:00:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8B9453E12; Wed, 16 Mar 2022 09:59:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7517EB81A66; Wed, 16 Mar 2022 16:59:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29167C340E9; Wed, 16 Mar 2022 16:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647449972; bh=cnadLeya2RVXcK9hXSU+BT7h71m43eVlGL4w/1EEdG0=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Asm6Trp5HmdK9kspYRj08hT5NKP0OhV2Al4rL93IFQ0r1FAazVmg9SAzV04GjP61b MgQY93B68fUm903vgOutIvTisAm8staIjJdU1+Ru2lc5yuuoOj7Jh+DO0/hJqdIc1Q tEiGYO+u4ZCM7IgMeNJ/gk43NUzg+gzjyLRkVOTOogknfrqwBXGZuiuvKtj5OLI6K9 ogvO4cRzGXnLcolLB1jzhiiCMNZp6xmJ38Zblk2cUwxbsyJmaPX/7S78whfvSXf8x/ 39Nn0DjCJ2aGIVexvzNq6U7zp3EN7iobNjo3O9xiIrOY/kmrz1UcETdmS6NdCSkJgz xE64vCC36WSOg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B75675C0387; Wed, 16 Mar 2022 09:59:31 -0700 (PDT) Date: Wed, 16 Mar 2022 09:59:31 -0700 From: "Paul E. McKenney" To: "Zhang, Qiang1" Cc: Sebastian Andrzej Siewior , "frederic@kernel.org" , "urezki@gmail.com" , "quic_neeraju@quicinc.com" , "josh@joshtriplett.org" , "juri.lelli@redhat.com" , "rcu@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3] rcu: Only boost rcu reader tasks with lower priority than boost kthreads Message-ID: <20220316165931.GI4285@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220311022226.595905-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Sat, Mar 12, 2022 at 03:11:04AM +0000, Zhang, Qiang1 wrote: > On 2022-03-11 10:22:26 [+0800], 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 > ^ Period. > > > have a higher priority than boost kthreads(the boost kthreads priority > > not always 1, if the kthread_prio is set), > > >>This confuses me: > >>- Why does this matter > > In preempt-rt system, if the kthread_prio is not set, it prio is 1. > the boost kthreads can preempt almost rt task, It will affect > the real-time performance of some user rt tasks. In preempt-rt systems, > in most scenarios, this kthread_prio will be configured. Just following up... These questions might have been answered, but I am not seeing those answers right off-hand. Is the grace-period latency effect of choosing not to boost high-priority tasks visible at the system level in any actual workload? Suppose that a SCHED_DEADLINE task has exhausted its time quantum, and has thus been preempted within an RCU read-side critical section. Can priority boosting from a SCHED_FIFO prio-1 task cause it to start running? Do delays in RCU priority boosting cause excessive grace-period latencies on real workloads, even when all the to-be-boosted tasks are SCHED_OTHER? Thoughts? Thanx, Paul > Thanks > Zqiang > > >>- If it is not RT prio, what is then? Higher or lower? Afaik it is > >> always >= 1. > > >>>If it is not RT prio, the sanitize_kthread_prio() will limit RT prio > > > boosting is useless, skip > > current task and select next task to boosting, reduce the time for a > > given grace period. > > >>So if the task, that is stuck in a rcu_read() section, has a higher > >>priority than the boosting thread then boosting is futile. Understood. > >> > >>Please correct me if I'm wrong but this is intended for !SCHED_OTHER > >>tasks since there shouldn't a be PI chain on boost_mtx so that its > >>default RT priority is boosted above what has been configured. > > >>>Yes, you are right. If the boosting task which itself already boosted due to PI chain, > >>>and Its priority may only be temporarily higher than boost kthreads, once that > >>>PI boost is lifted the task may still be in a RCU section, but if we have been skipped it, > >>>this task have been missed the opportunity to be boosted. > > >> > >>You skip boosting tasks which are itself already boosted due to a PI > >>chain. Once that PI boost is lifted the task may still be in a RCU > >>section. But if I understand you right, your intention is skip boosting > >>tasks with a higher priority and concentrate and those which are in > >>need. This shouldn't make a difference unless the scheduler is able to > >>move the rcu-boosted task to another CPU. > >> > > >>>Yes, It make sense when the rcu-boosted kthreads and task which to be boosting > >>>should run difference CPU . > > >>Am I right so far? If so this should be part of the commit message (the > >>intention and the result). Also, please add that part with > >>boost_exp_tasks. The comment above boost_mtx is now above > >>boost_exp_tasks with a space so it looks (at least to me) like these two > >>don't belong together. > > >>>Yes, I will add your description to the commit information. > > > > Suggested-by: Uladzislau Rezki (Sony) > > Signed-off-by: Zqiang > > >Sebastian