Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp131262rbe; Wed, 28 Feb 2024 14:49:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUlIGCH97fgiugLZ42MGmUyGKfNRLaDMFDC1F/Am2lawZnzcqcGRhgL/F0zUIgoYZ7NqIgQdV6mbOVHMj0f+tSKn1N/mmI0b4x4Iwbb+w== X-Google-Smtp-Source: AGHT+IGG+llFxikpJXz1Jk5c/91U+T/p0fG/4kHRunlU4GAwOBnrXxQ+eQj9vkv4oywjnb4edgPe X-Received: by 2002:a17:907:1deb:b0:a44:3dd:1a70 with SMTP id og43-20020a1709071deb00b00a4403dd1a70mr88206ejc.11.1709160552815; Wed, 28 Feb 2024 14:49:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709160552; cv=pass; d=google.com; s=arc-20160816; b=lcG8iFeBhvLetPxdyyjb1uoV14GQNJcfk4gmsOX+7aq0h50NYwELh6CB6ZAQhvkgVu H575HhMB57ebysxTpbW2CXF8ZzGx86CoBSi4ahan6BFqqWIsKakSP5XCa5pXlCg3xYet hOIALmY2oC0MUtNgSuwVoBT1rEHloizlUH+8seQAAwda3J4HCrQZdi4O/xhVO2DQlIYX LuANyH1M0bGQjKL/Su/gzQjMmDLrglBZXRkux4sU34kKoCOY3JcXvC7tJulCTutuoZuG wHwFjmO5VPvLM+oq/x8xGiYZO3529aOGwC4zr49szDSWM2DAW9GlGt8oFMK7DIhWLB6f DpEg== 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=H/le6i8BwVt+VGq3pUSqTQqqbO9l7kbzBUEhYF9A/E8=; fh=J/GKPxbRrGo4US2z4uFhd5E9evzGoDpxidWwVWHrVrE=; b=NFn6iQh7xkZYSfjzBMk9UOz2RJ/p6NjvI2FlIDFfwqWYLY9ViWkws5hHTqIo05A0G0 2vOZ223GFOMAO4bv7qIaq2ujt+bnHmfkIDRR6Op6QUkPZl1ko/0PA7tznm05CBzUq5/B 6wE8m5hbpgoDfpQq0Qo2yYnB99Fdr2h7fWOfuMJC+E7+0VYcaRzt6dbUwIDTchmgCkDa flFTlPrU7NuNTaD2nyaZW3sYiZq5fTqslkZy7PU29D4tNImmZYhurqDX2aNzT6jPm1XI EJx6JjMGUr5/GPlZsj2IlmiEtQpmAR0z6c6+DfpwENwpaKlRyvJ0riysLGclHfrz2qnP UE4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eYRSKsXT; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-85800-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 gt20-20020a1709072d9400b00a42ea68c1d5si2225256ejc.637.2024.02.28.14.49.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 14:49:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85800-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=@gmail.com header.s=20230601 header.b=eYRSKsXT; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-85800-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 88ADB1F21A2E for ; Wed, 28 Feb 2024 22:49:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43D7F7290C; Wed, 28 Feb 2024 22:49:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eYRSKsXT" Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 D7B8E1361CD; Wed, 28 Feb 2024 22:48:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709160539; cv=none; b=qRGMS1bdaBbZH1oqma/acDgbJbhTxCo65y+Po0qrYnLZKd2Ayd3mwFdXyNCAQpNtyd5m4zJf02QJWKEQjgrorYOs6EMdPrXiEjsGKHkECNgZlGJ2MtJKl5XOvWlqMg8noUqQc3O47nnZMhWIaoRWR1dW8ZUtBp/UBvC0iUDi+Xw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709160539; c=relaxed/simple; bh=aEkhJ7ls8uFYlDlRc+iLJ5Ocz8xUoDm7sxScH2TbCDY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=kDGx7UdO7fviYAPkF49NnNBoMFPvANew7imv3QxtWDcRmzqZGGBSNgsl/9KRPtrEe5gkuRgRRjJqDGvBGVZfrg1GD/dbxtV5D4nkvKz+/Ucw4XdvKSU5KbF+d5ZX5/yE5BfdnJ9ny6xOVPD8aQvbpRqdbuiDyBxcl88seehK+NI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eYRSKsXT; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-33dc3fe739aso849342f8f.0; Wed, 28 Feb 2024 14:48:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709160536; x=1709765336; 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=H/le6i8BwVt+VGq3pUSqTQqqbO9l7kbzBUEhYF9A/E8=; b=eYRSKsXT+J48Whv/wGJUN1ZFp5DakHSKKohmX4Wk85dfYrKWIhD4A8de95z95z2VAH GDadP53NaFExQZVZSOImq0bSVjZ1iKDosCHKnQeM0qLEwp0F0kG321r6xrMr37yqfv8w mGRO29wfQ85CJuBiuOLSV8KqTKmE/nBG7xcooVyB3t0jSa0xz+i5FzMj+TRWJSZV0p1F 1JziCgCIsgK5q/YWbs3yYugGU7drL9B6S9DBicMDX6w0PB1jQuSfAvqoKTwy6SzOlKMB CRRjYVD+8eMGwqSevsj/r1kLtNNSJRbPiiBzigEIYIfW+aK83b73JMescb4D1PqpD2P/ avZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709160536; x=1709765336; 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=H/le6i8BwVt+VGq3pUSqTQqqbO9l7kbzBUEhYF9A/E8=; b=BUB0Y4nQAwTQWG3p9ySI3VhYUajpMj79SqYa7ps5q1dMjF207Yv9vnco/ZcS+UQf7w ZyUp3vzw++2hrExaBpqb0Vk4RVMrr2i+BmXu5p9KwSANBdQWPA12D3NrWT1t6Ls6nIKh o2DTvA5JPdxzJdaI0k5Mnn6pJ6lCxau+GSEdgkBYe8PXSn71VnkVy/Wkz1eK6CA12XBk xw/O0KFYDq6VXIFPcy+/ff47fjRwJyjO+1ZhONSBqaoJMiMm7glsIoWJFmV9JC4bVr7J GZ/H41kHl9woRzaAh0PzaP0aacoETUCPMA4JWVXio7Menai6YFBh+LUe82xe3+lFv4KD d8Vg== X-Forwarded-Encrypted: i=1; AJvYcCXjs+pMWOOuFgWkqoIPGhVI+A7ec1Y/ynWnc3w90znc5QXGo0etm5a+hQtGO/i+PZ2FCoqrlGawbXX/BUQIQqm8b/cwr52wn+l5fJ/Bhcft/AsH8vqjNAGVwfDEcbyNX7la6J3d6E3Ho92bfNhfLiwHJ6xFHRNHgB+tcq3+1oDGPEhCx/lryY62s0lEk1Z8 X-Gm-Message-State: AOJu0YwO8GlPun29b/TuX19YI7cq0PTsGAwGOlcoag1WKpOymWwZNrrY TtlOdjWf1WYDGt5MaFjU2KKtx1NsyO5H9rNVUflP8l7mtkDcxfFMIxhlicwbgRvz6YeHV+3DOmU f9xSf/BLEznMoYB7IVdrzlCnJA8c= X-Received: by 2002:adf:ce0b:0:b0:33d:545b:a33e with SMTP id p11-20020adfce0b000000b0033d545ba33emr83390wrn.13.1709160535981; Wed, 28 Feb 2024 14:48:55 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <02913b40-7b74-48b3-b15d-53133afd3ba6@paulmck-laptop> <3D27EFEF-0452-4555-8277-9159486B41BF@joelfernandes.org> <20240228173307.529d11ee@gandalf.local.home> In-Reply-To: <20240228173307.529d11ee@gandalf.local.home> From: Alexei Starovoitov Date: Wed, 28 Feb 2024 14:48:44 -0800 Message-ID: Subject: Re: [PATCH] net: raise RCU qs after each threaded NAPI poll To: Steven Rostedt Cc: "Paul E. McKenney" , Joel Fernandes , Yan Zhai , Eric Dumazet , Network Development , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Jiri Pirko , Simon Horman , Daniel Borkmann , Lorenzo Bianconi , Coco Li , Wei Wang , Alexander Duyck , Hannes Frederic Sowa , LKML , rcu@vger.kernel.org, bpf , kernel-team , Mark Rutland Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 28, 2024 at 2:31=E2=80=AFPM Steven Rostedt wrote: > > On Wed, 28 Feb 2024 14:19:11 -0800 > "Paul E. McKenney" wrote: > > > > > > > > > Well, to your initial point, cond_resched() does eventually invoke > > > > preempt_schedule_common(), so you are quite correct that as far as > > > > Tasks RCU is concerned, cond_resched() is not a quiescent state. > > > > > > Thanks for confirming. :-) > > > > However, given that the current Tasks RCU use cases wait for trampoline= s > > to be evacuated, Tasks RCU could make the choice that cond_resched() > > be a quiescent state, for example, by adjusting rcu_all_qs() and > > .rcu_urgent_qs accordingly. > > > > But this seems less pressing given the chance that cond_resched() might > > go away in favor of lazy preemption. > > Although cond_resched() is technically a "preemption point" and not truly= a > voluntary schedule, I would be happy to state that it's not allowed to be > called from trampolines, or their callbacks. Now the question is, does BP= F > programs ever call cond_resched()? I don't think they do. > > [ Added Alexei ] I'm a bit lost in this thread :) Just answering the above question. bpf progs never call cond_resched() directly. But there are sleepable (aka faultable) bpf progs that can call some helper or kfunc that may call cond_resched() in some path. sleepable bpf progs are protected by rcu_tasks_trace. That's a very different one vs rcu_tasks.