Message ID | 20231113220326.7933-2-frederic@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1501618vqg; Mon, 13 Nov 2023 14:03:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCgemAeaU0rw57XYLuabeU6a3gq6OX2FtrNrsYhrC+QwL85t+xrcJgZnFlEfZWHWdMHg1k X-Received: by 2002:a05:6830:2681:b0:6d5:11f6:eec7 with SMTP id l1-20020a056830268100b006d511f6eec7mr627917otu.28.1699913025133; Mon, 13 Nov 2023 14:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699913025; cv=none; d=google.com; s=arc-20160816; b=EKHt1YoyMFacmUYyGZRV2N7HVaKc0mv8fYJcEpNJ9NbLkGikmSR33299Wla2LY+h2R Hm2oRaZ5oMhgffWpTItyjDMTO7arnfBs02/oQGu4/vQ8UgEP9rFsp03C2H1m1zBh2dRw cMIDnuDWxNZutNa5X/sQ07XGuu9yb8aJg7TAMhOZkZfL5Q+NVeBTtMUws8KK4fAiWKf2 5AkB9z7Go61qE4IfrChhUXCN4s7Fm2mSbhm/45K6zVmemkCnt9asxm4cGMo4QF3XJbuY M6JrC1Ie2+rdY6gvfC2fGGcRPolg8USzEGZLqu1sV1qYpJyWlMhF2J76jBbb5RQ+/x7R F/Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=L9AD4npZHNE7p07jGPwHmr8Xy3EVUnv33DYi1PDLLmQ=; fh=dP/oL1/U6Q2MdNyuxZgKAuT8dY/AUX59hxAkaJPpCBs=; b=Pv1KClXhIM/CB60mX0enXe0CKuYx+qsKbw2ok5adtMjriiDAhPtrBcIBYMlT539oDV 5YSVQcM3kDOAQhDehR8cdiRsXzda0Qe058dhpVl527E7lAvQ7rj9DLepLuuYvw6AfurB SDehvoy3dTh0l1cmKNqZNKgmeHmtf+sxX0i3cOAh8s0h2BkFs8MpWgK++WuXLbIIQdXE 5aBIEeneI90LTuxftxybsU9ZGUawSlEEANrQsDA2iGFgsbD64K+kiJIF1WEnTBUUMzFR p21rVECjZamxhSX+WZB1XJMJ9VCmdi9XAv9/P8pFv3MG+5N36cUmmtm9XCPsei8iFrCw yBQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f6BJYJRy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id do15-20020a0568300e0f00b006d64d0f4005si2332448otb.42.2023.11.13.14.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 14:03:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f6BJYJRy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 926058027673; Mon, 13 Nov 2023 14:03:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231745AbjKMWDi (ORCPT <rfc822;lhua1029@gmail.com> + 30 others); Mon, 13 Nov 2023 17:03:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbjKMWDf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Nov 2023 17:03:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F22D7D50; Mon, 13 Nov 2023 14:03:32 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEA5FC433C8; Mon, 13 Nov 2023 22:03:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699913012; bh=sUhE/qFaIDHh5RCqYIo7aaxz5Ifr+Yh3RMfcwpeT7hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f6BJYJRy7C9DwtlCkUkAc2wzutdurdfjjUgqKtEfzDDhKHmQgct2AdQdDH39XP/59 RfRvln9eJ05WKfKE1axkGZgUXurqVVeWyfc7wWLQyMdFQVJL7EyWdtkQ9y3UMpehUk 84GbL37ihxEuB0jgGeLqE60Ui1uLj/qNRlrApyWl0f4nwknRDsGG66EoZGg5x+kp+O LTcpL2jUmCyJk+STYGuvHJpK2LCu8BTytk4VEtxGlFQ5wLvrJ3d7ChpJtGwq6dx8uc qOa22h9C/gpkguVsAU8VKnYwmI2Z0JDA0rlOyvzeAipjSsy9T1USfU08JYz62X20vZ i9fJT0OF7zJjw== From: Frederic Weisbecker <frederic@kernel.org> To: "Rafael J . Wysocki" <rafael@kernel.org> Cc: LKML <linux-kernel@vger.kernel.org>, Frederic Weisbecker <frederic@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, linux-pm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com> Subject: [PATCH 1/2] cpuidle: Remove unnecessary current_clr_polling_and_test() from haltpoll Date: Mon, 13 Nov 2023 17:03:25 -0500 Message-ID: <20231113220326.7933-2-frederic@kernel.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231113220326.7933-1-frederic@kernel.org> References: <20231113220326.7933-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 13 Nov 2023 14:03:41 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782488000175098798 X-GMAIL-MSGID: 1782488000175098798 |
Series |
cpuidle: Remove unnecessary TIF_NR_POLLING clear/TIF_NEED_RESCHED folding
|
|
Commit Message
Frederic Weisbecker
Nov. 13, 2023, 10:03 p.m. UTC
When cpuidle drivers ->enter() callback are called, the TIF_NR_POLLING flag is cleared already and TIF_NEED_RESCHED checked by call_cpuidle(). Therefore calling current_clr_polling_and_test() is redundant here and further setting of TIF_NEED_RESCHED will result in an IPI and thus an idle loop exit. This call can be safely removed. Cc: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Rafael J. Wysocki <rafael@kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> --- drivers/cpuidle/cpuidle-haltpoll.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c index e66df22f9695..b641bc535102 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -28,11 +28,8 @@ static enum cpuhp_state haltpoll_hp_state; static int default_enter_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { - if (current_clr_polling_and_test()) { - local_irq_enable(); - return index; - } arch_cpu_idle(); + return index; }