Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2538179rdb; Wed, 21 Feb 2024 10:36:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWQAHtT99auHKhdWYPm4vJdBkk5Ei0WU2lZh/68d42R7Hh5P0knfJ2zepDcQkpGqxvH0qahBmxLXhZoQURKcCKMkLFUqvtSHKXPodBAhw== X-Google-Smtp-Source: AGHT+IHvYqo/Pdm8BeGrZqwG+jEDXz+Q2qCuVCequjrePn2xiHvygy1v0nut6NF3PK653IKSz6gj X-Received: by 2002:aa7:d318:0:b0:564:5764:a5d8 with SMTP id p24-20020aa7d318000000b005645764a5d8mr6964111edq.25.1708540601886; Wed, 21 Feb 2024 10:36:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708540601; cv=pass; d=google.com; s=arc-20160816; b=szDkzw3ISYBYlekBO11L6FgqEIa6xaLUkqK6JkhAHTZMFxX14hboOVsTfbX0qP5/SE KU0mEbd5ORY/PFfL6yAVJmfPEp6MPNJ4WUbCaN5ps4nl9gbsqSqtZpE3ZV4C54NETc4C xXtrL5NALLhXgnnCcqen/Go0s/RVSvyRI1BwrB6kz9k2ckhpoOh7B4vN9RWckoFrR9N5 t9UHfaLpnkyIVfO8Gb2O5PbYLUUMAydwaQJV8HuvNV4zAdPTe4xF+1e6bbJq64j/WMFI DgJkWM295RFgj6G42HwVG9bluccTKzbtdLH2UPAwApFFz9+7wdNhQQ8T5LxZ4h5niBEY c0IA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=n3NooecQWAttHogjdkmEbBpXWucp8MrOJeXzLfX6ZiY=; fh=yPcFwnKdvF9m3JzvhwHfB8dZxneLr1MYLnespHIFQAc=; b=NeRRQHxiOtFppZcXhbX22AgjJQx+03EuIpop2rG3aKrFiA6q3uZcIQ23zh1ZyWNWGM U1YK48t5isedR2LfIBp2AMVdb9uVe4aO526g0xcxYq0Y7mHQdqzFoB5/oL5rhWzsN5SP tokhGWQ/0hQNRNyDsPU0XPtQCkV6VWZXY8At+bAEiJ6R0yEF0j6kqVTHJMNKIokwr4Cj HjYuJ9lWkqxJKcLYc5xWOGrtRHtpWsN0VoQVFgEZbT+qlp9Z95rpAKZg3obBU4Q0dFKF +WlpDHG/j87BM/kev3zF6Du8JYth4HDN4El5XpmlMRDVO3xYqfRTzNCGteIO9bDSBdnA xwmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-75291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75291-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w18-20020a056402269200b00564293052b4si4382488edd.159.2024.02.21.10.36.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 10:36:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-75291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75291-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 811E21F28F2A for ; Wed, 21 Feb 2024 18:28:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5116128365; Wed, 21 Feb 2024 18:25:07 +0000 (UTC) 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 5FA4185280 for ; Wed, 21 Feb 2024 18:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708539907; cv=none; b=eSuxfIOoJ0ddz10MmBQ4vc3XQhhpKDCGF1KG2MmANVj9zRVRv/S7B9/8wpA7PJMDgNzjgyU1bziEsQkrFM/LEZqLU0tLNz9JXBV2gavCkKH0uwJWxR6IRpmWIYZeY/28x83pUQxekZfCUb0oG+U4bGk6GhxgeqQnMoic1s+aqQI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708539907; c=relaxed/simple; bh=cLn8dL69+Lvu/fIfZczLNpufcusO+7qo0OtM9ehE7Eo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uFXVEExg5hOTjOjVEBUSKhnSksQDtR7AUl41npOgZtdOS2cSfkHwj1HiCwYm15k6LJ8FL8ILzjjzQYPtjzVKAC0XAHd3RhTn4RBBreYqrPLSducupIj2jDXcf8tqapcaYwSP92iZtwjowXBCzfBkKymYs9xv5uS/YrcNOP65YLQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71AA4C433C7; Wed, 21 Feb 2024 18:25:03 +0000 (UTC) Date: Wed, 21 Feb 2024 13:26:51 -0500 From: Steven Rostedt To: Ankur Arora Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, paulmck@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, jpoimboe@kernel.org, mark.rutland@arm.com, jgross@suse.com, andrew.cooper3@citrix.com, 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, David.Laight@ACULAB.COM, richard@nod.at, mjguzik@gmail.com, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: Re: [PATCH 02/30] thread_info: selector for TIF_NEED_RESCHED[_LAZY] Message-ID: <20240221132651.5d1b0a24@gandalf.local.home> In-Reply-To: <20240213055554.1802415-3-ankur.a.arora@oracle.com> References: <20240213055554.1802415-1-ankur.a.arora@oracle.com> <20240213055554.1802415-3-ankur.a.arora@oracle.com> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Mon, 12 Feb 2024 21:55:26 -0800 Ankur Arora wrote: > +/* > + * tif_resched(r) maps to TIF_NEED_RESCHED[_LAZY] with CONFIG_PREEMPT_AUTO. > + * > + * With !CONFIG_PREEMPT_AUTO, both tif_resched(NR_now) and tif_resched(NR_lazy) > + * reduce to the same value (TIF_NEED_RESCHED) leaving any scheduling behaviour > + * unchanged. > + */ > +static inline int tif_resched(resched_t rs) > +{ > + return TIF_NEED_RESCHED + rs * TIF_NEED_RESCHED_LAZY_OFFSET; > +} > + > +static inline int _tif_resched(resched_t rs) > +{ > + return 1 << tif_resched(rs); > +} > + This may have been mentioned in another thread (don't remember) but please make the above __always_inline, as that also matches tif_need_resched() as it is today. -- Steve