From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A23B1C4332F for ; Wed, 8 Nov 2023 09:03:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 38D008D00B1; Wed, 8 Nov 2023 04:03:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 33C8B8D00AD; Wed, 8 Nov 2023 04:03:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 203F18D00B1; Wed, 8 Nov 2023 04:03:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0E1678D00AD for ; Wed, 8 Nov 2023 04:03:24 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D602640B9B for ; Wed, 8 Nov 2023 09:03:23 +0000 (UTC) X-FDA: 81434198286.11.6B1300E Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id 29EC4C0017 for ; Wed, 8 Nov 2023 09:03:21 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="i/NNDAE0"; spf=none (imf22.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699434202; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ckGypnwi80MyxU18wHr89u6t2atgr47NVJClcRkTyPY=; b=rQzzGW+c9170Q0Wk1XHpefjemn7p3BlAo8a89G/NHdTv/qa9EL7Qr5NOtoIVr0lpd6b5u7 iDW3SXOx4488B0xmrtkVAKzs1fpkshbN0UU3wX68Ci2fxwIspBwaSqfUGgG4RG3TSEqnwN 2D0ES+fvmnIHFe4gdi+lzgoiPBq8uAs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699434202; a=rsa-sha256; cv=none; b=bp0xdJEvlObkjd10d0JJcsgI4Cmc6Ay4v3uouHpZy5xRRyRjq2smc6rIcgmGdwPLyokDlU QJEYnRIS2zbtXv4p6qp8wc5dz27RXx2GSCxPBSCm/bh5MEzIOcobi5im9l9/JZGT7AC6rI 97CJkEpQfgDfW7UEi+wOTdGKUcBBdCU= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="i/NNDAE0"; spf=none (imf22.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ckGypnwi80MyxU18wHr89u6t2atgr47NVJClcRkTyPY=; b=i/NNDAE0uKEPYCVQXGIrRvQwdn TuptosTcXKhEmXv3B93+BQ/GvNj8Dbbm2xdIfG1JKPRDGXl8pREUK/Dcpu67RyBMMKw0i8E5+waDL GQCVZ4YCiyH1N/JsEOnSZBaa2A0KVMdJyokcQd0QxokWUC696ru8IURSSY3bnbGxC/8GrI+ffynxc 0aVj7xlx/FWF3lXfE2BC7U/OpiBH20HnTsLnk5+RsDPUBoG/7OSZ5qShIFSqWwDZAnOsi0aVyPMdA R3lwivBupGPGrkh8o2IZtVViB3ccfjugIGQyE8bS0+ndnhA4tG7ImzfGsBRuLx+FDWCH5JOJzGgU4 IMSne5gA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1r0eSY-0005Dw-Hb; Wed, 08 Nov 2023 09:02:51 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id DC5ED30049D; Wed, 8 Nov 2023 10:02:50 +0100 (CET) Date: Wed, 8 Nov 2023 10:02:50 +0100 From: Peter Zijlstra To: Ankur Arora Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, paulmck@kernel.org, linux-mm@kvack.org, x86@kernel.org, akpm@linux-foundation.org, luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, willy@infradead.org, mgorman@suse.de, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, jgross@suse.com, andrew.cooper3@citrix.com, mingo@kernel.org, bristot@kernel.org, mathieu.desnoyers@efficios.com, geert@linux-m68k.org, glaubitz@physik.fu-berlin.de, anton.ivanov@cambridgegreys.com, mattst88@gmail.com, krypton@ulrich-teichert.org, rostedt@goodmis.org, David.Laight@aculab.com, richard@nod.at, mjguzik@gmail.com Subject: Re: [RFC PATCH 37/86] sched: make test_*_tsk_thread_flag() return bool Message-ID: <20231108090250.GH8262@noisy.programming.kicks-ass.net> References: <20231107215742.363031-1-ankur.a.arora@oracle.com> <20231107215742.363031-38-ankur.a.arora@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231107215742.363031-38-ankur.a.arora@oracle.com> X-Stat-Signature: ha8qfzj6dhoxijszurzwmu13f4uia7kz X-Rspamd-Server: rspam10 X-Rsp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8bmeohfTg47/0+TaLK1fWfG/f2qwwvFD2+a7jpA7zjM94KBwhLHuZvrq2pjiGXNjNgGKk1ssUsWm1Cv6D+aGa3E+tzstqCZnb9Vm10CQ7gHNUE3EIVDMVsBz/y13K+M4yKC+Ci3b8XX2k4KTyip/NWAwUbBC1GMiYm4GPSFoUGdBo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Nov 07, 2023 at 01:57:23PM -0800, Ankur Arora wrote: > All users of test_*_tsk_thread_flag() treat the result value > as boolean. This is also true for the underlying test_and_*_bit() > operations. > > Change the return type to bool. > > Originally-by: Thomas Gleixner > Signed-off-by: Ankur Arora You're sending 86 patches, I'm thinking you should do everything humanly possible to reduce this patch count, so perhaps keep these in a separate series. This is irrelevant to the issue at hand. So send it as a separate cleanup or whatever. > --- > include/linux/sched.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 5f0d7341cb88..12d0626601a0 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -2045,17 +2045,17 @@ static inline void update_tsk_thread_flag(struct task_struct *tsk, int flag, > update_ti_thread_flag(task_thread_info(tsk), flag, value); > } > > -static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) > +static inline bool test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) > { > return test_and_set_ti_thread_flag(task_thread_info(tsk), flag); > } > > -static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) > +static inline bool test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) > { > return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag); > } > > -static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) > +static inline bool test_tsk_thread_flag(struct task_struct *tsk, int flag) > { > return test_ti_thread_flag(task_thread_info(tsk), flag); > } > @@ -2070,7 +2070,7 @@ static inline void clear_tsk_need_resched(struct task_struct *tsk) > clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED); > } > > -static inline int test_tsk_need_resched(struct task_struct *tsk) > +static inline bool test_tsk_need_resched(struct task_struct *tsk) > { > return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); > } > -- > 2.31.1 >