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 35629255F52 for ; Mon, 22 Dec 2025 07:40:36 +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=1766389239; cv=none; b=cXybPxWGzr9NjxUwFH1CEehBRLJAx7Dr2Z1QKS9KQdkF5/iCYHSRvZ4201yVJYgRstGKHL0PXMW14BLj7JF+1OnSBHls7SPni7qTv5GcIhBZtyrilBQpJpdagt9vqfDVnfPay5CZoZCzTV7nwD0RBIw8DkPWeb5Hegmgx7Or6ak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766389239; c=relaxed/simple; bh=bD3Th9oXpZgvOUOXrHo/WcZuW4ZPE3M2cjZpHWYh2Fg=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=XgHO9t+dZ9p3oI2NcmPBIqjYPb9AG/U3aTd/87swAZh6VPEmvOh+iJv4uCRkHukklFbahAtqyfELGz6tSFXn2j7xC7l0PPcmiahQJLYxnjNLMHq0vnRzJcoR3k4UIk1TY40Ux8NRLwYlJGPqYdG4z5wMJyKxtbwBIcA4fMKJeCg= 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=ZzGN51V/; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=tMZYfy/S; 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="ZzGN51V/"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="tMZYfy/S" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766389236; 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=bD3Th9oXpZgvOUOXrHo/WcZuW4ZPE3M2cjZpHWYh2Fg=; b=ZzGN51V/Oy+G2iGiAkBooJzSjjjasr9tD5la2+0UnmYL7TfuqTs87/acGWaofUD8yY1jdC 5X9il9Ds6i9DzMmWT8YJWQvXWlcPZcCLapsm4jKbqBGb270rgqYCenk1z9vxFY41SHaBHs 2Iz3HAJQ7IVe8CMQurE1jLH1Wr7RDAI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-55-KqKKOLiuNXKodeXztO8gDw-1; Mon, 22 Dec 2025 02:40:34 -0500 X-MC-Unique: KqKKOLiuNXKodeXztO8gDw-1 X-Mimecast-MFC-AGG-ID: KqKKOLiuNXKodeXztO8gDw_1766389233 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-477771366cbso23803715e9.0 for ; Sun, 21 Dec 2025 23:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1766389233; x=1766994033; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to; bh=bD3Th9oXpZgvOUOXrHo/WcZuW4ZPE3M2cjZpHWYh2Fg=; b=tMZYfy/S15TSdN89U7ncXiZGYGLozQbNjWCS8v9RHwEEf8Gs4PoD6SWYub4w3xqL4o NxAm+aQ4UsnvEDrcYcD22i2hTo5OLm92vzdzEkP5l5w9l78QKdKecHFwLJtRraUjPox+ pzDfSIJwnefHwqsKZrqz01VCeB7DxbJXmTXvkBJxjhq3Ui4GelU0N6Um9wc4zr73c038 1scOFlToLcCRUPN8huT6YW3NXEdPARizjY0m6oOA0g/rVM7MQQt4kOxWYlzuZlg131eZ l6T0uRyBHf8ffRoRQuYkY8zoVL3Pf36N2EtAMQ6Z6X7bwvDTvZN3RYw8ftRl6k0NZzwr 6yhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766389233; x=1766994033; h=mime-version:user-agent:content-transfer-encoding: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; bh=bD3Th9oXpZgvOUOXrHo/WcZuW4ZPE3M2cjZpHWYh2Fg=; b=BEjgDV0/RxZ4usH5dyi025qFhwvs2rls5uSbADpCapY5dJ7Pn94BYinvKder35TiOl L9uT5GYbQQ/wpYeP1G4vPUE1REjGmZ+As7lImuogAwERHv7znkY2yS5Iac+cC9NDBaOi JdINba7Ibd4AbNCfPbmqVX7nQFEf4WfeAQzMNCAMC0uLpk5qgRT+8qIJesLI5I6KN2q0 MOmgpVclWUhGhURPEJQipJnLw5K9NdG0Bq7fYySI4EqdLdpCW2OZL6qg1F0ncBTa/LER vfataARKIkprnB2O8GSwIfKSZaVQC5L7UbaLf1QkScav+5jcb4XxmcKI1aM2eeaGEWqA vDNA== X-Forwarded-Encrypted: i=1; AJvYcCW4LC3krhcOzHHuihtRFrTEevPTHJoYGM96n/wSoqZHiUIPbm1Tr9jKtDeZjOd2y1tIeFr04zN9726uwjo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7QCjfzNTal7n6DrApZInhv0EbOaODB08+2qeaRgmmonQ47fOZ pA0UB1E983JXbpuGANkPojnFal03VJXTOIyX8rW55bCezkrOqisvX+VxRY+trz0su5+dx12+CrG dw8Wyz/z1SyWQtlUnXHY8r2laNSMN9z6WWzZPCoJHWwzTGhu04DFljFaA3o7hlQqFhg== X-Gm-Gg: AY/fxX7plHvU9ygED4gr853R9VxPtX3xO4Ljh+07zX4EQXF0dtTutPOpmOigfichEsB 8mCcRw4txSeaYqoPJBxews+0erOxkg6db0TOUcvdFZBODmyAP6MzVamiRQ3GMzdSozqc3OM6dxv LqirOoanOw7U5TyKlx+Q2kBn6TkBg9Vu+KlcM5G4WFOAJLi3nez5x6UzU4CmqyZ2VVSsvywDiJZ DyAzYDlMAKArXy6dGjL6N4WuLdresJ/KXq5Oyg+E177hVRNpE7IqnsAYIXZZOyql7xfq3/xoF9R bHYVH7G+6GO74RZFk7xNby42KsqzBhugOeinnnuvVMzRIBHtI8oFF7yQIAGCn9PVGq1V2ePPHBq 4KVtA6L3xPvqa/zk22fs6OE9zmOP4CvhZ4aTDOmO9DTlGuzsUuALzZd7e2oukuiDn6J47Ymvpik V+Nz1hLG6H X-Received: by 2002:a05:600c:4fc6:b0:477:333a:f71f with SMTP id 5b1f17b1804b1-47d19576cc6mr103507895e9.17.1766389233279; Sun, 21 Dec 2025 23:40:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGV35AhXNHaKDsM+gyviDaijn4sQ7bbYpPxD/mEWmBNQuwWBocnrnXP0o1jzUsVmqsjxAwIfQ== X-Received: by 2002:a05:600c:4fc6:b0:477:333a:f71f with SMTP id 5b1f17b1804b1-47d19576cc6mr103507735e9.17.1766389232918; Sun, 21 Dec 2025 23:40:32 -0800 (PST) Received: from gmonaco-thinkpadt14gen3.rmtit.csb (185-132-178-103.hosted-by-worldstream.net. [185.132.178.103]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4324ea227casm20673297f8f.15.2025.12.21.23.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Dec 2025 23:40:32 -0800 (PST) Message-ID: Subject: Re: [Question] Detecting Sleep-in-Atomic Context in PREEMPT_RT via RV (Runtime Verification) monitor rtapp:sleep From: Gabriele Monaco To: Yunseong Kim , Nam Cao Cc: Sebastian Andrzej Siewior , rostedt@goodmis.org, Tomas Glozar , Shung-Hsi Yu , Byungchul Park , syzkaller@googlegroups.com, linux-rt-devel@lists.linux.dev, LKML , Dan Carpenter Date: Mon, 22 Dec 2025 08:40:30 +0100 In-Reply-To: <0d06ce4c-6ff2-401a-90d9-5a4dfd2abebb@kzalloc.com> References: <32839fb6-dbcb-4c5c-9e3f-d46f27ae9a73@kzalloc.com> <87fraslu9c.fsf@yellow.woof> <87jyz5kuf2.fsf@yellow.woof> <20251202112644.YUux4LKd@linutronix.de> <53f17978-40e5-4b2e-b719-552612b0e775@kzalloc.com> <871pl1y3oh.fsf@yellow.woof> <0d06ce4c-6ff2-401a-90d9-5a4dfd2abebb@kzalloc.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.58.2 (3.58.2-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2025-12-11 at 16:58 +0900, Yunseong Kim wrote: > I am currently considering how to model this to cover cases that go=20 > beyond what CONFIG_DEBUG_ATOMIC_SLEEP covers. >=20 > My specific concern is about custom functions where might_sleep() might= =20 > be missing. In such cases, if the code hits a fast path (no scheduling), > CONFIG_DEBUG_ATOMIC_SLEEP won't trigger. I'm wondering if RV can detect > these potential bugs. Hi Yunseong, I finally got to reflect a bit more on this. As we discussed at LPC, RV wouldn't help with not annotated functions becau= se you'd need to add tracepoints there, so probably the best is to just add a might_sleep and be done with it. Other than that, I double checked and CONFIG_DEBUG_ATOMIC_SLEEP is in fact disabled on non-debug kernels in Fedora/RHEL (and I presume also in Debian = and friends), so the other concern you raised is indeed valid. Although perhaps rather unlikely, I'm not sure we can completely rule out c= ases in which non-debug kernel (where several other debugging features besides CONFIG_DEBUG_ATOMIC_SLEEP are disabled) behave differently enough for some = bugs, otherwise invisible on debug kernels, to pop up. Another use could be debugging kernel modules on non-debug kernels, perhaps= to avoid some other debug features to be present while still relying on the packaged kernel. For this to work you'd need to add a tracepoint on might_sleep when CONFIG_DEBUG_ATOMIC_SLEEP is disabled (and it's currently a NOP), hopefully= that wouldn't make people too angry. Again, none of this would be ground-breaking but it doesn't look useless ei= ther. Any thoughts? Thanks, Gabriele