Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1498110rdh; Fri, 24 Nov 2023 14:33:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOvyBpdyKM8ovjwmJ2fri2zY47Sx349R+3fG7seHYNQP8lZ2wYW9nxyj4NuQmHslG0buok X-Received: by 2002:a17:90b:4f8e:b0:27c:f1ca:f8a6 with SMTP id qe14-20020a17090b4f8e00b0027cf1caf8a6mr5182571pjb.30.1700865213299; Fri, 24 Nov 2023 14:33:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700865213; cv=none; d=google.com; s=arc-20160816; b=QH3Q5OEnimt2dZJ9MG8uxCOJqRj6+hxu8AEcxfvYd+kvervDwH8Pobyw7UNIJGo9HU OYz6WjgaboTl5LhUuR3QXcZZsK03GgmQXaCLQcYfDSzFNeLUSzU2LZ0UayzuuYBLILr1 qq7dfYJJ35PdNN9Ej8tI37nmsiQhC5srCOmHzprEMgjE+3pA/vhkrnhsMfQMpGfxDSU5 MDMcr8CSWtoMjh4W1AGfnuJSxLgBe0ZeVzmj1WzVwofwWvVYwr+HEWh2u0SZ9m7xhFts hYaZQOqw2mBym5j7eiHt1c8QMef2PsTEWQ9HxZHiku6ocWwCk788RxjdaomFfgnSJygI eKMQ== 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=kadRONg1sMHv05REhOXqG2OstPrHhRU52xPLYfj4eAI=; b=tVPwjM6ksszVt0bm07wYksW2H96vOGYxcr0vVVgb8e4h93VKhQmI4O1Z+gDz4cgEHs lcX8xdOHTGqwEXXYgHVBzGTQmb+OQMzi2JqnrMYc3HFCwz23Hh+ARUR5cJ6CPe5+eT99 Jfnr9v37nvq74h2hz3Mzu7NQbttZI0PfmBB6NOvANk24ofq03dFbzdQ4e/WP3jGe8RNx blDz0Sp7N8nm/i1bauTUc05C8apEU9+hfFY1WgNX0vPDfPxvJpY5rXOu0mpe1SKLRKH6 C09OdH1jPjUvoxxFXRnqc5lUYJrC0vIVC1cPYKolPAKK6wlWuNGtrDSwFb1YeRfEeF1d ztQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rHOgFJue; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id bx14-20020a17090af48e00b002534f4ce2b6si4697695pjb.125.2023.11.24.14.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 14:33:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rHOgFJue; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 9B2F080C710A; Fri, 24 Nov 2023 14:33:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231512AbjKXWct (ORCPT + 99 others); Fri, 24 Nov 2023 17:32:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231532AbjKXWco (ORCPT ); Fri, 24 Nov 2023 17:32:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC7B610E2 for ; Fri, 24 Nov 2023 14:32:49 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 287BFC433C8; Fri, 24 Nov 2023 22:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700865169; bh=sUhE/qFaIDHh5RCqYIo7aaxz5Ifr+Yh3RMfcwpeT7hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rHOgFJueqacJh3oSGholAxY008YeuYv2dLD8Hx1i+J42ckaCsPEue+U26TfZlARwm JZW9by+SVFIhonSoEAeY96DUR5A6LRpOk6l+X5lW7jWz8WuKOZORla5W+Tk1XuALgj MYwIK3qgK9tew6YwvquWXqWd54fnBITkSQXVnS19hVQgzWyRlYjXhPvU4Rg1N4BvgV AjpcEKOFBoBsU0hsUGCECscZ6jxHwYsEELkWxGucl5t5JB8X3Y+QjKZW/MajGaie0o MfNTU2ss+3GBqu3nevft7gW6YovD70zEZAYatkvvZs8AwuxvfnjJpAPewKS2KYK1MV H6HsE5Vo/TsRA== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , "Rafael J . Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Peter Zijlstra , Marcelo Tosatti Subject: [PATCH 3/7] cpuidle: Remove unnecessary current_clr_polling_and_test() from haltpoll Date: Fri, 24 Nov 2023 23:32:22 +0100 Message-ID: <20231124223226.24249-4-frederic@kernel.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231124223226.24249-1-frederic@kernel.org> References: <20231124223226.24249-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 24 Nov 2023 14:33:29 -0800 (PST) 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 Acked-by: Rafael J. Wysocki Signed-off-by: Frederic Weisbecker --- 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; } -- 2.42.1