Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1497890rdh; Fri, 24 Nov 2023 14:33:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmJc1n1g5MkY8j1EUt/Mi10FMLyiWm50MChxrObjBh58HkzpCKe8Mbd8bQK1fDtK/HHuAU X-Received: by 2002:a17:90b:3b91:b0:285:a204:fc47 with SMTP id pc17-20020a17090b3b9100b00285a204fc47mr477874pjb.17.1700865182555; Fri, 24 Nov 2023 14:33:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700865182; cv=none; d=google.com; s=arc-20160816; b=iSyjKLgSXgPGWgjc9IC4moKmEJ1lY5LrlEk2vmCZSvGbfVbwGTfuLt0SL1zGBDwFMw wt0gHw2fHaeJJyLpiswJW1K23ZPn9dzcefUvMKghAZHuX5QE+Cc0F7gKr95U3dCsYD7q CbDvszOk6HB9WbioQcX9GRW39lnWpfy/pCgzX+jk2CuVcn+WlcBOtQ3hyGyVpdLjZUxT 7Q//wE5AVx5H9pjCXUfmTYu4VWpydzPdmi1IFKQOWfWVfzzZmc8Duq5xs/NE0laXv04U TfUICnjWTLlKMJt9vC35dNu/aU6KgM+xV9X9fumO+lW5Z18N9b0PHUrXKTx3Bn/tnfhy Lrrg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=zFYyQ9i/5ljHZ5SV+FOADD995PRrp7M6DGNQl17p3iI=; fh=FP7vh/uLSL8T47BAINXnJeKRz+lJwSPdPP4Si4L9mlE=; b=nYZnV0F8laLAA6fmRol8qPJSFbVWDitMP2R7xwI/kphGhQFbOqqZegghevjQJRwRMs cSp5OOtSYOjWej5yvAPEd0UdX4fmfFQny303ZzbzE4XQubMUPJ/8h33JzdYMXX5QOe5E 4dGyCXWXbx0cwH4C2HtZGHAUrZ3s6rM7JM3OuQ2vbNbGxHFUZR4ocXPYNlc8zUX6Xgn1 oauCDU/iFfT+5HG2qo1RQrbosaLiWj08yVysR47cjphs0LfGqfVyBey4NsgjrAHWpHKT X4p2zL2yaU9M2pKmCjx/gj7J6exe86rLK9dnndJZ798/aLQCNUqG4wv8VixrQ4JNptpI v3jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XhXhw1f/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id pl14-20020a17090b268e00b0028014e41ff7si4796429pjb.48.2023.11.24.14.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 14:33:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XhXhw1f/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 63EC78061380; Fri, 24 Nov 2023 14:32:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbjKXWcg (ORCPT + 99 others); Fri, 24 Nov 2023 17:32:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjKXWcf (ORCPT ); Fri, 24 Nov 2023 17:32:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97FFF10F7 for ; Fri, 24 Nov 2023 14:32:41 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4D35C433C8; Fri, 24 Nov 2023 22:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700865161; bh=11MQ+yZzITnqG5iCSLzAR411rSB6tjFg5VyDfzbjJAM=; h=From:To:Cc:Subject:Date:From; b=XhXhw1f/S1WGDrAxGBXKoFRjkAl3m8ee/Z6PP7+fkqRZHpPw0P1gqNELFuM1dbqSs 6fa6akfIxfcqRgbU/Pmj46etXPL+xKU6Z6ucguTJEScf7sh48+bXECbUClAwaFCliP DSFJvBkAlhezpVWCqnSflQWwxjUHTpadGKfM51138/a38+otC8lpu+3wwmKXL9TbET EZcKh68iwwoLw5hpvFBt/LgC4G2GcYm0EGbds/YTx6R/VC1NJfFUzrz8dKuv9weQbF k1yztCZeocTb5l7lFX3QCMRsUJFMbojpa+ROwgIn3OBomvPF2oL6ZcMpJD6VZE/g5s lLzN914NGjREQ== 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 Subject: [PATCH 0/7] cpuidle: Handle TIF_NR_POLLING on behalf of polling idle states Date: Fri, 24 Nov 2023 23:32:19 +0100 Message-ID: <20231124223226.24249-1-frederic@kernel.org> X-Mailer: git-send-email 2.42.1 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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 24 Nov 2023 14:32:57 -0800 (PST) The TIF_NR_POLLING handling against polling idle states (mwait and also software polling) is a bit messy, with quite some wasted cycles spent on useless atomic operations. This is a try to consolidate this state handling from the cpuidle core. Frederic Weisbecker (4): x86: Add a comment about the "magic" behind shadow sti before mwait cpuidle: Remove unnecessary current_clr_polling_and_test() from haltpoll cpuidle: s/CPUIDLE_FLAG_POLLING/CPUIDLE_FLAG_POLLING_SOFT cpuidle: Handle TIF_NR_POLLING on behalf of software polling idle states Peter Zijlstra (3): x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram cpuidle: Introduce CPUIDLE_FLAG_POLLING_HARD cpuidle: Handle TIF_NR_POLLING on behalf of CPUIDLE_FLAG_POLLING_HARD states Documentation/driver-api/pm/cpuidle.rst | 2 +- arch/x86/include/asm/mwait.h | 23 +++++++++++--- drivers/acpi/processor_idle.c | 3 ++ drivers/cpuidle/cpuidle-haltpoll.c | 5 +--- drivers/cpuidle/cpuidle-powernv.c | 12 +------- drivers/cpuidle/cpuidle-pseries.c | 15 ++-------- drivers/cpuidle/cpuidle.c | 22 +++++++++++++- drivers/cpuidle/governors/ladder.c | 4 +-- drivers/cpuidle/governors/menu.c | 8 ++--- drivers/cpuidle/governors/teo.c | 8 ++--- drivers/cpuidle/poll_state.c | 32 ++++++++------------ drivers/idle/intel_idle.c | 24 +++++++-------- include/linux/cpuidle.h | 3 +- include/linux/sched/idle.h | 7 ++++- kernel/sched/idle.c | 40 +++++++++---------------- 15 files changed, 104 insertions(+), 104 deletions(-) -- 2.42.1