From nobody Thu Apr 9 16:36:12 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 BB24E3A255B for ; Wed, 4 Mar 2026 10:29:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772620152; cv=none; b=IHVGxgFyWekmHcs1nIUpHSAfTJUnuNbmaWAduSGZBbHRvESo6E/rP47dHzbK2iAaDvuciTfs1JYO52Cn/Kt6cRfpYGxW/WnGiqO4Sd/np8YlACo3iEXaJ7Qr9D03qmGEDA/5NULDDSqFuc1aHPcxzRDt6leo8bYUpt3THWd/yO0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772620152; c=relaxed/simple; bh=qDvE2HJEzyMcQRpPVVWxoIOiiyNAJs6RPSw659rPKdw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rDX/PMUvXeIDm7D5GiWsqTWOPLWqEFNKYPHGftYT4nbRkpDjlAXMtURbKx+xH7NB4Lg2egoWfzs+Sx13Cq3Uc2Sm60XJ99azClS2AmZF44qjqvFbWjtWCRzBpZOOmHa9F+RTxZINNl7ytdXBOhgwnKmAuIhCbNXbUGZBUJXuITw= 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=jBsfQ57s; arc=none smtp.client-ip=209.85.221.54 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="jBsfQ57s" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-439c4a93841so817229f8f.1 for ; Wed, 04 Mar 2026 02:29:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772620149; x=1773224949; 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; bh=WX8r5kTeexA5hjBkPMWcoH7tf0SLIu7YLl43ZFEMlvc=; b=jBsfQ57sTT95WvdIbCJk18/rfDFZ661QW/Jn1PM0kwJfTp2sh6A54ECuHCoKOXPd4s ktnQoWDMMqOBmS0TO4plMbSS8qUUYNCQ0Uqq7WioE4b6QWtkNAS719MK6l0bbZKDRq/E dU/BYzWAS0Q2t0srv0H6jS2SAeKF9ho0Q8HbSjoTJ5gpGRSUzLHeVFtxt3OwGWMxaJzW L4DLxO3VeWETaiz9gTB1be/CCUq94QFXSrNkC7YWYYMPA8yFSOsAFOo0h6dBPwIusk3l Gw/+bGqNMXhzp6tAkJHrqFW1qrOLUGyG8VMsk6sCa5rwMexnTY6jZLvter46QgTxUQb7 dihg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772620149; x=1773224949; 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; bh=WX8r5kTeexA5hjBkPMWcoH7tf0SLIu7YLl43ZFEMlvc=; b=fjh4t3CUtrq57OBkUH07gln+Za0w7gn+Z75iZB3/sRQAV7GAo8Y2eRQ9jdl3+bgtqC q9aQXNWK7njkoI1iLShBuEVb0WmFdGJZYMJV4Zz0H2vuxvbNM4L8ww1ayOhzi6JCTb0P PNr+OwRvgCpdC3If9OAfHRmpcvqDLNOVDiVnXmSIViOTGzWvB5B1MC1Gw3ukPCQriKYa 844fSmrCFWqjWkYTV860VqeEt9z3nCQ1boKVPl5e2/qX+2+iiI27imKJyQ6tCNa1bXxz MLYPJ8Hqh0mk7UNRsJYe2unj0QNkd03q1L9irukLhuUQav6KLSsRtYSf7+qHCZw/Fzf9 09iQ== X-Forwarded-Encrypted: i=1; AJvYcCWPWbTvnGPf8cUbPmCzHysMOk8DufuIFG+mE4lqMXv0WhvU4PUmuJwy9Wz4Wvgg1FEurvxhD3GZmCbXYIE=@vger.kernel.org X-Gm-Message-State: AOJu0YxVo/BTaPgXcfK3GsCw5NYQ/XdDqKOOfPGJEZY7MlP3IknKJGi6 yePh9YQ/+tDTqeuPL/DZjU6NdBuvnPaqN/pKsTFiDWmdPpjuA/6njyUX X-Gm-Gg: ATEYQzw5KJ9PAHRk11JS0blsmrUjmmRe50gtgLBgk3+DbEidcP+CEW1Ta0WieGYHVRU MF/i0NKU7TGi54wTnXAl9yC0Ze+p/poegNEozRuil8p5v9G7Z/8RI3c4yZ6PDDJqM91ecxJUnc7 Ks8Oh2HRlrzelJD/7HXX0Pv7zf1+tBNQlcEw79fClwvgyhUTT21VdqnMWi3hSUprZKN8HNaJvKZ C1QvVelyJ0AbHIkTwjwh/8b0v82Ykzr4XAQoGMdvxXfvttmPbgspWdOFKkl4/nYiWI/KD93zUHO Gqr0Sbj6UnMC7Bj6Y5/M9dPFtQ/qgS/va/Px3LcAwmEEMsTJ6a5SrPlzaxQHsKAU83YY07c+xZd K3m0cJc+pAT7mwLOD5BPppGCGWotNqmG6P+gMRsFraute2yqT30JuOnK+z31uAYeuANYZrxR6I8 S1qkQszofxmldMBOaCobwrPA3+iuDaO588eUz3dhvB0eZedJXmO85RET2EHEIm4ZpMKA== X-Received: by 2002:a05:6000:3113:b0:439:b6f1:cd8d with SMTP id ffacd0b85a97d-439c7fd406amr2833014f8f.28.1772620149042; Wed, 04 Mar 2026 02:29:09 -0800 (PST) Received: from laptom.homenet.telecomitalia.it ([193.205.82.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439c6129017sm5824734f8f.31.2026.03.04.02.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2026 02:29:08 -0800 (PST) From: Tommaso Cucinotta X-Google-Original-From: Tommaso Cucinotta To: Peter Zijlstra Cc: Tommaso Cucinotta , linux-api@vger.kernel.org, Juri Lelli , Jonathan Corbet , Shuah Khan , Shashank Balaji , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] sched/deadline: document new sched_getattr() feature for retrieving current parameters for DEADLINE tasks Date: Wed, 4 Mar 2026 11:28:16 +0100 Message-ID: <20260304102843.1373905-2-tommaso.cucinotta@santannapisa.it> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260304102843.1373905-1-tommaso.cucinotta@santannapisa.it> References: <20260303104215.1324243-1-tommaso.cucinotta@santannapisa.it> <20260304102843.1373905-1-tommaso.cucinotta@santannapisa.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document in Documentation/sched/sched-deadline.rst the new capability of sched_getattr() to retrieve, for DEADLINE tasks, the runtime left and absol= ute deadline (setting the flags syscall parameter to 1), in addition to the sta= tic parameters (obtained with flags=3D0). Signed-off-by: Tommaso Cucinotta Acked-by: Juri Lelli --- Documentation/scheduler/sched-deadline.rst | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Documentation/scheduler/sched-deadline.rst b/Documentation/sch= eduler/sched-deadline.rst index ec543a12..76fdf435 100644 --- a/Documentation/scheduler/sched-deadline.rst +++ b/Documentation/scheduler/sched-deadline.rst @@ -628,10 +628,21 @@ Deadline Task Scheduling * the new scheduling related syscalls that manipulate it, i.e., sched_setattr() and sched_getattr() are implemented. =20 - For debugging purposes, the leftover runtime and absolute deadline of a - SCHED_DEADLINE task can be retrieved through /proc//sched (entries - dl.runtime and dl.deadline, both values in ns). A programmatic way to - retrieve these values from production code is under discussion. + The leftover runtime and absolute deadline of a SCHED_DEADLINE task can be + read using the sched_getattr() syscall, setting the last syscall parameter + flags to the SCHED_GETATTR_FLAG_DL_DYNAMIC=3D1 value. This updates the + runtime left, converts the absolute deadline in CLOCK_MONOTONIC reference, + then returns these parameters to user-space. The absolute deadline is + returned as the number of nanoseconds since the CLOCK_MONOTONIC time + reference (boot instant), as a u64 in the sched_deadline field of sched_a= ttr, + which can represent nearly 585 years since boot time (calling sched_getat= tr() + with flags=3D0 causes retrieval of the static parameters instead). + + For debugging purposes, these parameters can also be retrieved through + /proc//sched (entries dl.runtime and dl.deadline, both values in ns), + but: this is highly inefficient; the returned runtime left is not updated= as + done by sched_getattr(); the deadline is provided in kernel rq_clock time + reference, that is not directly usable from user-space. =20 =20 4.3 Default behavior base-commit: f74d204baf9febf96237af6c1d7eff57fba7de36 --=20 2.45.2