Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp150123lqg; Fri, 1 Mar 2024 00:32:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUlC2HFUv1joap4Sp5BJO1ClhlGL6r8Z8A55KsAUGJIFPeWcBebEa+FTHUmqlJ1A8YsbampXC2N8mwwNc84YLEp0HJZIYBA31js31MzqA== X-Google-Smtp-Source: AGHT+IEFF7//u1Zx0lFTi/TstXHXPik1srfN6oT+lNCkP5oNpFYaqKTDwipELTHmeDkRY7O2NalX X-Received: by 2002:a05:6a00:2305:b0:6e5:b5be:6d5 with SMTP id h5-20020a056a00230500b006e5b5be06d5mr1266466pfh.30.1709281927511; Fri, 01 Mar 2024 00:32:07 -0800 (PST) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ka10-20020a056a00938a00b006e5076ae4fesi3207554pfb.369.2024.03.01.00.32.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 00:32:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20230601 header.b=rGXprctB; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-88083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=REJECT sp=REJECT dis=REJECT) header.from=google.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4D76F281420 for ; Fri, 1 Mar 2024 08:31:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE9346A003; Fri, 1 Mar 2024 08:30:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="rGXprctB" Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 6F2D569D0E for ; Fri, 1 Mar 2024 08:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709281847; cv=none; b=kWrflwR5pd5vJaR6nCA6jlWfc4x7vRsSMoi6XddjFgWQSuZAD1VhMS5MeMcUqxYaW1mzi3MQ7bgP18jwRQ/hXRQE4BHy+EI5G4hMiuIRhD45Z/1wviZ9RxUvu1nOdhQmq5weQN7mhKBChOJeKmBn5TMLbwEqjn+m7pKC6DFjTC0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709281847; c=relaxed/simple; bh=kmXMD5wxosP4C0HytvGYV8f6rRp1M0hxu3/wjfE2CJ8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LQf3E7iEZu0UmnCqBAAwBAffHF6WHxBvRARPP5UUwfMVmaKA3lwi/uzSV5pTujjYsA0QRUU5rEasSSL2I7XRf3NE+Ltn0KPA6SPzVKtiMxq8X2xzpXEf4ICrFY7Y8LbgkSytIInWg1mClfUC5Zr+qdV81r9052fv3MvB0MZjYgQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=rGXprctB; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5654ef0c61fso8663a12.0 for ; Fri, 01 Mar 2024 00:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709281843; x=1709886643; 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=kmXMD5wxosP4C0HytvGYV8f6rRp1M0hxu3/wjfE2CJ8=; b=rGXprctBDcRXELGRZjuJjUglDPm4/EGZQqkhXTQ/CVqpVjQ1vO9ClIB8VJjDsvvzP1 tHuX1uKzcss99uesUQNo9NHEU9IyAb9Shd9sh/E2QYacSWlO6ZzpeUxa4+7s2f3lkUv6 uQr7OSexv1DfIFUVmSmu95u9vPNExqqW55M57ibHkpn1sLBhaT62BIm+Rrm3mM9IVCwh bKpWGSSKogKIJo+g+yM20PUXg8Qmx0NQvWzXdFNTQUdvETtkym/AJrv12ylTlsF2IinR S5kIL44DHvqujGfOKlT0HHV7EH7j3nYIASHUxNMZ2a6DIV/G6WJarQI/8oo18olAoMni MALA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709281843; x=1709886643; 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=kmXMD5wxosP4C0HytvGYV8f6rRp1M0hxu3/wjfE2CJ8=; b=U/o8txAINQhLvNf6X8xdBgwjCjGoP3/CaMTNw49u0DrrloOEu/UquppP0jLiNqD3sR 12teBOkyIgE8rDp9EECkZFyagmeiEXScOTpJSMHhM+S27KKKFDbTjgxbeSz08zfhu2Hn r0G/ypffjWHkXsXmFmIsecMl6AuN0vWKeWykbs0PZPMMXfdhuhSFgpzhcisffBpgomls pb3uNGnLvkz0FE1m/64N2P8A6XWRhve/7zOZpXCX/Y8+Zrd7xzdv6k0UrMZ6vwzS2ul3 d/42MjuQVXPbt4ji+4K+zu7COPXaSmlVpAodSv/vl0Ugq9u3Rao7ARnZ1WuQe0IQnWUS JNHg== X-Forwarded-Encrypted: i=1; AJvYcCVi9mU1pZRSezmVFo/cfC8Ra+hpDfieSOoaYGpxUPt+amd8wEBuaJzKFxeWeiFitc44cptaYn5AmRDLRsaQj2yyC41i+i3wBmModoJL X-Gm-Message-State: AOJu0YxqRvWPJnqZDf3WBklaLLmeqYRBPzCW4O1rWGZMc8RwXEQiqEhV NprPsetX/KblG4s0pCdQ7zDaKS+SYTwbnEqxC9dQ2S22lrVeoSft87Yoml2zqfqAUAB/YKwTJCo VsISgUZxICGgtD4Rs/+gYTHPNDggCHaJon1KN X-Received: by 2002:a05:6402:b10:b0:565:ad42:b97d with SMTP id bm16-20020a0564020b1000b00565ad42b97dmr90989edb.0.1709281843426; Fri, 01 Mar 2024 00:30:43 -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: Eric Dumazet Date: Fri, 1 Mar 2024 09:30:32 +0100 Message-ID: Subject: Re: [PATCH v2] net: raise RCU qs after each threaded NAPI poll To: Yan Zhai 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 On Fri, Mar 1, 2024 at 4:50=E2=80=AFAM Yan Zhai wrote: > > On Thu, Feb 29, 2024 at 9:47=E2=80=AFPM Yan Zhai wro= te: > > > > We noticed task RCUs being blocked when threaded NAPIs are very busy at > > workloads: detaching any BPF tracing programs, i.e. removing a ftrace > > trampoline, will simply block for very long in rcu_tasks_wait_gp. This > > ranges from hundreds of seconds to even an hour, severely harming any .. > > > > Fixes: 29863d41bb6e ("net: implement threaded-able napi poll loop suppo= rt") > > Suggested-by: Paul E. McKenney > > Reviewed-by: Joel Fernandes (Google) > > Signed-off-by: Yan Zhai > > --- > > v1->v2: moved rcu_softirq_qs out from bh critical section, and only > > raise it after a second of repolling. Added some brief perf test result= . > > > Link to v1: https://lore.kernel.org/netdev/Zd4DXTyCf17lcTfq@debian.debian= /T/#u > And I apparently forgot to rename the subject since it's not raising > after every poll (let me know if it is prefered to send a V3 to fix > it) > I could not see the reason for 1sec (HZ) delays. Would calling rcu_softirq_qs() every ~10ms instead be a serious issue ? 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. Thanks.