Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp982389rdb; Fri, 16 Feb 2024 01:21:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUr+V86FJf/CQFsKIU/3FOK5x+atjsNK7UJNjvbK6c4/H+D20/P2KWDq2IZRemriemXKcnK6TKJ6WyBtFEiKlHQ+JjKbX7RAom6l3e3ag== X-Google-Smtp-Source: AGHT+IE8LDj3Ypnsf0AqLC3t6qOBocbGiZVk2SgMsXDoxy4eqNWP85OrXmlIXNXb1ie+8PB87z6P X-Received: by 2002:a05:620a:2794:b0:787:21e4:aba2 with SMTP id g20-20020a05620a279400b0078721e4aba2mr5014346qkp.39.1708075265041; Fri, 16 Feb 2024 01:21:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708075265; cv=pass; d=google.com; s=arc-20160816; b=h8oq2AR0nP6j/7yupYx9KkMZKP3DZZ8qoCQNZQBWY6b9Ufso1zTAi+m3p7MwgceZWS sG3qT6o1jyVSAEM7suVdsjbSy8AFmHdBZHIHjoUKbuZ76ARfygIQmrndc6SUpQd+MGXb BhfM/LmFsalt/HrKIi7h4mXuOdEHTF8IohnLbmOoclaL1klDZFbjL63VldjrCiprEwBH T1x8D7ESSWfVhYriNeHTf/F0vBYuQyXOpBziEPc2RWwFfuXhpTPDtlhusdIEJYjxPx4r ycIbD4oV9JVpXcoZVK1Mbfo4JO7pONQbblJD0NePtLEezSK4Y6YeuqCSX5C8i/hVbzS2 q3jQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=i0VeBzoJh9QD78pHNrI9e6Wlof8o7nvhKh2UMUiADUg=; fh=I0pZMxrvsJVW7BahYHezmiDBWCaV5tSYcSKgtCR/Aas=; b=ExxCP7RHTrQtMw1UdOTZGKJFHd+x9VzeqssYPzDQTFKXYUm98JUHM/oymOZFxaicyR Sbj7RnzT20r25j2nopD6P5iOV4wb5rtQ5Ha8IQUCIyEY7W0t9gVIunXcdNM0dNAdNXhC 0RXXyn5/pAzAdBxCM4yVSS1DerxJ5QWhRyTIcG1mdIa2dkQLitx6rq8KoKss7VvFGahA H7y11erg3gt+AlIpp/inhxMYX19R/kYVtUm0kCbrHBPjHVzv1HEeULw3/Jz6givcEAlK fLR7syzDU8a3CYHzwhgxiEpKF8RTwRjhFwoFHbcMtyB8+PHf/LYvOYe3A3OKD5SBe+do mVDw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CsMiAhik; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-68324-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68324-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l9-20020a05620a0c0900b00787281f8a9esi3408417qki.653.2024.02.16.01.21.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 01:21:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68324-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=@linutronix.de header.s=2020 header.b=CsMiAhik; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-68324-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68324-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 C86661C214C4 for ; Fri, 16 Feb 2024 09:21:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD2961B963; Fri, 16 Feb 2024 09:20:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CsMiAhik"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="E9k5Qe05" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 41B071B81A; Fri, 16 Feb 2024 09:20:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708075258; cv=none; b=BRAEMpEuoFX1NfyFuTMFEvoVWvu7Y9gu3NkyF8kQ52xnM+w/nQ16ArENN4g2FAazTEeZBYt0ueeBXNq3O5paIf75vLlWZHXPet603yjZnxR58uFzPPbHp2OI6phIopqMG7czLZDOZkOXRmhST6uVuZE9nfy2QKohZzX1phFn3eM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708075258; c=relaxed/simple; bh=RY5XxsCnyG2c3FxZcPo9EhUyfPW5xM36aDUFL59XXeg=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=QjbDXX3dfPsQMy6xOw95hfgbIjX+skUTzyFM0jQUUTknHDmeV/8NLETKaLBVD5EzwKXF2yHZs5L09VoWuyw2QA6D0aFmAYe6DKG4B3M7mY1speZbP0Fpfg37Q7XEcg92pXLQzAszwk8zf828sqYGA203GO51QlYzD0d+xz12dtk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=CsMiAhik; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=E9k5Qe05; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Fri, 16 Feb 2024 09:20:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708075255; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i0VeBzoJh9QD78pHNrI9e6Wlof8o7nvhKh2UMUiADUg=; b=CsMiAhikZoErEjyDDXP2JDHdvvju5tXQTjffD5V1ldBR1xACJQ/GwMeL3K0ZWLDE1zQ08y N6FzT85nTfYLir4A2Le1M8Gh9FWsaFnO6FJwX7gclvpGdaXi2NrVBASQBw/2nK5Z/PCwQV FysGZnBufmjSh5UJWS2c9FheV2Lv+ydkfyh1SUoxv14vaJaS98bWVy2xZZnCr/IHakXq9q 8deccZird7YB3i0YoKbn6MxKpR8gI+mnvfNnrwNRcw4Umr0beI4YsKIpHzzCzgEez/GTTV IdWB1G1v0Yj0LSl8IfMRHIqq+ihZO9UWyXyi3OROPaS32z2Q/mFPKxJklRxxPQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708075255; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i0VeBzoJh9QD78pHNrI9e6Wlof8o7nvhKh2UMUiADUg=; b=E9k5Qe05TWd5/SV/UqerYzNl7RBxjYk/Xj9a7dl69dpvQjW2C2w06/GZ+qKts4sd07yumW V0UlWwgqCvgVvADg== From: "tip-bot2 for Shrikanth Hegde" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/core: Simplify code by removing duplicate #ifdefs Cc: Shrikanth Hegde , Ingo Molnar , Vincent Guittot , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240216061433.535522-1-sshegde@linux.ibm.com> References: <20240216061433.535522-1-sshegde@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170807525377.398.6140727129795526147.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the sched/core branch of tip: Commit-ID: 8cec3dd9e5930c82c6bd0af3fdb3a36bcd428310 Gitweb: https://git.kernel.org/tip/8cec3dd9e5930c82c6bd0af3fdb3a36bcd428310 Author: Shrikanth Hegde AuthorDate: Fri, 16 Feb 2024 11:44:33 +05:30 Committer: Ingo Molnar CommitterDate: Fri, 16 Feb 2024 09:37:15 +01:00 sched/core: Simplify code by removing duplicate #ifdefs There's a few cases of nested #ifdefs in the scheduler code that can be simplified: #ifdef DEFINE_A ...code block... #ifdef DEFINE_A <-- This is a duplicate. ...code block... #endif #else #ifndef DEFINE_A <-- This is also duplicate. ...code block... #endif #endif More details about the script and methods used to find these code patterns can be found at: https://lore.kernel.org/all/20240118080326.13137-1-sshegde@linux.ibm.com/ No change in functionality intended. [ mingo: Clarified the changelog. ] Signed-off-by: Shrikanth Hegde Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20240216061433.535522-1-sshegde@linux.ibm.com --- kernel/sched/core.c | 4 +--- kernel/sched/fair.c | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9116bcc..a76c709 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1792,7 +1792,6 @@ static void cpu_util_update_eff(struct cgroup_subsys_state *css); #endif #ifdef CONFIG_SYSCTL -#ifdef CONFIG_UCLAMP_TASK #ifdef CONFIG_UCLAMP_TASK_GROUP static void uclamp_update_root_tg(void) { @@ -1898,7 +1897,6 @@ undo: return result; } #endif -#endif static int uclamp_validate(struct task_struct *p, const struct sched_attr *attr) @@ -2065,7 +2063,7 @@ static void __init init_uclamp(void) } } -#else /* CONFIG_UCLAMP_TASK */ +#else /* !CONFIG_UCLAMP_TASK */ static inline void uclamp_rq_inc(struct rq *rq, struct task_struct *p) { } static inline void uclamp_rq_dec(struct rq *rq, struct task_struct *p) { } static inline int uclamp_validate(struct task_struct *p, diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 533547e..8e30e2b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10182,10 +10182,8 @@ static int idle_cpu_without(int cpu, struct task_struct *p) * be computed and tested before calling idle_cpu_without(). */ -#ifdef CONFIG_SMP if (rq->ttwu_pending) return 0; -#endif return 1; }