From nobody Tue Apr 21 22:27:07 2026 X-Original-To: dev-commits-src-main@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 4g0cRJ2rVlz6Zkjg for ; Tue, 21 Apr 2026 22:27:08 +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 4g0cRJ071Qz3PYv for ; Tue, 21 Apr 2026 22:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776810428; 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=DNQsBCzhPiyP1kGvcCIkSzcIyVbNbS5oXgByWrNtB6leqofQWv9C2BxCKdLX8lmy7lAlgR PXnfpI43HSchXhUyeq4NbnfIwIrv+ldzzAYkPvvsR6PaDNeC24wJnG7LBRYJ5Lka7dLmYO 2HeoNWwckOauNApRzBRSZ+dNdkkJqgRPWjBnpdKTJnNmYfTcSL2oggIJ6fIFgfxIWKLbNa om1hvK4WvePmyHjRMHVfxQ50kYDwKrMbyj4m7vfL7G1jYdJ3VkzyI4WeIkkQZ9LzjJfb6R 3oZ7hh1B9ZJ+nx5eFd0qoNHzxzQqZe1FNXemhUG1W0h25y9sTGkpHV5aA6RDew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776810428; a=rsa-sha256; cv=none; b=JelwfS6EkzPTDvuu67/I85qAwgaSlkCBnlKMY/xsHDzSrSW11nyNgSkQe7K5ji7ubv/xid lInFHPRL8d+Q19M8KASTsGz3FoOYnoJh0WMnrPUAEBDvLv8mbFey5f1+Y8D/1BqCx536f2 gQAHmujYUeOBTDGgsfcXshcgSujz/ldhkToKtjek0oB8M6dBCJrFZtTvQZrsz3PUJAnpAO qc369J19CP6faWmzK0QP/REkf0CdRbHqLNP1TX7C+1ryUMnsU+AP2aXZp+jBNyyY7ODDgq lzP/Uq/8ERbmSJjHiumcYHmnnyphL8skQBUVLO4EkoxVnNMfDospaYZzWHG2NQ== 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=1776810428; 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=P8CSndzVmMTl/H39YUo9XhHOG5yrpHKOXj7S5DpZSdMRIqQHTbDyLEFMGAudMq12uKxNV9 xHKb8wh5iUXQpEXC+hPE7goFeeHwU+0RQ6Bk5PQ6nZoTITmNfENMBXbruJzUQzjh2YLlxG YAKks09LhU3UInuNYehCuTqge2WIF/YiWboturqFcJrgoWHiKb++TaYj9WJoYudB/zaAly 9Q1BAaomGXF5wNRRXmP8lCxWDt+f0h8zuP4wKTRdK9KUsDCJd3vyZFs+HADUBQj/b9b4FD Qwv1C0X1QyqBhBJ6FL4jcdlDhMRwktKxXkUaO9C8+n6jhyG42gwfHUAvlreR2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g0cRH6Wrqz13KK for ; Tue, 21 Apr 2026 22:27:07 +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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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;