From patchwork Fri Nov 24 22:32:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 13468214 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9AE413D3A0 for ; Fri, 24 Nov 2023 22:32:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XhXhw1f/" 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 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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(-)