From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 410B844C677 for ; Tue, 4 Aug 2026 10:45:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785840328; cv=none; b=ka+1N4kxjbA+7C2N8Jz1ZJosdxFp1wpKcLcS4zbt5kE9Oaz1gBH5g89SHnC6WenzQq0AhaWXZNssuuc0eod4ZuQdLe99T4mZZaJJYTdvtmN+/IyOw6xmKqfU0DwcTBywwT3HcpFlbTqIokMfseISjOIIHEHfyFxfnelPmxi0YAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785840328; c=relaxed/simple; bh=wLrvAGZ7jOnunflkcxAE6oQVsM5m+51uOLvAKd26H/0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=ryGiMHlAS2M32Bylcdl5WEoOykqcB+Rx/09joIQBn2+ZbpBUcpgyf3sw9KuKN7/T5OJBDcaJ6jD94z7+lcx7hlxrXCjL/9NlgW6i+1al+FxpzNOQ0R7KGvmHV5y6RXaOJ4Hto7HsWHIwn/EjNnIxNKXlWzPL4m10oCV2VGCR+aU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bmjs6dgh; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=lm5/6Ctj; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bmjs6dgh"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="lm5/6Ctj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785840326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=wLrvAGZ7jOnunflkcxAE6oQVsM5m+51uOLvAKd26H/0=; b=bmjs6dghWIDgFUVEINgRtDbW6x5Xmfnw8vpLGRulQHKXwhMLQji++ju0N+J/vpjgWqZc7D h8wZUkKK1E+0EjG1+M8iYLzRstrQHw7AVKVePPwsTAofGuxhYTE1+Sa+ZXGiCAk5MSsQfk tb4hJ1u7OuM9U08AwL6Bf2leg9GSrLY= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-sgTPpTWGOPOS6AQR7eKySg-1; Tue, 04 Aug 2026 06:45:19 -0400 X-MC-Unique: sgTPpTWGOPOS6AQR7eKySg-1 X-Mimecast-MFC-AGG-ID: sgTPpTWGOPOS6AQR7eKySg_1785840318 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-4740be00302so4123214f8f.2 for ; Tue, 04 Aug 2026 03:45:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1785840318; x=1786445118; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:content-type :autocrypt:references:in-reply-to:date:cc:to:from:subject:message-id :from:to:cc:subject:date:message-id:reply-to:content-type; bh=wLrvAGZ7jOnunflkcxAE6oQVsM5m+51uOLvAKd26H/0=; b=lm5/6CtjBCwZWJpZbOhC+UrSis1+yQ1q/kxQ6vl/O/auLifuUZCi5agWPwmtVKTW5x da0Gi7yuVWqwnMfnTg9tC6TRbYv4/l7fHEjNL+xzPE5Lz26Xd82W+BjU+3Spu2W3l35V ylOzJP6G7CCRoTA7RxXgs0lZd1aYWRm8rTi1AT6bSD0lsrExicmql23X26v7Gz7rsr55 mZGorFjsIwhLB2tupspX3PzwdNJN4r+UuvpIQ63HEAXCzPady/Tgj+oPnqF8Ou0WhrfX RCuhR8TDRyChnfX9Qv2nJv9jNXyWmfEIm/7yZuy7fqSa9VT7VevL3kjNu9GgZ41/Hgvn Vhkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785840318; x=1786445118; h=mime-version:user-agent:content-transfer-encoding:content-type :autocrypt:references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=wLrvAGZ7jOnunflkcxAE6oQVsM5m+51uOLvAKd26H/0=; b=SbqZDe15WjJp1ftHgJqLb6F5OOKRvbCuFwiuNMGIBpp8zolR323sOPDqfL7NxR9jxV 0WRx+l4836tEO13T9eacupsX8f1yLu7SRwlEbY5lIQEIj5JDBMmIff0bRVlhkLKU43UY S09u+obiA6kjLPDxOKeag3aokf5zC7Sc9mBt11NPpoA+vV2W46zCyoA1dTOKrom6OLeZ Cj/hAvdVJtLmwux7VtzbZIpleuOxBbMLKXJVIl5effBmQr5TVVCzCcGN5jnnWmpXl+Sj WuL0bt8Ya837GxbNFSr6oqV6mwZJRW2EPq3nt0aaMEbmybbu3sxnirONdyfjZgp7UUuH TsKw== X-Forwarded-Encrypted: i=1; AHgh+Rom6A5nqgzPGlRWOKZIGRbP1dgHxCFcayS2lJCzoRqktG6kh6OcDEYHneEO1Gfl8rJ0S5RP82PkBlyJcZA=@vger.kernel.org X-Gm-Message-State: AOJu0YxcjryogNIOma6fjxz+wyMeI2f5+3fL6hYp/+OFaZQZa4pYBUPN Psf73uDovxwMD4TR/szIUgwxmM49sVCjgUpLKw1Ahu+aMklE3/uk6oAO1kquXqBFxtcL6avyoPX 9hjH+1882w3nbI9eHLR+HW1VNTqdwL0N9BmB4oTnwab+UnW19vYQ8wAd+i/G+aH8PfA== X-Gm-Gg: AR+sD10W1nnRiJRgiNoe6yGbGNSO0q7CzHNiV5vz5MK8b5h+a3D1P6zLSMKeGbqHzNI +5g+Z5RCksnU4rbmpME1ZO4vSpLU2fALlnNNfi5hT+REKrCBWbnMJiiCEbfS/ki//EAAKzbl4BH +QQnFUOfhxLvZKj/DWgCkLqW3f1fqrgcV9Ca73BErzGzPzq5a4lRT1MGyoRtIFxLLqfF502yNwZ 0etKM2u/n+ioUFTZD/9vd88dAed/YBkglDmdhfJCcHdIkA63sRoblKw7OtttnD0UF2Dsnzw/Icf 8Y/5jMKZ0VuO0m+f7LvmfGdZGlsUfUIPQLeyoxXnLYb4hEQztSw82ncmqnZxAFtD4TwFjtEfRki RpLD5cB8vH65M/kqFG2DmsY2x/MkF X-Received: by 2002:a05:600c:3b01:b0:493:f0f5:f2d7 with SMTP id 5b1f17b1804b1-4980c66c90fmr254160045e9.7.1785840318413; Tue, 04 Aug 2026 03:45:18 -0700 (PDT) X-Received: by 2002:a05:600c:3b01:b0:493:f0f5:f2d7 with SMTP id 5b1f17b1804b1-4980c66c90fmr254159185e9.7.1785840317938; Tue, 04 Aug 2026 03:45:17 -0700 (PDT) Received: from gmonaco-thinkpadt14gen3.rmtit.csb ([185.168.96.228]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fd456a6cbsm38107677f8f.23.2026.08.04.03.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2026 03:45:17 -0700 (PDT) Message-ID: Subject: Re: [RFC PATCH v2] Documentation/rv: Explain epoll and aborted sleeps From: Gabriele Monaco To: Chao Liu , Nam Cao Cc: Steven Rostedt , Jonathan Corbet , zhouzhouyi@gmail.com, lianux.mm@gmail.com, lianux.wang@processmission.com, Shuah Khan , linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 04 Aug 2026 12:45:16 +0200 In-Reply-To: <20260729081102.73138-1-chao.liu@processmission.com> References: <20260729081102.73138-1-chao.liu@processmission.com> Autocrypt: addr=gmonaco@redhat.com; prefer-encrypt=mutual; keydata=mDMEZuK5YxYJKwYBBAHaRw8BAQdAmJ3dM9Sz6/Hodu33Qrf8QH2bNeNbOikqYtxWFLVm0 1a0JEdhYnJpZWxlIE1vbmFjbyA8Z21vbmFjb0BrZXJuZWwub3JnPoiZBBMWCgBBFiEEysoR+AuB3R Zwp6j270psSVh4TfIFAmjKX2MCGwMFCQWjmoAFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgk Q70psSVh4TfIQuAD+JulczTN6l7oJjyroySU55Fbjdvo52xiYYlMjPG7dCTsBAMFI7dSL5zg98I+8 cXY1J7kyNsY6/dcipqBM4RMaxXsOtCRHYWJyaWVsZSBNb25hY28gPGdtb25hY29AcmVkaGF0LmNvb T6InAQTFgoARAIbAwUJBaOagAULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgBYhBMrKEfgLgd0WcK eo9u9KbElYeE3yBQJoymCyAhkBAAoJEO9KbElYeE3yjX4BAJ/ETNnlHn8OjZPT77xGmal9kbT1bC1 7DfrYVISWV2Y1AP9HdAMhWNAvtCtN2S1beYjNybuK6IzWYcFfeOV+OBWRDQ== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.2 (3.60.2-1.fc44) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-07-29 at 16:11 +0800, Chao Liu wrote: > epoll_wait() is a valid sleeping reason for real-time tasks because it > uses PI-aware locking, but the rtapp sleep monitor documentation only > discusses clock_nanosleep() and futexes. Document it. >=20 > ABORT_SLEEP represents a task restoring TASK_RUNNING before entering > the scheduler. Since the task does not actually block, it becomes > runnable again without a wakeup sequence unsafe for real-time. Document > this behavior. >=20 Looks good, thanks! Please next time you send a patch, even if it's an RFC,= put the extra comments after the --- . This way I can pull it directly without changing the commit message because git am ignores everything after the ---= . Also, no big deal, but for simple patches like this one, and even after get= ting comments, there's no need to mark as RFC. Reviewed-by: Gabriele Monaco I'd appreciate an ack from Nam, then I might be able to squeeze this before= the merge window together with the last fixes. Thanks, Gabriele > This RFC is based on Nam Cao's pending "rv: rtapp monitor update" v2 > series: >=20 > https://lore.kernel.org/r/cover.1781852967.git.namcao@linutronix.de >=20 > Signed-off-by: Chao Liu > --- > Changes in v2: > - Explain why epoll_wait() is RT-safe in terms of PI-aware locking. > - Explain that ABORT_SLEEP does not require an RT-unsafe wakeup sequence. > - Update the commit message accordingly. >=20 > Link to v1: > https://lore.kernel.org/linux-trace-kernel/20260722045706.85633-1-chao.li= u@processmission.com/ >=20 > =C2=A0Documentation/trace/rv/monitor_rtapp.rst | 6 ++++++ > =C2=A01 file changed, 6 insertions(+) >=20 > diff --git a/Documentation/trace/rv/monitor_rtapp.rst > b/Documentation/trace/rv/monitor_rtapp.rst > index 238b59395ff5..b95994ade14a 100644 > --- a/Documentation/trace/rv/monitor_rtapp.rst > +++ b/Documentation/trace/rv/monitor_rtapp.rst > @@ -67,6 +67,8 @@ thread to sleep for one of the following reasons: > =C2=A0=C2=A0=C2=A0=C2=A0 variables as safe for real-time. As an alternati= ve, the librtpi library > =C2=A0=C2=A0=C2=A0=C2=A0 exists to provide a conditional variable impleme= ntation that is correct > for > =C2=A0=C2=A0=C2=A0=C2=A0 real-time applications in Linux. > +=C2=A0 - Real-time thread waiting for events using `epoll_wait`, which i= s a > +=C2=A0=C2=A0=C2=A0 real-time-safe syscall for sleeping as it uses PI-awa= re locking. > =C2=A0 > =C2=A0Beside the reason for sleeping, the eventual waker should also be > =C2=A0real-time-safe. Namely, one of: > @@ -114,6 +116,10 @@ The monitor's specification is:: > =C2=A0=C2=A0 ALLOWLIST =3D BLOCK_ON_RT_MUTEX > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 or FUT= EX_LOCK_PI > =C2=A0 > +`ABORT_SLEEP` represents a task restoring its state to `TASK_RUNNING` be= fore > +entering the scheduler. In this case, the task does not actually block, = so > the > +task is back to runnable without any wakeup sequence unsafe for real-tim= e. > + > =C2=A0Beside the scenarios described above, this specification also defin= es an > allow list > =C2=A0to handle some special cases: > =C2=A0 >=20 > base-commit: 248951ddc14de84de3910f9b13f51491a8cd91df > prerequisite-patch-id: d8b6c952a954662852e6b0684e0a3386eaab7f41 > prerequisite-patch-id: 940f7637aeabe4ba15a09c048c6f48138406f332 > prerequisite-patch-id: b99812692691f76d825778e01a2e771e058febd6 > prerequisite-patch-id: 512c300dce2cb74ac9cc007f9234aa507ef5c008