Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp442170lqg; Fri, 1 Mar 2024 09:41:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVwLUmzsXD1zuimq32RDPjD/4Q7G1V5qTZr11R8Rz73k7gGUsggPgS8hEJLSU9RnnLh0b8td5pmBGJujvPquU8pVh7u3Ic5zCZmN2xxXQ== X-Google-Smtp-Source: AGHT+IFBRoYQTsK+dqabLL6qEXTapKse/tjAIS15g6x5oEQaIb6P00WYwN54oYx9AJ1PlDBlNm2/ X-Received: by 2002:a17:906:16d6:b0:a44:98dd:a30c with SMTP id t22-20020a17090616d600b00a4498dda30cmr1413330ejd.64.1709314913856; Fri, 01 Mar 2024 09:41:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709314913; cv=pass; d=google.com; s=arc-20160816; b=mpKaXq6JSdZYqNuigDvaX8djSqk0jlXrc4hxYoCglG5J2GH1uTIZmeow8BIPwRxL4P 9HaSt+azP8uGob1D5vfgjNEOWMjroaoctd0eR/XrOdL2X2Vqxd2+uErXQTF8UO4vWCwk qRt0k2V5rJ1eMkHDRLVDazOUXHBRqUgyu+lvg284Kr5ZVD8dG0IOrlLv6wFNaSaVKPUH NXKEyiZHqD5QXk/AFXQd+hk8v+5bvVXwlRz+G+YbESr4ZkcTP3ZYmHo9dzpPN338q3Ol 8+qNIdb9JURx4r5ofpJezjw0279Bnvz/kFEGRm6MQE6BtdTldDSRtAkkamtj0TXwIkAE pezw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Im9Umr2T85hMOmj0bpnRxcaABawqPpPhu4ZR7NKNsVY=; fh=Rx9/IhlFbrsVRYjq4P8wPntuGgQeNgz4ahHTZ9Da4q4=; b=AOHUUsaGPRYLi+rB9CnpmYYPytz3wvrD4geRZkOv6HqgdxNOLnx02bAtgtuM2U1+SJ a+e5bZ8WCLSRY+yWimsGBH2Jkj2MU559gSmwyRfodaUaLggNjheZU6VuRMUJQW0WOE3n sXNAjdGNXzrcl7vk42ftjFqs6Z3BTqC+Nip7MbRCoxNNDNCdVgQWeW4FAfKtcA557Sm3 tHnsYnwhy7tNER6voXO2nHH6/L5T8j3O15ytHB56NMg66PIq7/xAza3BfApsoC94ZzRf qzYn0hKNUztg+W6QLBF4yksE6JW7d2cAIabsF61yae+Bnh8/3EzVmYo9wLl5MLCMNeAf eKQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b="d6DDV6/E"; arc=pass (i=1 spf=pass spfdomain=cloudflare.com dkim=pass dkdomain=cloudflare.com dmarc=pass fromdomain=cloudflare.com); spf=pass (google.com: domain of linux-kernel+bounces-88835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g13-20020a170906c18d00b00a436cf1bd26si1586334ejz.732.2024.03.01.09.41.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:41:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b="d6DDV6/E"; arc=pass (i=1 spf=pass spfdomain=cloudflare.com dkim=pass dkdomain=cloudflare.com dmarc=pass fromdomain=cloudflare.com); spf=pass (google.com: domain of linux-kernel+bounces-88835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com 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 B822F1F2A3B2 for ; Fri, 1 Mar 2024 17:33:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2113249FF; Fri, 1 Mar 2024 17:30:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b="d6DDV6/E" Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C20A22618 for ; Fri, 1 Mar 2024 17:30:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709314243; cv=none; b=K/fGnGxVfcZCRhBIIUgfQk8/2ghiPQMeuKi2qV60fnTcfJkR1iqtI/vR5+nA8AvQwACSQdTIrUFXC+UNtA7wr5mAPahch4tYfxlqPGCXWWeESD7V1z7ryGfzjWOUXgXA0Gun4WahMN2+bTrcqnyUmQ/o0X62vjUsNTl8EpjFXS8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709314243; c=relaxed/simple; bh=ylK+D7JueGqF19SPnHZNe+5mxcvVGQNvmcj6EMAxZD4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=I6lNvRDxXtSmxYhoKebE+wyOejIb/6c4+8JS5Xk977UgvRJH1wybNaEk9gRnkSWDN8eA/9DkIAn5Qa2jvw0pFHTv7Yg7PmyD/UijjQPF1bDt1+7HEsG1+TmLZPAicdLyElxy44y1StkQarwwusC3OdzCV1mbzpng8t6SuJKWqGU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cloudflare.com; spf=pass smtp.mailfrom=cloudflare.com; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b=d6DDV6/E; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cloudflare.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cloudflare.com Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-565b434f90aso3717889a12.3 for ; Fri, 01 Mar 2024 09:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1709314240; x=1709919040; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Im9Umr2T85hMOmj0bpnRxcaABawqPpPhu4ZR7NKNsVY=; b=d6DDV6/Eiarm0bJq1DNTlh7R5wtoJ1ISKdiLl35Ys/jOwOfcieS/bmafgVOQVrkXeY ESnDnJkis662XNZsXul5BOhCtq55yO9ZIiVPwAB2TuZVEYRZm/SIxvqDJA6V9M9iJQZl 9T+b9NmKN2s6RgXn4cDFSevOL2kfTYkO4/z+ceLX8eEzOlWcfDb9UICjw6K+kjB/i3Eh E+tW80Zd9ALMirEfyGDsOdlREIDyG4cV484rrH/5CT64fkpaKiq4ZEsgLt2K84pI7WjT GPOKDPvrhcN7rlmx7VPKSPm/UFdw4pEyJHc8EtNQeYnh+GiWdg8VU9bNhU8/zxZUWvSs q7/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709314240; x=1709919040; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Im9Umr2T85hMOmj0bpnRxcaABawqPpPhu4ZR7NKNsVY=; b=tBdZWoVgbt2Xsb0DwQLxOvSVZ8P63wYm5UgK4mPjbHYdUWWuLo961qbTWZhCN1FApv BBaxLDHIEtAC08xtK0XrnsRiMvNboveksFE203oBc+F0Xqc3fOpltTKSlvgfTlxyiQ34 KkzoHe9M1+Yp1PvycKFnk2o0X/kUevEphom//jNOajimc2UM6apLAsmJomqp0zQTrTqC YA8KRFYCHsJcDPdY3XYjyVv6UVpx7KIP1RPKUX+QsyA/2BKltPU3GUNYDIzXZze1r8Ea efg1dKKUtGH47VB3Rg+XWfMfJOqSvVPbvV0twvW89esgMG+17n0C7GPdbfJzq0I3gNv3 aoSA== X-Forwarded-Encrypted: i=1; AJvYcCXg3CfLxDVQo7k4cNjmz7KasZ9oYznXORgEItWKfMIakTcgg0kj2xZSAgxAy23hTrhm51XMx0hgzrrTNQI2KUUGvmYxXxWBcsStVbPU X-Gm-Message-State: AOJu0Yzk/R0+sMbbXfDoJSZxKFQ4nUoJuItn74Jm0InYr2WEblCXeyzc eHNGKHgndLjGFlT46zCDndwHc3MqoODzdP5MLxRZ21ae7677bQlik0nD7kXvuC/FO8iuZVhiwF3 JNzd9hPo2A9aCYgQkvWyQ/fyccg03u/8mjvK67Q== X-Received: by 2002:a05:6402:35cc:b0:566:f851:f53b with SMTP id z12-20020a05640235cc00b00566f851f53bmr334043edc.35.1709314240646; Fri, 01 Mar 2024 09:30:40 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Yan Zhai Date: Fri, 1 Mar 2024 11:30:29 -0600 Message-ID: Subject: Re: [PATCH v2] net: raise RCU qs after each threaded NAPI poll To: Eric Dumazet Cc: netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , 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, Joel Fernandes , "Paul E. McKenney" , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Alexei Starovoitov , Steven Rostedt , mark.rutland@arm.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Eric, On Fri, Mar 1, 2024 at 2:30=E2=80=AFAM Eric Dumazet w= rote: > > I could not see the reason for 1sec (HZ) delays. > > Would calling rcu_softirq_qs() every ~10ms instead be a serious issue ? > The trouble scenarios are often when we need to detach an ad-hoc BPF tracing program, or restart a monitoring service. It is fine as long as they do not block for 10+ seconds or even completely stall under heavy traffic. Raising a QS every few ms or HZ both work in such cases. > In anycase, if this all about rcu_tasks, I would prefer using a macro > defined in kernel/rcu/tasks.h > instead of having a hidden constant in a networking core function. Paul E. McKenney was suggesting either current form or local_bh_enable(); if (!IS_ENABLED(CONFIG_PREEMPT_RT)) rcu_softirq_qs_enable(local_bh_enable()); else local_bh_enable(); With an interval it might have to be "rcu_softirq_qs_enable(local_bh_enable(), &next_qs);" to avoid an unnecessary extern/static var. Will it make more sense to you? thanks > > Thanks.