From nobody Tue Apr 21 22:27:07 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g0cRQ4psHz6ZkQ9 for ; Tue, 21 Apr 2026 22:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g0cRP52vSz3Pqg for ; Tue, 21 Apr 2026 22:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776810433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cx5mdpJEytNJ4d3E5DA1HhDjHwsChCpVHaCMTAb+mz0=; b=qFATjDfg/i5x/XgbitCKTSms+qbL+w0dhMj4XCo5qbH/DVAzV0IujEv8YcmB+4Tl/aFpvF Hg+h7iaATQgbV0kR0j6bFt3vWWssP1h8pcfZgaEoTvI/0rx+TjYDLVnhlO/f3/R/q8K6NW hbebLtcexPJcz/DPTrcuJcBmInoUSRvh6F0Vk4uKoF9VVjKaqdrYFG4tNCagau8OC53nWG wLsAtyJmy5xzvjJ7X0n57+1oEZHzxRr64hjsdg/Bp65EIaKwTam/n083iMABc1sbumykCu N8/p2NtpHX+SDJGHQYxaoSqH9XTrhxibvecL2a7Yj1pf3Hz+de6b7HGSkjuXWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776810433; a=rsa-sha256; cv=none; b=JjlYMKsxORJlZHfX0Y6QZ63Om2fKh2eWHfFScWKmpx8glidSuOaVPRmgIz1yTAf+7xz+an J83hg4czVQsWcztM4ancoOa/SPK/AMgoE01MROYIE5D9xaXMu6IdlfOUnpQn1AtsUB6Vdu afoptK8W8aKhziiR97z92dClMXzaFkMU74iLwYRGEVyFjj5HTDZ8n525Z7VxlWL3ZTwMb1 /GWNBtYrQVDqMGKE3Z+9fo51LVFrOe2P0mU0lnbXzO7jAqzz6Ej7rkK5ewEIfLJeAn+CW2 y+4ZwdIV8JtRWVa/0ege0ij5jWmkntbt3cvdwC6PIcKeoMh1GW0rxUFzXVxu+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776810433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cx5mdpJEytNJ4d3E5DA1HhDjHwsChCpVHaCMTAb+mz0=; b=H5Lwvcx9PeVfVKxsWNMThdDuFiMz1xHVG2o+U9RqcQ5I2uv9Fr6sPTlOnvejtPE5+HSivd gQdfFk1c1AaYLANyBXcNAzcFtfde0KNbyKWBVXDruu+8KDGhjTtN7BWyFevT8Y5DPjcGeJ ctjuWaBymuYOLa3q2UKLDaCW7y4t5492HFzCG/cyXN2RNxUqaFoapOkIFW7RW5ajok8cXK aoEI0qyQyrohUCecR3G173xIIFM7vx4GVkOJ5eADIQ2Deus/lyTZ9zXF5CKHuh5AxfjPHT jM8x+Rt2qXLMimTjbGXxN7KArXr6hz8b10gMastj8Jqjzt+ERNI80OXmqFe4Ww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g0cRN6CBLz13Z5 for ; Tue, 21 Apr 2026 22:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38fae by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 21 Apr 2026 22:27:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: ad528a6b174e - main - linuxkpi: Define diagnostic macros like `might_resched()` or `cant_sleep()` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad528a6b174e7090cb06062867e9a146b017205d Auto-Submitted: auto-generated Date: Tue, 21 Apr 2026 22:27:07 +0000 Message-Id: <69e7f9bb.38fae.6f1fd1d0@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=ad528a6b174e7090cb06062867e9a146b017205d commit ad528a6b174e7090cb06062867e9a146b017205d Author: Jean-Sébastien Pédron AuthorDate: 2026-04-11 09:37:05 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-04-21 22:18:24 +0000 linuxkpi: Define diagnostic macros like `might_resched()` or `cant_sleep()` They are no-ops on FreeBSD. While here, move the already defined `might_sleep*()` macros from to where they belong. The DRM generic code started to use `might_fault()` in Linux 6.12. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56434 --- sys/compat/linuxkpi/common/include/linux/kernel.h | 33 +++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/wait.h | 7 ----- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 2430b25c6915..e3ac4a05612c 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -351,4 +351,37 @@ mac_pton(const char *macin, uint8_t *macout) #define DECLARE_FLEX_ARRAY(_t, _n) \ struct { struct { } __dummy_ ## _n; _t _n[0]; } +/* + * The following functions/macros are debug/diagnostics tools. They default to + * no-ops, except `might_sleep()` which uses `WITNESS_WARN()` on FreeBSD. + */ +static inline void +__might_resched(const char *file, int line, unsigned int offsets) +{ +} + +static inline void +__might_sleep(const char *file, int line) +{ +} + +static inline void +might_fault(void) +{ +} + +#define might_sleep() \ + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "might_sleep()") + +#define might_sleep_if(cond) do { \ + if (cond) { might_sleep(); } \ +} while (0) + +#define might_resched() do { } while (0) +#define cant_sleep() do { } while (0) +#define cant_migrate() do { } while (0) +#define sched_annotate_sleep() do { } while (0) +#define non_block_start() do { } while (0) +#define non_block_end() do { } while (0) + #endif /* _LINUXKPI_LINUX_KERNEL_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/wait.h b/sys/compat/linuxkpi/common/include/linux/wait.h index 03ddce2c06f5..698a1056b713 100644 --- a/sys/compat/linuxkpi/common/include/linux/wait.h +++ b/sys/compat/linuxkpi/common/include/linux/wait.h @@ -43,13 +43,6 @@ #define SKIP_SLEEP() (SCHEDULER_STOPPED() || kdb_active) -#define might_sleep() \ - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "might_sleep()") - -#define might_sleep_if(cond) do { \ - if (cond) { might_sleep(); } \ -} while (0) - struct wait_queue; struct wait_queue_head;