Message ID | 20240528005648.182376-3-yury.norov@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 12F1CC25B74 for <linux-mm@archiver.kernel.org>; Tue, 28 May 2024 00:56:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E5706B0083; Mon, 27 May 2024 20:56:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 76CCB6B0088; Mon, 27 May 2024 20:56:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 634886B0089; Mon, 27 May 2024 20:56:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 46D6F6B0083 for <linux-mm@kvack.org>; Mon, 27 May 2024 20:56:56 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E00C3121689 for <linux-mm@kvack.org>; Tue, 28 May 2024 00:56:55 +0000 (UTC) X-FDA: 82165989990.18.50271BF Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) by imf02.hostedemail.com (Postfix) with ESMTP id 1F51080005 for <linux-mm@kvack.org>; Tue, 28 May 2024 00:56:53 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=XXt8hFfO; spf=pass (imf02.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.128.171 as permitted sender) smtp.mailfrom=yury.norov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716857814; a=rsa-sha256; cv=none; b=lw32j09x5g+mBCSx+j1SaQ4iXOE76kJClp6/YgxutTLTiJi7KI4uoV+9GDvJLKfkL8C9B5 s1LJp6ljIBnARzhJD4g1pD4cvaTRU18JjqIu3qmr+lg+AUrBfBGR1if+mIMmlffZVH2uh9 mXcav0RhqmfUoc+PoPBHEB7EdD8hlHc= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=XXt8hFfO; spf=pass (imf02.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.128.171 as permitted sender) smtp.mailfrom=yury.norov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716857814; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2i8ZBq63RXzGfHsgGbqgssORCMraFAb6HrAbhKbhoNE=; b=Rp5RcLC292OEpaBZ0I4DeIchkhTYtk5spdUTZzMEIfhC3+D9y/Rl+gj1frK9EQg8NDik+V F1wsgsCIYkSd7ZlPdg47FAT0gqQkzh29cndOgQSs43veV0bjNgmDGEIFMsqlX5tMwniveC JEFlUrmLKirAVT/+qNN7FA72NQEwXZk= Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-627f3265898so2748227b3.3 for <linux-mm@kvack.org>; Mon, 27 May 2024 17:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716857813; x=1717462613; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2i8ZBq63RXzGfHsgGbqgssORCMraFAb6HrAbhKbhoNE=; b=XXt8hFfOSJIhWvO2Jq7tj9EUJKxDIWT+BFEf7I6YWBSGV+0VWHthIg3FwqDXwH21rG b3y6rjUR2yNnTKOiEz0ZYRmUGqNwP/FM4lgHegGcC8SqPEwzecyFybEdFm+3USXJ3gTB M/gnxcrckBv5puBHtVkR+xz7uUVyJtqlM2KeyodhXLB1E3WnXjCm7+Ftuu9By69j6QhE S8+lMiH2PW5XvllZgLie2uwlIAT8hYxd+dqV2BejpccN3S42foEvtqaGZSHmenDyuWwy gbL4RrGL7G/eqYUernXg8GSOLou+3/IGQjnledARptvU1ic4kPSozbAKh3Fh2693+RQM ocDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716857813; x=1717462613; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2i8ZBq63RXzGfHsgGbqgssORCMraFAb6HrAbhKbhoNE=; b=errSGVW3REZzX06zto2WrpDeZJn6x0ETWZG0FgDT7aoNKNbZgddn8ihX8Xh+rfu7bb g6qwACGw1LKLzuYBKr8krpTgHGnkCzF4OO0ty6Z628ck56u3BKn5I/2MzEfF7FX0027o PrOi9xu65omLneaGDvB6m96H3NRRkLQbN6zhqTZB9bUfrRPF9aVgq/y1ht1gMS/osaNc inOkUHb1i67Zy4h5FDBTJNPxyIcMU1Bx3JPZVfsOoToWr5pZgeBQjjrHfuzSqhPvF1s8 zm3yf3r9UJ1c3ptx+IqkJDdSPCVi3Qrn4j2P2vFM2a8jkqYQlY1Ms0uFIXHvyPvzZz37 907g== X-Forwarded-Encrypted: i=1; AJvYcCU2e+53Dk1xcKwNx4+NnquzVfbUBzLmcUtO1DFksWO0CXwNP+h5aIPXNNM96RHygvx0dGEOFc+ejrp2Npu+D1SMDO0= X-Gm-Message-State: AOJu0YxUPP3/rZ/yxgHwd++k1lSvjzX79HI3Ig2anPubfCzmnotMtbLp zisQblhZ+2Dej1yQgYKiCZT6irR9KgPKJzlu5iitt16W4OEtTtQW X-Google-Smtp-Source: AGHT+IGanwN5puLfVgJdTwaNaX0ZijOyB3yt9T1U0vsxt/p9RAMkPTjCsnwW8VBWu9iPsjNHvtaDqQ== X-Received: by 2002:a0d:d954:0:b0:61a:999f:e499 with SMTP id 00721157ae682-62a08da8ef8mr105496297b3.22.1716857813196; Mon, 27 May 2024 17:56:53 -0700 (PDT) Received: from localhost ([2601:344:8301:57f0:35f3:16c3:302:8fdb]) by smtp.gmail.com with ESMTPSA id 00721157ae682-62a0a5345b1sm18328627b3.120.2024.05.27.17.56.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 17:56:52 -0700 (PDT) From: Yury Norov <yury.norov@gmail.com> To: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, rcu@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Yury Norov <yury.norov@gmail.com>, "Paul E. McKenney" <paulmck@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Amit Daniel Kachhap <amit.kachhap@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, Anna-Maria Behnsen <anna-maria@linutronix.de>, Christoph Lameter <cl@linux.com>, Daniel Lezcano <daniel.lezcano@linaro.org>, Dennis Zhou <dennis@kernel.org>, Frederic Weisbecker <frederic@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>, Juri Lelli <juri.lelli@redhat.com>, Kees Cook <keescook@chromium.org>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Peter Zijlstra <peterz@infradead.org>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, Tejun Heo <tj@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Ulf Hansson <ulf.hansson@linaro.org>, Vincent Guittot <vincent.guittot@linaro.org>, Viresh Kumar <viresh.kumar@linaro.org>, Zefan Li <lizefan.x@bytedance.com> Subject: [PATCH 2/6] sched: avoid using ilog2() in sched.h Date: Mon, 27 May 2024 17:56:44 -0700 Message-Id: <20240528005648.182376-3-yury.norov@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240528005648.182376-1-yury.norov@gmail.com> References: <20240528005648.182376-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 1F51080005 X-Stat-Signature: g9xh8cw63cje9ejcdfi1hybuncxisc3b X-HE-Tag: 1716857813-930217 X-HE-Meta: U2FsdGVkX1/JNILEZHMT5Dphs3d9fuB+qyuDIh3oN+iAqAbZH7ajnjsdS/enp8Vg9sNFTCromYMVGQgSi87e0F3PmkttdPukbEN3DD1OgBPzWkT9PI12lUpT79eEu1SGma/AtarBU56IdPEQaPn5zYhg/ARoXCHdRWIBWBhR0WU3Uxhm2BwXq0uFRupyiV5kzujOSLvTltRVkl8dYfYDXmhMvkl4YZIeS+6e0bwC5KXMFRPt4K5QyBoptbwJ+6kswxwOVGADRuaQU4Rg8upsmBdnzs+sG3wL9s02qPX6z0kOwVHT1yVji5t9uHkdUyI/3L7RtH+mZssW2F9XwAnJ5lSStXfElesBR4y79jGwjZzkY9v4z+v6itPPce3xlqIP6feP5xghipACB9xsnfZ2dqnWlGrwF/3jvfpgWEbPMwy1KFF1EXkxqvdq3s41Vw3RpSD9Pw/vczmsfCcHlId7cYPRB/HuU2LJUuFAXUwb9hpCiqv3oeiz9McjNEvz6ewembJExkk2JodsABKUcAk2Hkywwq1cIDTbrZt1CIZ6GfO9guUJ7NuZ53cRQTLkmaVohqltSjdBZICqEyFr5he7vPi7IaERS8FFOSuaQoITrZwGs1FTy7Cs13tD2CYuGzYHkpq4mYeSzeWIHMCV4e6ecdyjOusooQmMjPG3MxSNyaPdP91zii4Bn1xQetsij8i5tPQeS+sH+bGksy0WRxMlhg9LNYIkc033yRCP9cjMHqkvz1bDDCQjMLNgU89BtJqH9N1ZC+5fRhLsktqAffb4SedfMjK50jmQz859OWnKJXo+lFY+m7LXBkKHs3jK9+a/fgVkpN8NaKvYKgPrYazDpzdSv6PgYsVk2vozbbhDcrvcXKs5M0iWLq3Z5tGjX/NmfkMaPGKqIZdwTJH3gt5cHB2E9YTAVp8N6B+WU7Qdl6TjHSS5LFhpFp120gRi0rioztQwFkE16Ye5SBMu3Ku vX9LLfDt 1dp3ZWMtQDF9In5c215fcyrzRLrUaPgaPyfVjcc+047Svxmyy0fSn229Xi9Vcy29UG9oYS0ixXG+q+hnj+t5uE4A+LcJU5iVeVNvtbpEf7pZlxaJM99Rwrc4yi+vo1PVt+z0MKqaMvTxNk3RUOXHRo1TXXcU5hF4IZD4/3l6/xCKJQnndU+RyjJDd9bNNJ1rpSLuEVBb2pW4FOE3WvjwhndSwZePpIrnFvLtOXrkCWaTKO054R7HBualogkA08duHGcE9F3aUE9J3QOUV/KGuVuLBMhPYIjjAo0C02v3kOpGPb7ru74b7f4VwbrtnFTRdlHKF1RInm/URcnD3tzbT/Z2KHdWfrJPLjPU73uS2mupl1Dieaid2WEbimy7xgpsHvSGtIT1bSWcsO48C6vVD4HNKCgHFd7OI4YW1tRf+/+qsgzWgDEZCGZzoaImZgvuXmurihx6bDd+WzeGu67+cSvy5VtmPoV7iJufPpUorOrEyRKr2PWyjDQXwdfDZBXxFKqtSECV7LmghAxmnymseNRZt8EyLsmwsN1eg5awOdAyqVHBGpJ/OYcX43g== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Cleanup cpumask.h inclusion in core headers
|
expand
|
diff --git a/include/linux/sched.h b/include/linux/sched.h index 61591ac6eab6..98abb07de149 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1604,7 +1604,7 @@ static inline char task_index_to_char(unsigned int state) { static const char state_char[] = "RSDTtXZPI"; - BUILD_BUG_ON(1 + ilog2(TASK_REPORT_MAX) != sizeof(state_char) - 1); + BUILD_BUG_ON(TASK_REPORT_MAX * 2 != 1 << (sizeof(state_char) - 1)); return state_char[state]; }
<linux/sched.h> indirectly via cpumask.h path includes the ilog2.h header to calculate ilog2(TASK_REPORT_MAX). The following patches drops sched.h dependency on cpumask.h, and to have a successful build, the header has to be included explicitly. sched.h is a frequently included header, and it's better to keep the dependency list as small as possible. So, instead of including ilog2.h for a single BUILD_BUG_ON() check, the same check may be implemented by taking exponent of the other part of equation. Signed-off-by: Yury Norov <yury.norov@gmail.com> --- include/linux/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)