Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2624060rbb; Wed, 28 Feb 2024 07:36:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXVvLNB/Vr2c9D+p0UE3J/D7O1W30uq2p6JwDiaKVPwHKjmS+prfNEXVVjwdU2cHXVRVGd/+eHruf/eDWk1STJJdwF5zD3FGr8fAok5EA== X-Google-Smtp-Source: AGHT+IGJwWMNke/oJnR+QEf+KIqAVs/nO4ahGLoqqva7LW/j1wMWzcIwIzxZaXukvRZEbBI2IEQL X-Received: by 2002:a05:6e02:601:b0:365:29f4:7e27 with SMTP id t1-20020a056e02060100b0036529f47e27mr14510470ils.19.1709134579260; Wed, 28 Feb 2024 07:36:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709134579; cv=pass; d=google.com; s=arc-20160816; b=KPcnmB+pvQHcm6UUi8m92QyPS3FSlbfjpJZFE1PPVBRM14Hh7iS5pW86sgSwWS/mxL I2R0R0u2H5Lsk2+i1jnkbXLvqeGoHOHj5bB9/yqgq9x/gdj4Gq/unG0rUB8NLlP0fx/B m5Oz9M9iDEu/oYogB1wujqkl/oZBnVvIJdXm5a/u99yYtcl0CktZPZlC2tyvwU79+EQd k3TxkKCdShhBoUu+XB81FT6ZJ5MRrn868wBzEErZ8YbcK/Cv26F6ma+RJ3YNP1FwJECJ 3wv2Fu/wCsucGESl8WN+c29uLIJhr+Nt0OskYEhtYvBYpy5rkWTtYMylTDZ8u5pn1sv+ BJTg== 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=OtMuA61vWK1xv77bgXXyUW1pvXO47ck3QAdbJ1pzZAI=; fh=ErtXUfiESczMFfh3pQaMrgg4ClyJpxfILPPKN+9WSyo=; b=RjAKtLM7/Cg/6jO6960ilqwdcd7yr+qktwPVpK2txHCbp/adZtYAjffxFdh07SlcsO kMnRrWhkn3VUg1XBTjt1FXYelHdkZSAMp992eZ4wYbeWvS/dithCQmvPVj/s/xFkwgpF 0c64EHpsVhTadUs6cbM3WN/24XHLowim7wo+8+S2B2XZXPFBHA6MIwT3PcjyVX0bb2HP UI69obiZFQV+315hncXIzFCRibKe8p86yrmAjwxg7txwvl36KK9dZ0SyG57Vn3B0knC8 ylsnG++/5okyAWMrgeYZq7tZCqqthTS1bCjaHSewe6nz7GQCeqOi/OWppPQ3K9wvlHFE H+Vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FjYMzDmK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-85268-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85268-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s38-20020a63ff66000000b005e453190df2si7483932pgk.296.2024.02.28.07.36.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 07:36:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85268-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FjYMzDmK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-85268-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85268-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2597C2882BE for ; Wed, 28 Feb 2024 15:35:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4A1B15CD65; Wed, 28 Feb 2024 15:35:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FjYMzDmK" 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 F40C515C8; Wed, 28 Feb 2024 15:35:46 +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=1709134547; cv=none; b=DQWT9cJAB8zQaNkHNPtiQ/TRpl8O1gzAc+QkDKiibobV3ryjcRD5UxJEU/6/bhF48ns0+hoa2iBPHiI7DcBDlSeh0Kp/0m7PPIyfOM3eO44t3WlSAAtuTzbNSl2rL/h1TIZ20lSByCLmzdMCluDkmsox3ChNkbZ5DuREBJo6Rgw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709134547; c=relaxed/simple; bh=Ow0oMcjP9WmZsxfrrSXHg6DV3yhPxuTY7U/vGkGDAk0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=csgnzSLVlTTcb1Cv+erbMmfOX7wxqGgzghGR5/J9/r/VvstR/b82kBRGMWVQzmawsGCmGSbEI3tdHugdlJ4rHj1kXdMKtPhX1Z9Uihh6vPPDNGXH1vb3CWYGIDgk0KUOVD90hyXZ9ReMv4Siy0z9zzz1ztOyHhcmCtHWz8tE3Tk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FjYMzDmK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5059C433F1; Wed, 28 Feb 2024 15:35:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709134546; bh=Ow0oMcjP9WmZsxfrrSXHg6DV3yhPxuTY7U/vGkGDAk0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FjYMzDmK0IQosaEYUJyTURCigp714oQKlOA4XW/fr2d9wr8GLnE6+YlOaCtrPYr1/ AyLRbs5tT5JQu/HwctS/gctasVnVJVwXuGXeNTZnQjvTSTVZxVag3mZtDxGNxs5tti HmO7dNDqYzNRe5oVx2/Wtvw/5/yy063g8AaLRgn6a7mnCM7uFY0PPePV2OEQr9gynR AP9mR9vW4/PRniAk3bZ5mzZ/3b9uZEfqnM+4y5hd14dPnqEReYjWItA7iW22h1JKcO zOGRGtY00+x1vHsKfvKN1RCp84agHNXre1rxFBqKwGFIE0J60FVW3dJnZkw9O85OC+ iRT5HPXD8FyiA== Date: Wed, 28 Feb 2024 07:35:44 -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: <20240228073544.791ae897@kernel.org> In-Reply-To: <9a0052f9-b022-42c9-a5da-1d6ca3b00885@paulmck-laptop> References: <20240227191001.0c521b03@kernel.org> <66a81295-ab6f-41f4-a3da-8b5003634c6a@paulmck-laptop> <20240228064343.578a5363@kernel.org> <9a0052f9-b022-42c9-a5da-1d6ca3b00885@paulmck-laptop> 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 Wed, 28 Feb 2024 07:15:42 -0800 Paul E. McKenney wrote: > > > Another complication is that although CONFIG_PREEMPT_RT kernels are > > > built with CONFIG_PREEMPT_RCU, the reverse is not always the case. > > > And if we are not repolling, don't we have a high probability of doing > > > a voluntary context when we reach napi_thread_wait() at the beginning > > > of that loop? > > > > Very much so, which is why adding the cost of rcu_softirq_qs() > > for every NAPI run feels like an overkill. > > Would it be better to do the rcu_softirq_qs() only once every 1000 times > or some such? Or once every HZ jiffies? > > Or is there a better way? Right, we can do that. Yan Zhai, have you measured the performance impact / time spent in the call?