Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2312147rbb; Tue, 27 Feb 2024 19:10:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXfsDKFQTxsKCwtBoGFMnI97BmDhYsU1voQLcw/fkStlTL5y1Vs/3FKrSvx8Pbr9l5VBWBtTFWSFLZ0z9AH1HS/Uy8u9L+Fs0EX0SNa/A== X-Google-Smtp-Source: AGHT+IHtl5X7JW2r6pLinrMfbm3zA9T8BnsWKK6clbQnWJB83KRADrqBv6HLnB88jXgIuMTerQZa X-Received: by 2002:a05:6402:1a5b:b0:565:7114:ef37 with SMTP id bf27-20020a0564021a5b00b005657114ef37mr9162002edb.12.1709089816296; Tue, 27 Feb 2024 19:10:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709089816; cv=pass; d=google.com; s=arc-20160816; b=cK0ym4UaHepgoD/KTmsAWq6FYDlyrRXVFE/Wr/wpp3mxkengBoogv5xK0dVMoBm1/N NUv5kODMwOtwtk/1o23UjY2jwVURlP+7koZ0WmKwvwGh/IGcYOhcPWEWXMs+ylmYeXVD 9VWQGR4yJCzoSHyIJrMKstGPYge1+2tkDny0KWCcvqu2FwD890vqq6NcZ4neck4mxb4P rBUur0jYy5F+z/NXyGMEtRsMytynszY0kJy0ef4SOZ6XHXi+Y1GbisLrXEHPkZD5eydy 2ydX3J+yrhjBWSh6OkZn2JQKr84H0evH06xJqKWLeI80i97xUzkxA178VdPnntsMnpBt TO5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=+xNoO+xrHnFQ59V25e/6HHudkryrxBv+QYL9cO82iGM=; fh=ErtXUfiESczMFfh3pQaMrgg4ClyJpxfILPPKN+9WSyo=; b=q6dbxl8l2D9owgdzai54slOfWo3SztU4KbA+HmT7jOQ5pkaXCN1OYxcOnB2vxpfi+K rjVdXaDrVQty5tE+a+kdW3ITSGEuCRtTIw03uoK79+ChxeowJsEUXCBVH2wHvyupqUix F8tukh2WSymugrPup/el9uyY1tDTpsWrVZF1HFm0tAX+Ud1cYR623ajGCY6i/+NWGu8x Ml6WXAS6MQdVL61MHbcY6jA52MVbIT5l+XilNY0/h6UvxVdLDxCUN7tYTCeB3exZ8F9u cEk3nPpc+j/8qNYZzEZlO5Aobq0CCFnRf+5bq6KAWWuKGfSUws2HAOquKAnALPY91VRX PS4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=saYAPfc6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-84462-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84462-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d23-20020a50fe97000000b005648769c8f6si1259582edt.442.2024.02.27.19.10.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 19:10:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84462-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=saYAPfc6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-84462-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84462-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A5ED01F2BFAE for ; Wed, 28 Feb 2024 03:10:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D5451DFFD; Wed, 28 Feb 2024 03:10:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="saYAPfc6" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AF931CD38; Wed, 28 Feb 2024 03:10:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709089803; cv=none; b=W0GOtTUbBuipUhR4gKNUejUmmeCztSt3fRKzYhTdDq6baGEJm0+l010bMsJcMcl3oMb60+Nh6mgCNEjY/cd/rB2nAexhUkIm7HEwN8b2YJRfJFDDUP9yicRCBcm/E9zFaEMW8n/ycNxMo86iQLj3zoOUF2DEf5zOetVP7Q+eh2Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709089803; c=relaxed/simple; bh=W1euSk2De6m04QbugcV3iEslzHM6DSXT6L5/C0cY1lk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SboPAmL40f6FqEOjsPwvIBkgXaEAk0zpKmwt8nb4/O+/IHUPRRDn85/qWQjcMPadbsP5H8q12NFYdH56q3FN/T9ZTfYIAhnF+FtYGtofOLy31+Yyi2zk6WwCdz62I3EMUgsKwLkOcdjhXmonbZfkuUZZNxtU9Qr8Jm1jGaFXdbA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=saYAPfc6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0237BC433C7; Wed, 28 Feb 2024 03:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709089802; bh=W1euSk2De6m04QbugcV3iEslzHM6DSXT6L5/C0cY1lk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=saYAPfc6j4YBJ3uQBiGwbbcpxK6wAWD7rZIcajfBMzEFKrMN3l+bblAnUV57aPA/2 zChRMz9ZxEb+eCnt7pg7JOFbSQWvG3n6heg88CTbymdAhsmKSPr2cQ4qLihjDtwAN5 wsiZBMPv5kugTrqsAkMckFRbZJQ+7yFDdD9Kcrb1pf8TZogBhC1h/61NDaBs5eWqQr Y/GmVCZmbfc291DfsQDEmLJZZOJelD1RmdphjI/NHNV3I2BeQGqaCeDsooHE4jQxK7 CPI9MbOvn4SDiLQ7e6QCpcLi42++wyIoicIQ7K/CrJMEnzSazyd7WOIkEH3QeRjcmB T1uqiCqKoxpdw== Date: Tue, 27 Feb 2024 19:10:01 -0800 From: Jakub Kicinski To: "Paul E. McKenney" Cc: Eric Dumazet , Yan Zhai , netdev@vger.kernel.org, "David S. Miller" , Paolo Abeni , Jiri Pirko , Simon Horman , Daniel Borkmann , Lorenzo Bianconi , Coco Li , Wei Wang , Alexander Duyck , Hannes Frederic Sowa , linux-kernel@vger.kernel.org, rcu@vger.kernel.org, bpf@vger.kernel.org, kernel-team@cloudflare.com Subject: Re: [PATCH] net: raise RCU qs after each threaded NAPI poll Message-ID: <20240227191001.0c521b03@kernel.org> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 27 Feb 2024 10:32:22 -0800 Paul E. McKenney wrote: > > > + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) > > > + rcu_softirq_qs(); > > > + > > > local_bh_enable(); > > > > > > if (!repoll) > > > > Hmm.... > > Why napi_busy_loop() does not have a similar problem ? > > > > It is unclear why rcu_all_qs() in __cond_resched() is guarded by > > > > #ifndef CONFIG_PREEMPT_RCU > > rcu_all_qs(); > > #endif > > The theory is that PREEMPT_RCU kernels have preemption, and get their > quiescent states that way. But that doesn't work well enough? Assuming that's the case why don't we add it with the inverse ifdef condition next to the cond_resched() which follows a few lines down? skb_defer_free_flush(sd); + + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + rcu_softirq_qs(); + local_bh_enable(); if (!repoll) break; cond_resched(); } We won't repoll majority of the time.