From patchwork Fri Jan 12 09:19:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 187622 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp57774dyc; Fri, 12 Jan 2024 01:29:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IE87PZWaROFZdqKWf4kwwl5OC8HCwkLgZ+cWjWozGAolWTgHar4wYhrCPDb3Tv59os6uisy X-Received: by 2002:a05:6a00:a12:b0:6db:984:8783 with SMTP id p18-20020a056a000a1200b006db09848783mr1162013pfh.6.1705051747497; Fri, 12 Jan 2024 01:29:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705051747; cv=none; d=google.com; s=arc-20160816; b=MaX9Zc44RusCfgCSYg7fDdQvg4GgpvZBojivZjqjmK4w3aGzX+N/xWilE2lJsUbkA3 eJ1OpagkVSUMY/Ortu1ZIwgtsWBLHWnSlQSvWahrkTkygUZgXeaR0bY/w8B6UQ71z5vT gwiNnYnA9Z8bY/PDp9mOe+yyI69OTPT43+nSKlwIelktJZVGRL4bs6oFolR4wZ5wj2f+ ukIMKUzsJgtz4hvD8J/8XjQFvxhzyNXxLCY93NJNwwJyDdo2aBeqzFWcGPyL+2yZSdaK OW0uAgdDZLqL/sBeVcQ5LfcVz/I16bQTtfKKMRSx7Lo2JdFz5dfYTAUNKYB2cONo042W 7j5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=Qnuyhz9Svc7T1K1ws6u/G60OC/6FOWx8NlfIWx8d+3Q=; fh=5tHs3hHbsJ5gDTLfSS9yWgRV0uvge6Ckr+rVTDgdads=; b=AWpL3oFJewlGGuKS5IhNRn/fA6NiPucueh9K2sbyDsD6a3jkUl0GewJGEkCrEYUEZC 9E0rUk04tWDL88/JKKT/JaBet+8uS0dGuNWHUthj+yxwI/ZvW5wgj7xavZYSpEHlzpNN bOtyGZwlG1+23ht80KlVRoFqCpwxO26mdiNwaQojR/p78uyI2liTaYJSt1Rz6w7xDFyc QTzxSVEdAvBI3s7pLyCpR3uRYI5RDgSH6nbUBG2/mHDMRo1gp4jCFt3HLBm9J/6BKd4g uZtlUDW0W+5ITzME40DEvPwJ29jnj+yMRtPohcrnYhaH3Ig0Zh36u/3SW+flse6TV1fK MXTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-24473-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24473-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g15-20020a63520f000000b005ceca1094c3si2823928pgb.853.2024.01.12.01.29.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 01:29:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24473-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-24473-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24473-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6E003B257F7 for ; Fri, 12 Jan 2024 09:26:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 310EF57310; Fri, 12 Jan 2024 09:25:59 +0000 (UTC) Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) (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 3A7E255C21 for ; Fri, 12 Jan 2024 09:25:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tinylab.org X-QQ-mid: bizesmtp77t1705051457thubohd7 Received: from ubuntu1.. ( [221.226.144.218]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 12 Jan 2024 17:24:15 +0800 (CST) X-QQ-SSF: 01200000000000B0B000000A0000000 X-QQ-FEAT: q+EIYT+FhZpqW/wXBmXAUKQj18ahmXHRlQvx2IfHRIE+9pSh9V6TQzaQiqNyg 5mJqhb3B1um1VSkR8rXTPxyEpKyZMpQQQXFaxaAHdjMzC44Y+pscyY0WzKsGuSJV7NtLJzv 3bXPQEAHkznwjjgvbcovaippnNUtpfup4EfdQ7hqMw6LHmpxF/RUSpaulHkgehQDtvNlhPG 0cvCAZOm9gsLE014NyxpPCq18v2xNT/ehg2rWZe3h8DQ5bvZ7yMjzG41puNVCh/objBgXtX 8SJGHEpCbb3ICDq7qr4ICh23hj3438sxErCdfN7ZxHd6vftMVxwZpoLXojYAXzIyNZlJRZP O4WywxrAalfX6D9YLiFo2uP2oIitw== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 553020647248264284 From: Song Shuai To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Song Shuai Subject: [PATCH 1/2] sched/preempt: Remove preceding unnecessary enables in __sched_dynamic_update Date: Fri, 12 Jan 2024 17:19:15 +0800 Message-Id: <20240112091916.696185-1-songshuaishuai@tinylab.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz4a-2 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787876341476754157 X-GMAIL-MSGID: 1787876341476754157 The preempt mode transitions are based on SC's static_call_update() and SK's static_key_enable/disable() APIs. Once these static calls and static keys are initialized, APIs can work well regardless of the states of them (detailly speaking, the instructions in SC's call site/trampoline or SK's jump_entry::code). There is no need to enable these points all at the beginning, updating them directly is enough. Signed-off-by: Song Shuai --- kernel/sched/core.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a708d225c28e..6931da32f6a6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8732,17 +8732,6 @@ static bool klp_override; static void __sched_dynamic_update(int mode) { - /* - * Avoid {NONE,VOLUNTARY} -> FULL transitions from ever ending up in - * the ZERO state, which is invalid. - */ - if (!klp_override) - preempt_dynamic_enable(cond_resched); - preempt_dynamic_enable(might_resched); - preempt_dynamic_enable(preempt_schedule); - preempt_dynamic_enable(preempt_schedule_notrace); - preempt_dynamic_enable(irqentry_exit_cond_resched); - switch (mode) { case preempt_dynamic_none: if (!klp_override)