From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 8123F47D930 for ; Thu, 20 Aug 2026 16:39:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787243945; cv=none; b=pV+8fRtITA06PdXkGw7TDe30CECZw1POh/VXisoc7BkywxXGWxXMpSThj3lJCy1t0wEAkA5+dnQb8P3s6OeL1OVc6meywOc0qcUsRtUwFoHIWTyqBBt/SQlXiShNIC7Nt45EFZX2Geh7M+TKd8eJu2Ra7IQHFji85l06sERVe2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787243945; c=relaxed/simple; bh=jKcxoKbIsQ7QDT2hCb635XJSw2JDoUeo20a5dXMuax8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KQjnqGICgSvlHuvyN0JZIjgmsxs4qfXbAUgyeSFN1cWnRXPx+ubqMh1QI7sFGGqW2fUtTw4qY3z9WOYByQb4B6kLbHBBr0Qr2Yezj9R/yZq+wmTdEptl2cH0fc8Koh7RiHhHXn77R2WeBZsy/qnfq5jiJ0GfYjZAaYWwDO7/Nkc= 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=NqTiRM6q; arc=none smtp.client-ip=209.85.214.172 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="NqTiRM6q" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2d53197d8b5so864185ad.3 for ; Thu, 20 Aug 2026 09:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787243944; x=1787848744; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=fDmRvt2Dh399KldFX1CZaOl2WYAoa2VBzfFsCwhkX3k=; b=NqTiRM6qlROFxlkUSPd4e037YWJ+ZMZGp5na/KJ6atJRD1m4fbVbBLkrQu8MlBoKJc A2zct+mOh3zjtN7gGnXx5RJYHrL1EUQgdy0KEAuvou8Suh9WIieuLE31CgtQUQJDCxjM C6iZ7IRcB2mCjhD0BFbDx+HVJl0Gq9sEDPbHNbZoEyz6XGHXOhJqC0940FM1Wh7Cc00Q R5VD/jeMBr1bCzF6tP3CzCwFtl2mA8NLkcGfFQ8WhwzNFwe1IJYswHY1GgxWJcfOY0+8 cvmueXj+y2rauEF2GIADG/lWpszLxAN/lBcdV7vrdA0TQCK4C5WYilnEPBz4b1FnB6fH h05Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787243944; x=1787848744; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=fDmRvt2Dh399KldFX1CZaOl2WYAoa2VBzfFsCwhkX3k=; b=D9bxFbTW+hhd5ouGr9HluvbUVIdAnHj/WD/f7GapTylBEPAv3Qi9TLqrrNSfHNR8Mk Nghg3FXgP+0wKWJ+CARRvtjGeyj9WA6ApXNk8tmffR6AAPCSrDydyOqjEInSeRjLICKk ukURiq7PQgXjkHHmZwctyrjRHTNFZoj5BGkI9+pBv7S00xZEuMCFM5HXmQsk/klFe4+u W/ZiN5AZeb/5AbsLxp+YjRkG9+twJrB9JcDNP+AxSZyL0jPm35/KhCAixz4FP17KChQb qKxa+sJGLMfn9yF/MlbEKEDEmnaXYBtJORKLnauuAVcKUzRK/AiSVWc8OtZk647uOg7h 19EA== X-Forwarded-Encrypted: i=1; AHgh+RpSv785umYqimh0Tu2zdMoKBQoWF9NQW/sxR5g+P66QNvWy9PeoMU1PT6+XUlgH/7wh6nsUCk/T7MHoz0I=@vger.kernel.org X-Gm-Message-State: AFuF++nwkibeboOFZcPUxlj65i8n+7IClc32s+3YSlYMtfaBk/t+UN6P qLJT6xxBbpGo596hyQtd4FbMyNgH1DZR0hrulPl+ub350JZrilYtKvbZ X-Gm-Gg: AR+sD12ZKYBk35ValwRwITqzz21Qd9522E1330vDj5yo/u8jufstA9l9Gll+5OYr4bv DI+BlJiHxBuEfpmW6GhhEo6afYdoztwcdbK9SPHcBiJW3PIzlpHsIhpC2vyjBB/DOz/E9LhiToc zDhGE4su0sZCyMvCjsiqqNcBc1qRyPsxVnzz4D/SpzHlfLX9BU2CSeCtxnwsSZc2o4ZxArwn8pg W0M0T8bSOCKb+9tX5OHpQlu/aYOs+nADdVLGAwfRHOaVd9leFmqtQA2lvvslJQBUkfH9C2EWF9u HB+6qNlSUUby1H5UYb+wenMokZr5NFBAw7X+Br4DfnHsmUAR3MQOJnISaofr3vr1RC+bJkECAfV bL0OLUKIdKhspUW35+AinL1UL0o51Gr7z4snOlkr1G8FUoam3E0/HYHdRp+tXv8UDRmH4Ome8P6 snOJwrSfDHZP9rTXXMGnVP/1yMoPL9WEX45rD0ebGqM7DFxxaMJ44rbk6CsQ2gxkjTfq9xMoSrh A== X-Received: by 2002:a17:903:1a86:b0:2d1:1f73:3667 with SMTP id d9443c01a7336-2d5fd65fe83mr292672675ad.1.1787243943674; Thu, 20 Aug 2026 09:39:03 -0700 (PDT) Received: from localhost ([220.196.228.78]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d62ec88bb8sm9500305ad.83.2026.08.20.09.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 09:39:03 -0700 (PDT) From: Liang Hao To: Sebastian Andrzej Siewior Cc: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Jonathan Corbet , Shuah Khan , Randy Dunlap , Clark Williams , Steven Rostedt , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-rt-devel@lists.linux.dev, Liang Hao Subject: [PATCH v6] docs: real-time: mention the hrtimer sleeper HARD path Date: Fri, 21 Aug 2026 00:38:58 +0800 Message-ID: <20260820163858.27984-1-haohlliang@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260820144655.22492-1-haohlliang@gmail.com> References: <20260820144655.22492-1-haohlliang@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The Timers section documents the PREEMPT_RT softirq default and HRTIMER_MODE_HARD, but not the sleeper helper used by userspace sleeps. Describe that path, and rename "ktimersd" to "ktimers" to match ksoftirqd naming in this document. No code or behaviour change. Signed-off-by: Liang Hao --- v5 -> v6: - clarify soft delivery for non-RT sleepers (softirq context, not HRTIMER_MODE_SOFT) Documentation/core-api/real-time/differences.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/core-api/real-time/differences.rst b/Documentation/core-api/real-time/differences.rst index a129570dab5a..6f5be9f0da2e 100644 --- a/Documentation/core-api/real-time/differences.rst +++ b/Documentation/core-api/real-time/differences.rst @@ -119,12 +119,20 @@ timers initialized with the HRTIMER_MODE_SOFT flag, which are executed in softirq context. On a PREEMPT_RT kernel, this behavior is reversed: hrtimers are executed in -softirq context by default, typically within the ktimersd thread. This thread +softirq context by default, typically within the ktimers thread. This thread runs at the lowest real-time priority, ensuring it executes before any SCHED_OTHER tasks but does not interfere with higher-priority real-time threads. To explicitly request execution in hard interrupt context on PREEMPT_RT, the timer must be marked with the HRTIMER_MODE_HARD flag. +Userland sleepers usually deploy a hrtimer to guarantee a precise wakeup +time. The timer is initialized with hrtimer_setup_sleeper_on_stack(), which +distinguishes between real-time and regular tasks. The hrtimer of a task +without a real-time priority is handled in soft interrupt context, but for +real-time priorities HRTIMER_MODE_HARD is used. This ensures that real-time +tasks are woken up as soon as possible while ordinary tasks cannot block the +CPU with a thundering herd of wakeups. + Memory allocation ----------------- -- 2.50.1 (Apple Git-155)