Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp370269rdb; Sat, 16 Dec 2023 11:35:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFs5wHGHbSSLWsrxKGuiE8zQ+0JOpth+ay+hSQyqoKQlgRriY6o+emwdOrO+lockZ5L4o8I X-Received: by 2002:a05:6870:1f19:b0:203:13b9:c4f0 with SMTP id pd25-20020a0568701f1900b0020313b9c4f0mr9234549oab.108.1702755315556; Sat, 16 Dec 2023 11:35:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702755315; cv=none; d=google.com; s=arc-20160816; b=JH9yIg+knpKy8P5WqCDXPJD9MmjF73n+3EydDVw5/eLsAU4eKj8sTIEFwudOmIUFg1 NBUV4FoR13yOga2T/t2CXHV84+930fo0pVO6TbPLJNAK1a9s/rSbjUK9hFoatruhOhlX iMrPsJ6guzmCwOu0D98yYZkuMsYpSdYU4etWwqZMaXOUquX1RTUWsBqS9gLpJQj9Mcr2 Um77NvLIKC0UfUp4BQXZCkUUJfNgIf4nqzKK0nIyZuDEsOi3nRqpEzQukDB3nUoQ56u+ Mfi8kjT9NgeoHaHoUIlyQR6HUx1NBXQoakutc0NnIBjFm9JHIhdFgdxcSG6C8nMf2LQF hD/w== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=JWD/QkoBWyKUQsmiucB+B4G5EtURKqxgZCbXkFtWLUQ=; fh=I4t6aVEO+UQ/LqHMpNYoOWOqRwJSYDSAwcRNJuAsHAg=; b=Ey9obAIbjzOii/SsccXSzOxPHxWC/t3Sw/IO9epnxVUXDPi04LpoAhDfymqjlQOWnZ mPa2Pc8LNEediJgDRNVvHyq5zoODoPyEkhsGFtdZuMHISUThAkyJokCdTMsViDpLb0Q7 PfY0OLbRq5n6LFHuEqHwPVHICMxR3+aqhW5lEG8PwfYyWb0becB5hOwWLEEq7F3HFYqb mcgxWIDkk2lyXYiC0BGbiy83xafzp4Nb9vuGlDJKfR5U6a2IfmOQsiR19cX1oj+6+bgP 8RXsWgzK23hTCDgSajoH61i1TtZEIPZAq4Aff5ttsaah94u/emYul99M38/GFQ4tldiG 7vZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iG82qlJJ; spf=pass (google.com: domain of linux-kernel+bounces-2344-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2344-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dx1-20020a05620a608100b00775907603f0si21141706qkb.470.2023.12.16.11.35.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 11:35:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2344-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=@kernel.org header.s=k20201202 header.b=iG82qlJJ; spf=pass (google.com: domain of linux-kernel+bounces-2344-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2344-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 480821C215F9 for ; Sat, 16 Dec 2023 19:35:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F7F1321B5; Sat, 16 Dec 2023 19:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iG82qlJJ" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55CDA31A8E; Sat, 16 Dec 2023 19:35:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1B57C433C8; Sat, 16 Dec 2023 19:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702755304; bh=UfbayCVz3R0ZIOss7ruExChm+cAdSZgFI69SFvbtnVE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=iG82qlJJxrxPmgOppyb2c5/aYH3AUsa/8R8WAKqPPfFJGR4m5wEX6OAQClUlDPkfB kYOv4k7VZBW3x2e6HqHkXGcLulm0wwUY45F9gO2a0EW3/qDi2GfRBmuYtPAYiEjrB/ JpkoFYLoZhnTE751txj9qH0mLuSUkA4uVTDaGHFulwj6A1xYs3wyy05knjaiFp1iDZ S4s2ZVKNILO/MmUA81jPkbmKycmdQ6d94VZ2g5vDg881EoLVp5zI/+eV7o2UMamOy4 cWDi4K6XT3VZJNW/O93wxwnRShIekbIuuO44WVIk3uOtyvsS7QXS+1hJiCEK9//vit coQIP8AOoLrRw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 588AECE0965; Sat, 16 Dec 2023 11:35:04 -0800 (PST) Date: Sat, 16 Dec 2023 11:35:04 -0800 From: "Paul E. McKenney" To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, tglx@linutronix.de, x86@kernel.org, tj@kernel.org, peterz@infradead.org, mathieu.desnoyers@efficios.com, keescook@chromium.org, dave.hansen@linux.intel.com, mingo@redhat.com, will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, brauner@kernel.org Subject: Re: [PATCH 50/50] Kill sched.h dependency on rcupdate.h Message-ID: Reply-To: paulmck@kernel.org References: <20231216024834.3510073-1-kent.overstreet@linux.dev> <20231216033552.3553579-1-kent.overstreet@linux.dev> <20231216033552.3553579-7-kent.overstreet@linux.dev> 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: <20231216033552.3553579-7-kent.overstreet@linux.dev> On Fri, Dec 15, 2023 at 10:35:51PM -0500, Kent Overstreet wrote: > by moving cond_resched_rcu() to rcupdate.h, we can kill another big > sched.h dependency. > > Signed-off-by: Kent Overstreet Could you please instead move the cond_resched_rcu() function to include/linux/rcupdate_wait.h? This would avoid breaking Ingo's separation that makes it possible to include rcupdate.h without also pulling in sched.h. Thanx, Paul > --- > include/linux/rcupdate.h | 11 +++++++++++ > include/linux/sched.h | 13 +++---------- > 2 files changed, 14 insertions(+), 10 deletions(-) > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > index f7206b2623c9..8ebfa57e0164 100644 > --- a/include/linux/rcupdate.h > +++ b/include/linux/rcupdate.h > @@ -1058,4 +1058,15 @@ extern int rcu_normal; > > DEFINE_LOCK_GUARD_0(rcu, rcu_read_lock(), rcu_read_unlock()) > > +#if defined(CONFIG_DEBUG_ATOMIC_SLEEP) || !defined(CONFIG_PREEMPT_RCU) > +#define cond_resched_rcu() \ > +do { \ > + rcu_read_unlock(); \ > + cond_resched(); \ > + rcu_read_lock(); \ > +} while (0) > +#else > +#define cond_resched_rcu() > +#endif > + > #endif /* __LINUX_RCUPDATE_H */ > diff --git a/include/linux/sched.h b/include/linux/sched.h > index d528057c99e4..b781ac7e0a02 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -10,8 +10,11 @@ > #include > > #include > +#include > +#include > > #include > +#include > #include > #include > #include > @@ -22,7 +25,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -2058,15 +2060,6 @@ extern int __cond_resched_rwlock_write(rwlock_t *lock); > __cond_resched_rwlock_write(lock); \ > }) > > -static inline void cond_resched_rcu(void) > -{ > -#if defined(CONFIG_DEBUG_ATOMIC_SLEEP) || !defined(CONFIG_PREEMPT_RCU) > - rcu_read_unlock(); > - cond_resched(); > - rcu_read_lock(); > -#endif > -} > - > #ifdef CONFIG_PREEMPT_DYNAMIC > > extern bool preempt_model_none(void); > -- > 2.43.0 >