From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 E5EF7AD4B for ; Fri, 12 Dec 2025 07:02:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765522954; cv=none; b=aEfusm7A9AHtOWKjo9l4/yaimhKhuk+Fh8HoyPylegikc5qhyVvIx2/gunRTwf0buF/svVs+504iP/wdp3ySavatMqPQiq+YhpwbUx3noFREom3udGTpUB+z0D5qoox7ZPPiRxQDCEa3f4DRNxnTsS7AkUj/2yuEvVVhXNm60YA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765522954; c=relaxed/simple; bh=KNEjlvnFjnMK2hlwcSghpX4aglZgdkRodgMgPJTdQyg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DfWWXhf0yCeT23uyXsxOWqFhie5jVjc9tidXQE8oa1q9FvWmzVOVlhSfDdPllUAQYlKzAxuwjRCMIGRKREUKKZZvOaG6LWsVbeFpcnHgMM7A7TX4m2JRBT+MOA2kmgeTV+31ibufxPXuCBpj9ijrciWHJ/hQCPAvWRUgMkir3G4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=B1Qfrb/E; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="B1Qfrb/E" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4779cc419b2so9396735e9.3 for ; Thu, 11 Dec 2025 23:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765522950; x=1766127750; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8J31nkKLMTJ/Qo0J4+PLRi2H/hsgHiES0A2U3TOlxM8=; b=B1Qfrb/E9bIfbeJiHh1Lfy4176WGbRfju3D/+erPvW+AANQoMS+1PJbnQEAtZAifF4 h0BLYW8Qy5VICFxtjHto528XUeq61U3uEcYPSfT/904y48o6Ca32zif8ftouwrGn0ceu tVZVHqrA3b030UMw5LCWAPmvQf/grvw3WDuVeMJdblSuU+hZDHyWN7Cck5XVA5V/Yz4o SE70xANxl1Ti9jAd40G90vneQj0LXBYTr0Sl6bMdE8Z6dPSdy7VClSFti0zEDMLmgBrJ tXV+ICr3QaHorg+qmnqBOnwgdACdqmqUShrSfWsr8kNGM5RRizNbJiYIqmFg7EibhSk5 Mw/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765522950; x=1766127750; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8J31nkKLMTJ/Qo0J4+PLRi2H/hsgHiES0A2U3TOlxM8=; b=eQEUIIdxyVvXWldv45cKdQh38rPMCTCy6oDRjL8IC9deVc1P/9NfaBO41zaqWmw4ZF 3zybepbM2lt6iECkMYREFg34uUxtERwuCvUnMHzhFUSAexoTOPE/og3VMBfwTiRm1eSW jhXHf9m/BBP3D8D4fzbcaSTw8OCNTLhK3oS1abyrTrms49n4/HRATAcYQi7dQH+Eadpz 7gwMDGvWo2exphSJ6/2to88RY2XQxUq6QT8z1i5JL2iacBJyUMDpDDAMvkUMwQjXnYE9 WZtD+H+mWptGacdVJMqRikwbzoBJoRpCtLwplOU0Otj81lKZjmJlsPQC56cw2Pyl0MZx IWTQ== X-Forwarded-Encrypted: i=1; AJvYcCU8uc7iW/afBrJq/9SoKqiEpCIuNCK1js8nQUjLDzjlTHbdvw4jXrPHJKRZgeTueT/8YVUaQ7od7nJU6Mw=@vger.kernel.org X-Gm-Message-State: AOJu0YxXtPvy1O6wekUy8znKxdivOs7XbCzh0wVr+7uQz2zDgEwt8ZyA gV39wYKYznLeWJCqp8Bh+oRBjKy3YktQH+Z79PpsdLeBpnmdrpQSlaX5aAzB2qp8dx4= X-Gm-Gg: AY/fxX65virhS95PQIJJaL4PXj8y4xxRfTNd4BTrbw7viAaiDvE5RkwdBeYtU4Y+a61 XO6MjeAMCHRJWU8GKxPKFscItNhx5WIY9HAAMEJgIGp6y5SXER+8CrBHlMfEPvbQMPoIYPos0nE KR88hhTitQBXOgpHJzQH/tSFYeIz4jcg/CyMnjNpyinOV66s8VG927yi4zi3fbOvaG5zR4tVEUB yBGchmZiy1lunIwCvb1uMGJoetvHie8J9Gv3uZx/uLunuCvCFfMmBWcJXi0+N0wplm/j99u2j9z r4YXlhbdWdNyHC5jHgAIUKmv7tbNPDI8aMnGIZb23gklwQT1c8/wftQvZVd+DIhXhMfd6weIDw3 ndVVYiGqRVSbReVLA2HvHB6goIZsjMTJxBX28NVMmFWeC7GiG34MUMLhVOZcYW7paxOipBxJdIo yLulhSukw9Xy34EEuQ X-Google-Smtp-Source: AGHT+IGAznv12+yx0m4z+hfisaKwl9TD4ly79IiQswuss6K34VrQ44sHBEHY9oPy8lOOyq9J3PK0JA== X-Received: by 2002:a05:600c:1c91:b0:477:2f7c:314f with SMTP id 5b1f17b1804b1-47a8f8bdc58mr11091745e9.10.1765522949461; Thu, 11 Dec 2025 23:02:29 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fa8b8a9efsm10976215f8f.33.2025.12.11.23.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Dec 2025 23:02:28 -0800 (PST) Date: Fri, 12 Dec 2025 10:02:25 +0300 From: Dan Carpenter To: Sebastian Andrzej Siewior Cc: Nam Cao , Yunseong Kim , Nam Cao , Tomas Glozar , Shung-Hsi Yu , Byungchul Park , syzkaller@googlegroups.com, linux-rt-devel@lists.linux.dev, LKML Subject: Re: [Question] Detecting Sleep-in-Atomic Context in PREEMPT_RT via RV (Runtime Verification) monitor rtapp:sleep Message-ID: References: <32839fb6-dbcb-4c5c-9e3f-d46f27ae9a73@kzalloc.com> <87fraslu9c.fsf@yellow.woof> <87jyz5kuf2.fsf@yellow.woof> <20251202112644.YUux4LKd@linutronix.de> 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-Disposition: inline In-Reply-To: <20251202112644.YUux4LKd@linutronix.de> On Tue, Dec 02, 2025 at 12:26:44PM +0100, Sebastian Andrzej Siewior wrote: > On 2025-12-02 12:14:09 [+0100], Nam Cao wrote: > > > RV is not a static checker, it is a run-time checker. > > > > > > Just in case you are not aware yet, there is also Smatch: > > > https://github.com/error27/smatch. But I can't offer much help there. > > > > I was looking up something unrelated, and I found that Smatch does > > detect this sleep-in-atomic problem: > > https://staticthinking.wordpress.com/2024/05/24/sleeping-in-atomic-warnings/ > > > > I'm not sure if its design takes PREEMPT_RT into consideration. But > > seems worth having a look. > > It does not look like it does. Judging from > https://github.com/error27/smatch/blob/master/check_preempt_info.c > > it increments the preempt-counter on preempt_disable() and spin_lock(). > So it won't yell at > preempt_disable(); > spin_lock(); > > while CONFIG_DEBUG_ATOMIC_SLEEP would. Yeah. Sorry, I haven't updated this check for PREEMPT_RT. There is a bug to do with cleanup.h that affects it as well. If you have a goto from inside a scoped guard that isn't handled correctly. I need to fix that as well. regards, dan carpenter