Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2661585rbb; Wed, 28 Feb 2024 08:38:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXbnoPnQDyKuyP3k6099sBv57cVq7waaUcakUcsKRBSzWg18QU5M6w0hVv1mxjTE93VwpMvc/gttW3VQYKFHZERud11p/fuaSXCPyG3ZQ== X-Google-Smtp-Source: AGHT+IFUHj69pCMxqbdRaIdnf8vtd4hMDjcWlF4kIjqKMvZP1nsVDy2uQIW9BwJIenWSh97VoSTX X-Received: by 2002:a17:906:b28a:b0:a3f:da1c:ae4c with SMTP id q10-20020a170906b28a00b00a3fda1cae4cmr126332ejz.54.1709138299811; Wed, 28 Feb 2024 08:38:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709138299; cv=pass; d=google.com; s=arc-20160816; b=qgL1E/LMgfnB+tqsvfsSREJ1Yt/l6I4EXTl1mWdZaiAnsuc40VqcNnlE/Fc9yMpNH5 JA8I1dNxhei6npDN+ThVb89OxrTobycf1YiBhRcHVFZ8FOGtN6XE2JSLyb8+2gIa3byg gk405H2HysxVUOjk0IY1JPtixQxk1uDgBX9O3jooxjCILl8jZ3LBC8/KgGeWMaDDsEaa aKiDOTkwo1nOJkrhr7rBZgjGK7MnO1gZs8dqEM99TWXiXBbB0tEttHWkJvQOfXNpbMJ+ 2oXnQzR3GJKrolMEdLbvR7D33KU9TCTOoQ/h9YEE2TslMlwLmPjkfp05tNdbeJ9JDAc6 odVg== 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=EWAQpAUpfQCDhx0rGjR9Oel5LgwsLKY+ggnWMU654+8=; fh=mbK5JQS6WLLJuoJQMDf1LzLSHypXifYNdAjTddORIxU=; b=f/00op7eWkKtschZ2OlIGrjCc2vkszA8sWUJkNLqOl1EesSNO+uLLuUVGC7+S/2irl PJAHkGkCBa68hgKRFN51RcafXWyxP+UHObdMfHEIHwaS2PgAbAj5LiHwr5IEgz//Es5t 5dHk7UyjEt6e76QWM/5FC1U2Z0NLDwLNCZEJFkk6D7Joz4OFyk6e7UVGr3xkYG87GO2S Ua3k7onAIr81R+IMoTgMaeXqc5koZbvW74aqArGu2lqG2Ef0+hGqEznCySaVVxg5XMqw DZO2vHP+W/msCJNeNo+eYJ8IKLW4l/Dk19JdVRnRYvfzZhievE9CD7rhm8bYNzpnOFNJ MN4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=LdkB87zd; 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-85375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85375-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 hg10-20020a170906f34a00b00a440cbf3d65si525345ejb.185.2024.02.28.08.38.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 08:38:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85375-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=LdkB87zd; 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-85375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85375-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 8F86F1F255CF for ; Wed, 28 Feb 2024 16:38:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 566091EA91; Wed, 28 Feb 2024 16:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b="LdkB87zd" Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 A484F6EF17 for ; Wed, 28 Feb 2024 16:38:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709138285; cv=none; b=uu7GUd4j+8PdVbsSvZxPlm5Ub4jfsIhCWcayHiodOUu/mY6oRnWjUp4ZMfSTzoU5fvKjsICUa2oUQTszfJUTe5l4c0hgLV/WyS0cSiecRShHHd/XLZ5T0NelKG0FAVv42VlXZG8XYSpjU/yS+BKMxExjb0G+30UFwqaIvlReBEk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709138285; c=relaxed/simple; bh=9PTeAYYKh6BghzUQ5SY1FEoCFtAzge8LlEvtJa+/mwI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=o+cYPMuC1yg6yBg/phcdbGOTR/2zXzwfdfmSa/NZiJzh0rTBLBVi+g64MjJ8nR7x+GtDNxxvxadiyAyUz0uxkTqbWPawwDrQnSTju3ngWMMzT18LO7mSzikxEN849XCI2UPS3NRKvyiI4LSKrMsdqU2vlVJq8g+tym7HCZxPKcI= 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=LdkB87zd; arc=none smtp.client-ip=209.85.208.44 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-f44.google.com with SMTP id 4fb4d7f45d1cf-563d56ee65cso7875034a12.2 for ; Wed, 28 Feb 2024 08:38:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1709138282; x=1709743082; 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=EWAQpAUpfQCDhx0rGjR9Oel5LgwsLKY+ggnWMU654+8=; b=LdkB87zd/3Ey/TszPdJTjeBQW0CD8ooalvGxGuuwIAZDzqDmWaj0B/AU3vvPUzguME efMh/O1i1e4AdYTsJ3LCDduY7WErH+GOcYL3Ekt+sK6CmLuLTCFWegQfToCkq+bDYAjC ExlXDdy4kn7Lo124FUzyhxciy7Avg9lImGOpWtlvlk2DK1rWKQR+3x8FfYJHE1mWw477 IjVO27AnTPrNXoYNbzQ0lKRhYwuSxcxok561LJwnPBBkVcNrAYGKF7vy11qiqQ56HaBN WD60dlG3pOb5Q0iKZKsxGKSXPkiwcJeiOVS1+KjFR/wXicr3DWprGwOJwMT5FsaH4iBW wFhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709138282; x=1709743082; 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=EWAQpAUpfQCDhx0rGjR9Oel5LgwsLKY+ggnWMU654+8=; b=UuTjpKbsoor+BsqDYOonvUEP6suiSjXiZH0UPRL6Zw+RJ7YwUNvbLHUsNlEJ4oy8Bm 7wtrCgJ26kqhnPGEQYctO/hsL1fqCvIvcS6IrMTYAcPBi3T4vwyc9t3StF2S50ruM/z3 xfaaIz87PutAAUwrp0dYnZuxmfJH1ljzx2Ov4/LN9GOanxQsQ78Ub97cQK+XOmBf7KXK mJu2PqMDxS7OIDGAESDenqtdiHqm3/rf4vaKHnNx6px5FkgC9Ny1Xe/YxDsKkBy3BId/ uJ889DeYA2dUyDBffz5rr5Km5UfSLQRm93IBfg1OtTfhjprdIuANQ16oSpfj1VRo9+oa jA0w== X-Forwarded-Encrypted: i=1; AJvYcCVdbRDCCTwkIXNOlQ525beLnu95vr6FejH9ITMd433ok0nZR8dkP6llVj//HX3k0xnZO7lnS5ETQ1VGy66RJH0hMzBS4VhOpiwOS2FY X-Gm-Message-State: AOJu0YzXhSZTmxNXitaSZPDo86mnlVBqIBY+diSDz8VjwsjwEkRrnH3o jDgsdeHDuIaZpAJmIQZRjAe5Yqlto7e+lG7G3sgCk/1Klg8PBKo2SMVsCv/mVlzLWVhu5GuTQaE ttv40arZ9/+c7NmAoOlLZuw93fqpcCJzawrT+Wg== X-Received: by 2002:a17:906:e8f:b0:a43:49ca:2473 with SMTP id p15-20020a1709060e8f00b00a4349ca2473mr193121ejf.0.1709138282075; Wed, 28 Feb 2024 08:38:02 -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: Wed, 28 Feb 2024 10:37:51 -0600 Message-ID: Subject: Re: [PATCH] net: raise RCU qs after each threaded NAPI poll To: Joel Fernandes Cc: paulmck@kernel.org, Eric Dumazet , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 28, 2024 at 9:37=E2=80=AFAM Joel Fernandes wrote: > Also optionally, I wonder if calling rcu_tasks_qs() directly is better > (for documentation if anything) since the issue is Tasks RCU specific. Al= so > code comment above the rcu_softirq_qs() call about cond_resched() not tak= ing > care of Tasks RCU would be great! > Yes it's quite surprising to me that cond_resched does not help here, I will include that comment. Raising just the task RCU QS seems sufficient to the problem we encountered. But according to commit d28139c4e967 ("rcu: Apply RCU-bh QSes to RCU-sched and RCU-preempt when safe"), there might be additional threat factor in __do_softirq that also applies to threaded poll. Yan > Reviewed-by: Joel Fernandes (Google) > > thanks, > > - Joel > [1] > @@ -381,8 +553,10 @@ asmlinkage __visible void __softirq_entry __do_softi= rq(void) > pending >>=3D softirq_bit; > } > > - if (__this_cpu_read(ksoftirqd) =3D=3D current) > + if (!IS_ENABLED(CONFIG_PREEMPT_RT) && > + __this_cpu_read(ksoftirqd) =3D=3D current) > rcu_softirq_qs(); > + > local_irq_disable();