Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp762234pxp; Fri, 11 Mar 2022 14:27:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWrhaU7WWQiCZjBGM4kftI8RziS30Jr5Ne05iXhiztC638NOJxFiu0OlAVeL1dumKT1qY3 X-Received: by 2002:a17:902:ec8d:b0:151:cab8:9aa9 with SMTP id x13-20020a170902ec8d00b00151cab89aa9mr12145246plg.173.1647037635919; Fri, 11 Mar 2022 14:27:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647037635; cv=none; d=google.com; s=arc-20160816; b=hc/dOsdc7OpPS90fsEmAW12VioLvfAYn3AykJ73SXssfhlFgp8gcmcmB2CWbehIs4b BWGIdqPt5rFrq3eNrJtybhKYqFgY/9ieRVFSQtUTfkx/JoGGOJJW6Yt7EJlrc0tegJ1F rqv20RRLnYm3HzpZtQbRhbvo5yAohugcdeGyxWMhROZYEhjEXJ0w7vlDzKnQyoROjzQc eqvL94YOdXexf44jwUAaJqQZsg41sJb/+/MBFzunQ5AXJXhPWL8n28/iWXd+ed61XzYN 1UmNvJY3Qa15UPmCYliZLJu7SNb1tEu+dKobvJiM0/RP8wIvc5sQPowo8faRc12rQdil WQuA== 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:from:dkim-signature :dkim-signature:date; bh=GK5kqQHemVr2nXivfkjnq6IRlHLXNPENtFaPEUWb0P4=; b=jrCRAId5vY4NA6P8AZ2+99ZEVqn/S00ILsLaohWCflDaplsaBCJWF0XUDceMPZ8iIq Sd4Kt5Yh0/8BUalTD5QWd7uqLadhYkZ0dikohbKhF5k3EmDlSLrLJGaxcgknxslTYVux Fra7VgSdz9Lmw8369loAolgZS0Yr2hYFPrLebXiv/ZFvBHr7netbWmnw8eNXM83Vohtk 93Pie4FH/eN7fgCkuWilJLdRa4ngoMahxqnxOzywbA6Z8dIuwnKsmj9QOaWOumH1j5nj tcrnITj0S1vLBVMutRVU6Kisj4SeKYWokxBded+zA4ot8zBceRgkw7q3rtgcK2aUproE TXbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ad3UiFEf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="xHH/2VCt"; 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=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a7-20020a170902710700b0014fc1558b77si8238276pll.189.2022.03.11.14.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:27:15 -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=@linutronix.de header.s=2020 header.b=ad3UiFEf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="xHH/2VCt"; 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=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA3732E5F2F; Fri, 11 Mar 2022 13:35:26 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348110AbiCKLK2 (ORCPT + 99 others); Fri, 11 Mar 2022 06:10:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231795AbiCKLK0 (ORCPT ); Fri, 11 Mar 2022 06:10:26 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E065561A26; Fri, 11 Mar 2022 03:09:23 -0800 (PST) Date: Fri, 11 Mar 2022 12:09:20 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1646996961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GK5kqQHemVr2nXivfkjnq6IRlHLXNPENtFaPEUWb0P4=; b=ad3UiFEfhH+4RXD/hpf46e5ECQWj/Z1RqlaFGYMMEcYiorHhiGuCryu6thV8/L2uUgxjeL 42CNfwEsieKykSqNUfvKkYJ83cjHYX5tqNZYKK173NWdf7at/0NPuou15FlEUmEmZVBNtB Fk0CAlcKsw08uI5eodJ7Nu5oKtDW/znS6hn9PgPWzhN0qpablQMpRqGk4DF+sNN4N/yznr squSQqJnAPJs0DrkYHRq8FSqaIhIbMylP80aus7/DXVV/Gq/kv47ur14Eh/LFii4QQBmjC yTv0eVxECi4MjIKQZFYnxdIKSwNwAoZw+51DqJPKI5ahz+DlxW9d4UxHjjAN6Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1646996961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GK5kqQHemVr2nXivfkjnq6IRlHLXNPENtFaPEUWb0P4=; b=xHH/2VCt8STQSu3zB4FWCZYCKuTMxJ2xW+C6eL9K/PrgA4zapU31shzdqy57OmeQWF3R9g OA4PkFL6MlRTsoCw== From: Sebastian Andrzej Siewior To: Zqiang Cc: paulmck@kernel.org, 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: References: <20220311022226.595905-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220311022226.595905-1-qiang1.zhang@intel.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 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 - If it is not RT prio, what is then? Higher or lower? Afaik it is always >= 1. > 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. 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. 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. > Suggested-by: Uladzislau Rezki (Sony) > Signed-off-by: Zqiang Sebastian