Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6813034rdb; Fri, 15 Dec 2023 08:59:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhRu6nyUGWKipB9gGETXBSV7ZSPKcegIDqWjFARWhd54sTT/ZcTO1Hz1lqXFMPtL/33aY8 X-Received: by 2002:a17:903:2344:b0:1d0:76f4:e41b with SMTP id c4-20020a170903234400b001d076f4e41bmr7164711plh.45.1702659550184; Fri, 15 Dec 2023 08:59:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702659550; cv=none; d=google.com; s=arc-20160816; b=c5WHFiwtqk4jTTkvpGZjD1Pj9DOR2hvQfC/XtHjP8r9UbJ9Gfhnbe6KUjb4hDoHbWl VvRmrgE8u8FI6fqkSqeoV2c90K2jeQLbrH8CHgquPXed2ITspdmFvbha67sDzaHimUbp Dewuebw5zIq+OtJfJ/bkkplIkh7QNHpp+aVFNydJcDXne5YcKYoil8xROhtTjinsJH0Z o3OetKLbkaBqpbkF1Guprodj/XKgGqBYWRVrrIXFYKY93OBbm6eoYdfIV6PTlgVNOgoL K3WswSkeN7ZG0sEYrB8KxaDX3qun5fLZQY3aKqGfkPrKOUzsz+bdgZnlQQzvumwFuOOy xU2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:date:from:dkim-signature; bh=Ng6OxL3bfprBeqixlAY27bfZCnLXVb/25bFamyart8Q=; fh=vxRJzw0B6+0oLKvoQ3Lvff6Pjpg2kRmqN+Zuphdle9g=; b=TC/gZ8BqJDMufIktZUXqisyWILJPD4VKGBrVxtHwntdfQJ+ahboN9ktqzwduMhbP7H dWf3GaqbL8TLzqIxxtdgNKPLAiDe+JYuFZYODGbFcXegVyCy9fBxj8VKv3O+Vp3YXBWi 5idf6RnOMjWpG3MkD293wo5e1wOCwG4BS91Kw+9Qv1d1PUAb0RDvhICnxkOJaw/pWuD3 sKIbWtCi3jttmQmsz8mCq0E+VCaSgIF/EMRRHO2bdqS3O4z8qbejc226edv+zxTXa/GV +OxlUXtdvf84ShVO+hOvvxuhL+N8ZH+UxbpIxQZjzENrzjwqXTnxIM7n3Ujba/n3Dn+/ fsBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IurPGBVZ; spf=pass (google.com: domain of linux-kernel+bounces-1343-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n3-20020a170903110300b001d31c9b3bdbsi8924244plh.311.2023.12.15.08.59.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 08:59:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1343-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IurPGBVZ; spf=pass (google.com: domain of linux-kernel+bounces-1343-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1343-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CF8F9284ACC for ; Fri, 15 Dec 2023 16:59:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FD333EA81; Fri, 15 Dec 2023 16:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IurPGBVZ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 970D43EA6B; Fri, 15 Dec 2023 16:59:00 +0000 (UTC) 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-lj1-f173.google.com with SMTP id 38308e7fff4ca-2cc3facf0c0so8301801fa.0; Fri, 15 Dec 2023 08:59:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702659538; x=1703264338; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=Ng6OxL3bfprBeqixlAY27bfZCnLXVb/25bFamyart8Q=; b=IurPGBVZyPxLwUG7oD0kRT33HeAnQ4XleFTQ/Mal2YDn4A70oD2vR7EUhLgB0EhWlL /3s8zaFjjFRxc27Gq8oToxxlgg+aUng2PwSsKWzbcjXQvcff//7+2AMN3ZBbMLva9r6N WkoXfY0g2lau3J+nbNACGc0+8zwcveXOHMIV+eKYg+YvaKciHoevz+66vLY3LQ/Oo6wC v73ZeW1JQrqYhs/N4Ww9s5da7RHCf9a7NFAP5N0Bs78x+pYO5xwEVrtKdlbbwiTgNW4r qsF74/oP1Q3kubhEroU74fXwLprQlWAqUcxgWtIQcCBkvOHfRQBhU7cKmJ9IgqJcGdCh cDUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702659538; x=1703264338; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ng6OxL3bfprBeqixlAY27bfZCnLXVb/25bFamyart8Q=; b=tfyS9yAWsO6lMmhUP7QDlhuEj7Mtnx0LiYUCSr66LsIJbuzSYUgku6opZL37tjEp7N AdBDv5tPLSN2QyndyNWQDkoOiyE43ey5deb5T90zGQj9ZGq3262tBqF1Ni76U7vo3eH/ L06t/mmCdmLINEPJHF/5Lh5rVOp48csaua4lroxythd2y3e+j2IlxXY2PFb/csI+Iz11 fTASX25Hnk45qZp8i+/CeQkNlNN6uqzzUPn6LnQdde7baEV1MbVlPynkdV/Z0VlN5RHP y1+vzaXjxJhEVV/v+uyJ+rEN31xmthxw0VZmw20XS6DqXGNKyGJwmmiL+Ie4zY4iiyYP XsgA== X-Gm-Message-State: AOJu0YxETCJ4pRLOeDQjwGSMxzsfhX/j/Ktll2gOzLPJxgUEIHp9tzvC Y9K0mXjCqmrN6wKJdC1KrPQ= X-Received: by 2002:a2e:a367:0:b0:2ca:27a:1829 with SMTP id i7-20020a2ea367000000b002ca027a1829mr6530295ljn.2.1702659538200; Fri, 15 Dec 2023 08:58:58 -0800 (PST) Received: from pc636 (host-90-235-2-229.mobileonline.telia.com. [90.235.2.229]) by smtp.gmail.com with ESMTPSA id z13-20020a05651c11cd00b002c9f8626256sm2530609ljo.53.2023.12.15.08.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 08:58:57 -0800 (PST) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Fri, 15 Dec 2023 17:58:55 +0100 To: Joel Fernandes Cc: Uladzislau Rezki , Qais Yousef , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Andrea Righi , John Stultz , linux-kernel@vger.kernel.org, rcu@vger.kernel.org Subject: Re: [PATCH v2] rcu: Provide a boot time parameter to control lazy RCU Message-ID: References: <20231203011252.233748-1-qyousef@layalina.io> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hello, Joel! > [....] > > > > > + Use rcutree.enable_rcu_lazy=0 to turn it off at boot time. > > > > > + > > > > > +config RCU_LAZY_DEFAULT_OFF > > > > > + bool "Turn RCU lazy invocation off by default" > > > > > + depends on RCU_LAZY > > > > > + default n > > > > > + help > > > > > + Allows building the kernel with CONFIG_RCU_LAZY=y yet keep it default > > > > > + off. Boot time param rcutree.enable_rcu_lazy=1 can be used to switch > > > > > + it back on. > > > > > + > > > > > config RCU_DOUBLE_CHECK_CB_TIME > > > > > bool "RCU callback-batch backup time check" > > > > > depends on RCU_EXPERT > > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > > > > index 3ac3c846105f..8b7675624815 100644 > > > > > --- a/kernel/rcu/tree.c > > > > > +++ b/kernel/rcu/tree.c > > > > > @@ -2719,6 +2719,9 @@ __call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy_in) > > > > > } > > > > > > > > > > #ifdef CONFIG_RCU_LAZY > > > > > +static bool enable_rcu_lazy __read_mostly = !IS_ENABLED(CONFIG_RCU_LAZY_DEFAULT_OFF); > > > > > +module_param(enable_rcu_lazy, bool, 0444); > > > > > + > > > > > /** > > > > > * call_rcu_hurry() - Queue RCU callback for invocation after grace period, and > > > > > * flush all lazy callbacks (including the new one) to the main ->cblist while > > > > > @@ -2744,6 +2747,8 @@ void call_rcu_hurry(struct rcu_head *head, rcu_callback_t func) > > > > > __call_rcu_common(head, func, false); > > > > > } > > > > > EXPORT_SYMBOL_GPL(call_rcu_hurry); > > > > > +#else > > > > > +#define enable_rcu_lazy false > > > > > #endif > > > > > > > > > > /** > > > > > @@ -2792,7 +2797,7 @@ EXPORT_SYMBOL_GPL(call_rcu_hurry); > > > > > */ > > > > > void call_rcu(struct rcu_head *head, rcu_callback_t func) > > > > > { > > > > > - __call_rcu_common(head, func, IS_ENABLED(CONFIG_RCU_LAZY)); > > > > > + __call_rcu_common(head, func, enable_rcu_lazy); > > > > > } > > > > > EXPORT_SYMBOL_GPL(call_rcu); > > > > > > > > > I think, it makes sense. Especially for devices/systems where it is hard > > > > to recompile the kernel and deploy it. For example, Google and GKI approach. > > > > > > My concerns had nothing to do with recompiling the kernel. Passing a > > > boot parameter (without a kernel compile) can just as well > > > default-disable the feature. > > > > > > I think what Qais is saying is that passing a boot parameter is itself > > > a hassle in Android (something I did not know about) because of GKI > > > etc. > > > > > That is true. Doing: > > > > echo 1 > /sys/.../enable_lazy > > > > is a way how to make it easy and flexible. > > Hey Vlad, are you suggesting that the boot parameter be made to > support runtime? We can keep that for later as it may get complicated. > Qais's boot parameter is designed only for boot time. > No problem. Yes, i meant a runtime one. But as you stated there might be hidden issues witch we are not aware of yet. Thanks! -- Uladzislau Rezki