Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1511864lqp; Fri, 22 Mar 2024 19:02:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWYxL4InSHNS5Fhav5ICTx0+KnIrfoP63RXIsV2G35jcXSTswaFuSSbCfexL9uEDocVPtF4B3LRFt0UdubVVhmLBgXWIJmiuFjsn+PHkQ== X-Google-Smtp-Source: AGHT+IHEEZzgLbFdfF/XtveD5aMJJ+o/q7yhBhxDrFhdbJqId9GnbyEa/bPZnxKMA2b2A4Szfu8L X-Received: by 2002:a25:3618:0:b0:dcd:6c0:da64 with SMTP id d24-20020a253618000000b00dcd06c0da64mr985572yba.58.1711159350839; Fri, 22 Mar 2024 19:02:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711159350; cv=pass; d=google.com; s=arc-20160816; b=i/sogQjfArQwGzND4OAWtvpRGj8d+xEZT6eW3h13bBT9zeSGihIQWIPiNiYLWBcxEy 2zptURxM00ej9gP8un0tzsfRw5aTA/VU2xvapBejY1JXjqUQUHkN6wdZZKG2+yjnyzEz Llxrg+xOyFghAi/XcONwTOL2K58plCt8Hc+5Gw4h2BTaJK7dnw9bz8c5hsZMXsYADTMM fm6G6Imn0xk8JZ0Z965B6akKRPHxyF8gD8upkH1OPMqQd6Nab4bC5rM9CJjIRBEj9fiw dY/luw/k14JxRCc1XNPHmUUCD8Sx6hz266mjVvVDpRBtERjVDNFgiE9riIIH8zbOW4Km YiOA== 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=UDrtS3kmmAHBfczwt+9v+j8bPsXytsIEzAPUfRDLktk=; fh=BvJmv8/hVTsnPis6PEGpaEeIWEOqDlIl7Y8L1qvaUTg=; b=a68Pq1LiTPPoL1LKO2V70X35yOkJl1iFJB/JRx0ofCC/eUDN7+BHqNXMEil+acGT+X Lxaj82jhLnFugiwcotyqv53ZHoxRztfhFLJwfHNhvOhLrCJ2ZU6inKbVP1rVq+Mrjx7d SKC+XnnEPBQxESwOz5PfC0Ykxoz91TOFoNzjTvMkEFG6yQrxLKlRpfrLWO8+A5T0KTwt r74VdRlMaYWKj/GliDHxOlwh6oNHSbGNF1dujHw72tbqnn/09L9c1p+ldkI7+Y3AhT7n G0otZ8Q3bqnMUhnoKS+rQ2xSOiEtcGJCf8/r4Mpwr7qsFMllLCqVr7gmasNVAPUO3d23 0vBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b="Th2/ZZP5"; 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-112173-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112173-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jl7-20020ad45e87000000b00690cf7612besi3238422qvb.413.2024.03.22.19.02.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 19:02:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112173-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b="Th2/ZZP5"; 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-112173-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112173-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 83EAF1C22519 for ; Sat, 23 Mar 2024 02:02:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 484403FE4; Sat, 23 Mar 2024 02:02:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b="Th2/ZZP5" 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 B2AF1EC2 for ; Sat, 23 Mar 2024 02:02:15 +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=1711159337; cv=none; b=rEjLpYBYI799pHHewa6Qn//RcMm8h6vmAswouFh0t94d3Dy4eZzlVUTvIxBqQlWjbzMyGkH5fJYMTwfr6DNenShRwyJAPROuR8f6qhTC1BN2Rnp6oJ0I3VRs847QGPo7yhcjKlT4vNT1wElsvDuzwZGJ00qy5aFKs3kbg8hc5Ek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711159337; c=relaxed/simple; bh=kjQK/ZXJeuufuWKUqTmtrVb3RiT09PzKuAhVluGT+go=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=uIJDiLrLQVtIDrKN2W5DdQujjwDABYxv4RqaH3fGglE3ledR5Fg1eYWo09SYXQscQX4hR39uAoMm+b0tXAWYuPmc2QwI0FgV5HC/AWaq9SqTOc8GyzAo0PLNgevCq+KUQsQairMdG0j+0Pqk8e15Sn7Q6dvcjHNRbRnDiZ6LML8= 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=Th2/ZZP5; 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-56890b533aaso3309890a12.3 for ; Fri, 22 Mar 2024 19:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1711159334; x=1711764134; 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=UDrtS3kmmAHBfczwt+9v+j8bPsXytsIEzAPUfRDLktk=; b=Th2/ZZP5sfW7yYwdEB9kKPKe2ZEgP8l3WruK+7IkwBzFdPxlX/g+SVdYemdVtDjFyC 2zZEePDIChlyKqGtSPF3yvm3NEEPdmvB48Z/IvmClr4xwUYaV/XZpPe/h0VebglO1oJj ZycMb+zFvakcYLLGYpuKKRitAOBIUz72AqkDIow9zt1L6rkIT+VKxmo/9GaUoPB6brsR CYdcZHZV8T8v5yOPHJjeKKSYZCtx0UuMh4rC5MZUAFcAHh8JWBs1aOyNPNX6fy6xDJbS wWKBtzZVeClTa0PduraQBpY40SqZlMIPsygl48/86za6Gd7btjQC9xmtXoLv2nMivwUc U4ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711159334; x=1711764134; 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=UDrtS3kmmAHBfczwt+9v+j8bPsXytsIEzAPUfRDLktk=; b=h0qlCtAZN2qposIsdX7sA1CzONEpNkm0dy3xl4ipa/mV5DmRys4gDAB7J/Ibtcumlc H1QPO01my3vF/qUv5aSy5XEGgiVSogd8qtigovbbOxasMuZ0wp9i8hrt3uHSvF+C1nnZ /ZYsuzle+i6e3GEh/e+QfB6VCIi+0ayQPPa/YgPRPAAPJmbO+jwPVP3dSxzmBBz44sSn YgJ+MV9iSoNH7Y0F2rC6HS0yGpWR+Sg/Kt42kTnIwUwLiR1aXiv6JmTKVsfyo6ANrCA5 8Tow+j/iRF/Mks3ORJhwBJeX76XmRW5sCuJFgrp7NU29LhnmB3BmYAp2FUbm6zsjYclY aj2A== X-Forwarded-Encrypted: i=1; AJvYcCVcf3s/Lww/l7KaLj2PGt2102aWfarFLca2wlOvQyeD/oI7N3tKOLTgduG4JVLy+3E2wJboWL/Y6Q3BqaPLWz7v+hSe3zZtaHcUmKGz X-Gm-Message-State: AOJu0Yxd/3fmb2shwy8A0gYdLHnVyikZ0lHdRp8q9SRqtXMTSyvK2iqU dkTuPz+5/YqVwk5o8MaxnlkxtDTu//6hCyJ+Ko16IVRxKZYD4iie4FK2L6/IOVCVvwJa9LqzcNy qyh6ippWYv83MObnmNl7y2OqheaZGvGcqIUr03A== X-Received: by 2002:a17:906:81c8:b0:a46:a712:3972 with SMTP id e8-20020a17090681c800b00a46a7123972mr797745ejx.11.1711159334004; Fri, 22 Mar 2024 19:02:14 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <90431d46ee112d2b0af04dbfe936faaca11810a5.1710877680.git.yan@cloudflare.com> <20240322112413.1UZFdBq5@linutronix.de> <123ca494-dc8c-47cc-a6d5-3c529bc7f549@paulmck-laptop> In-Reply-To: <123ca494-dc8c-47cc-a6d5-3c529bc7f549@paulmck-laptop> From: Yan Zhai Date: Fri, 22 Mar 2024 21:02:02 -0500 Message-ID: Subject: Re: [PATCH v5 net 1/3] rcu: add a helper to report consolidated flavor QS To: paulmck@kernel.org Cc: Sebastian Andrzej Siewior , netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jiri Pirko , Simon Horman , Daniel Borkmann , Lorenzo Bianconi , Coco Li , Wei Wang , Alexander Duyck , linux-kernel@vger.kernel.org, rcu@vger.kernel.org, bpf@vger.kernel.org, kernel-team@cloudflare.com, Joel Fernandes , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Alexei Starovoitov , Steven Rostedt , mark.rutland@arm.com, Jesper Dangaard Brouer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 22, 2024 at 4:31=E2=80=AFPM Paul E. McKenney wrote: > > On Fri, Mar 22, 2024 at 12:24:13PM +0100, Sebastian Andrzej Siewior wrote= : > > On 2024-03-19 13:44:34 [-0700], Yan Zhai wrote: > > > + * The macro is not needed when CONFIG_PREEMPT_RT is defined. RT ker= nels would > > > + * have more chance to invoke schedule() calls and provide necessary= quiescent > > > + * states. As a contrast, calling cond_resched() only won't achieve = the same > > > + * effect because cond_resched() does not provide RCU-Tasks quiescen= t states. > > > + */ > > > > Paul, so CONFIG_PREEMPTION is affected but CONFIG_PREEMPT_RT is not. > > Why does RT have more scheduling points? > > In RT, isn't BH-disabled code preemptible? But yes, this would not help > RCU Tasks. > By "more chance to invoke schedule()", my thought was that cond_resched becomes no op on RT or PREEMPT kernel. So it will not call __schedule(SM_PEREEMPT), which clears the NEED_RESCHED flag. On a normal irq exit like timer, when NEED_RESCHED is on, schedule()/__schedule(0) can be called time by time then. __schedule(0) is good for RCU tasks, __schedule(SM_PREEMPT) is not. But I think this code comment does not take into account frequent preempt_schedule and irqentry_exit_cond_resched on a PREEMPT kernel. When returning to these busy kthreads, irqentry_exit_cond_resched is in fact called now, not schedule(). So likely __schedule(PREEMPT) is still called frequently, or even more frequently. So the code comment looks incorrect on the RT argument part. We probably should remove the "IS_ENABLED" condition really. Paul and Sebastian, does this sound reasonable to you? Yan