From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 701384266AF for ; Thu, 22 Jan 2026 11:20:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769080808; cv=none; b=PE8TjKr8bPTI739wY15xzamQ9DVxa0ApLOqfsVGANYjWoxsgr3qCqXPDLd2sfmp8qOENbjRzOqlgEMPIVLch2RU0ZHLthiuQRhOkSD1G/HgBHtx0YbfpGW7Vtmf6iuSdEb4DhZp2E3vNnrqyvgYUFpTdgDncpp5TpIGZDaDkiik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769080808; c=relaxed/simple; bh=9drDpY6+z/ej7FB1CPcTn/nYH3WOGUJooU/8D7OpAgg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YYF8Ej7ndQO6I/Ih5oxhnmEwvY1E1KtDSdPG4WExLxq0YBmuYJSTWt4QbYt1/LlEPal8U9weC20mMBaCBTrMxQfFaEWoilNJfjVUxhKG+jwJ82NDlXFOrkF0DrHvxJAP2sywHpYNMgyYYcaXx0GXq7tmlkpWA9257g0Qen8Ui18= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YcP34y7e; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YcP34y7e" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-47ee4338e01so5121695e9.2 for ; Thu, 22 Jan 2026 03:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769080803; x=1769685603; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=vE16nPS696hV6qrtA4V5+Qb8uv6z8ojCk8XJiLozdcQ=; b=YcP34y7evYlbP8KjZPr56OD/ulJ5DfPGRL+gMMA58U5ujb3+c8LGrj3KtZrTJ7Ri5l u/70JMAcJIx28U6HHH5XR8a/yUxOetwQ8H1wtuYjuPanuGdIIeTAG4A/GwIvhvNPrXGi kT+kMcYS69OlVKs2EvjtKG2j+2KpC74MGYCCfK4xgo0a9JZZCkMnKsV7IEdKb5505zZW Bjflg77EIqPa7wUOh2fIgTAPGnTZ0TF2uqIftBva5lHvFAi8SLeqAC2tKXq3Dl0QQymU IRajj3c6eEjzL6asrKBycVhFdr4cAfFrP+qQEB3VnC5INdYHBLlB1clGd+yfs22NGk8S cseQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769080803; x=1769685603; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vE16nPS696hV6qrtA4V5+Qb8uv6z8ojCk8XJiLozdcQ=; b=VRsJD8Q6N/Va+/j8YfI2J98NLHj7Fje/tL6C2p1iT13FZhJmIz++JglgeQOV2/ukzZ FCkI1RCn145ZrKgMdg89I9l6FDPYCuoBlBR9Hu1KHKZDLc3FILBAWinJznHy0cu1S+8i 93SS/fNouru69oH7Cqa2jrKs1KrU2MKhVR6JwSX5LJKZOD7LNZQnxuF8RgoM39A+hOOG CwTOoUSQ6iE9YfmLW2BaPSfZZ4IVUBXTcjd7DYeqAemuXa0RgdTTQ2DYGQH9ogVsLTxV NG9VopQsTZ9rxt6OTUtRvk8I14bkl+h6vEQsAcs9ZLsGTpgNmKqKqw2bQCvM+PaChuao AG3Q== X-Forwarded-Encrypted: i=1; AJvYcCVlSIIVEHZK8Qy8FI92JoaY14kkE2/uxNJAj6YZSpc6quuKDNOF6YNY7zCdgklXJ4x1YJ2T8DT4KTqJ9qQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyyH/WF6Q4Tlc3NtatOT9vuXzqgEnidbPsq6uRqdwfkY+Dqva88 TCyGtj1V+hG17cXPIGFyd7NS8kkBxDyGKmQouGJWyrb4C/v9MdYrVQa0 X-Gm-Gg: AZuq6aL3rQX32CY/O8iLx7u2gyNmaqvHhUWhD6SHfeu2I8RyiOuIXSeBDTs2zJcDV4r ZKu0FkDIKnrK0AWky9+X+pwGd/W3XkAYEvkYXl1gmXCuF0ZLgb15vToV+mDgt70RRt5C57WC1og hXYUUCfqo0iY0RzA7U6b1SbL7uEPaLgwXPfs26r4wohZ8+NjPZnT+CI1msypekPrxXlFjicDDpB OSbpPd5yGsNYJ2UAGnmdOIwSE6pCdTGVxrz3GBTbvPuNnjtgP8Ouc/L/gEqCU8nq7Lin0HypCJ6 6o/aCTGR8hkS+wjMmklNEjF25/9wRMAzhfBG13Gsqsv+mYrXbxUhJhyh3NomO7IrQ0q7US+JA+4 w25kNh0GKFO7z1wYDg+4kkU+gqlKj/9NolJOxYi5kkx78SyRE8XBc3vNTcWljiSTK3f1zXGvKFf wWY5QyWdHsFZfxf8Jaf8GiwcdWK3NhX48Pq3kZnpkarWTwC+8dEGTc X-Received: by 2002:a05:600c:4748:b0:480:1c85:88bf with SMTP id 5b1f17b1804b1-4801eb10a4amr295290455e9.27.1769080803227; Thu, 22 Jan 2026 03:20:03 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-480424aa344sm51662315e9.3.2026.01.22.03.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 03:20:02 -0800 (PST) Date: Thu, 22 Jan 2026 11:19:59 +0000 From: David Laight To: "Ionut Nechita (Sunlight Linux)" Cc: rafael@kernel.org, daniel.lezcano@linaro.org, christian.loehle@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, yumpusamongus@gmail.com, Ionut Nechita , stable@vger.kernel.org Subject: Re: [PATCH v2 1/1] cpuidle: menu: Use min() to prevent deep C-states when tick is stopped Message-ID: <20260122111959.14e8fb3e@pumpkin> In-Reply-To: <20260122080937.22347-4-sunlightlinux@gmail.com> References: <20260122080937.22347-2-sunlightlinux@gmail.com> <20260122080937.22347-4-sunlightlinux@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 22 Jan 2026 10:09:39 +0200 "Ionut Nechita (Sunlight Linux)" wrote: > From: Ionut Nechita > > When the tick is already stopped and the predicted idle duration is short > (< TICK_NSEC), the original code uses next_timer_ns directly. This can > lead to selecting excessively deep C-states when the actual idle duration > is much shorter than the next timer event. > > On modern Intel server platforms (Sapphire Rapids and newer), deep package > C-states can have exit latencies of 150-190us due to: > - Tile-based architecture with per-tile power gating > - DDR5 and CXL power management overhead > - Complex mesh interconnect resynchronization > > When a network packet arrives after 500us but the governor selected a deep > C-state (PC6) based on a 10ms timer, the high exit latency (150us+) > dominates the response time. .... We had to disable the deep sleep states on much older Intel -7 cpus. The problem was that we needed to wake up multiple cpu and they tended to get woken in turn - so it was far too long before they were all running. I suspect that pretty much anything that cares about latency has always needed to disable them. David