From nobody Wed Jan 04 00:52:26 2023 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 4Nmrfm5ybNz2pL2n; Wed, 4 Jan 2023 00:52:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nmrfm3jjzz3lyW; Wed, 4 Jan 2023 00:52:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1036.google.com with SMTP id fz16-20020a17090b025000b002269d6c2d83so192810pjb.0; Tue, 03 Jan 2023 16:52:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=stvYjI3Oh1GqhXIS3dh8yJAosJY+YosNK2Xk6HDC0FM=; b=AIqDbe1Ns6RZbYwNnFBOq5jOo/kdxSfra9Od0KzCmgXH0i4yEyZ900KWQ+iBTNSCIJ 0Rvx8uwFcL0WjxG/ZXKqNrxKSd2Rb+poqkWWhM8iOu73/1og0UVZZVQ6AFeBHjdC64PO j+mbZ4ojQvUbtknZBfyP3Odzmhv0nmwzZdeJKDvaIjzKhckY0rhWCvJjCwII/t+0TdkE i/kssL8GYRpeR38wXcaLkSwZntR+B29NYXpWEKG9ugmt33MweRXxIz5s88Oev5ZDaAhc XiKBVh/aCoIS19BrQjqaKkrx7BvQGhC708gBdBbPfyDygQwdcCZBPwgU6FFWmjnhKnqv fh4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=stvYjI3Oh1GqhXIS3dh8yJAosJY+YosNK2Xk6HDC0FM=; b=Kpb+hBc4Z9QJfvHgq0NKoWMesOJRFixiUvK8oXi/I9qUP793EnvMIKYxyPJWfKSZ3v bWkVmXPROM/Hn99iSYFfgLu5Q0H5VP0U7dcoSzTHWQ0KliftWF8eWUbE8MG9zPDuRkmw ZpBVW6BlUYL5nTsoW67gggRD2Jb82hPBko6OSNzHx16+18gTzU7ZangaEjwnoawCQrJZ tAnBfi7K3GHhfGMc9UU4mSC8RiPUvyzTcVf01uR8oXjFOVRR4pvL+C6XjwDHoq57KB7M gE63Rvsv3TN/DqcQTa4sp6mFINt9HLV+Jb4Nb4SNL7DVdC7UZx1N6S5fHeOYQIP3uI8O +dTg== X-Gm-Message-State: AFqh2kpr/EMBaCg/Z2L7SzUZOtrOCPPTWycBZPFMUl/KTzKr7zK8MZ1p kioY8MUy7garBIT6Zg65Utk= X-Google-Smtp-Source: AMrXdXujRjn8QbW0mED+CyloOUo7SpNYtlYt0ZukL7m4XInxqjmFvmJ3R5cV8X1kcHB3IEcpMOcy+Q== X-Received: by 2002:a17:902:ccd0:b0:189:6ab3:9e57 with SMTP id z16-20020a170902ccd000b001896ab39e57mr51448224ple.22.1672793550512; Tue, 03 Jan 2023 16:52:30 -0800 (PST) Received: from framework (36-239-240-131.dynamic-ip.hinet.net. [36.239.240.131]) by smtp.gmail.com with ESMTPSA id l2-20020a170902f68200b00177faf558b5sm22782815plg.250.2023.01.03.16.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 16:52:29 -0800 (PST) Date: Tue, 3 Jan 2023 19:52:26 -0500 From: Mark Johnston To: Konstantin Belousov Cc: Mateusz Guzik , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 68912701700c - main - ffs_suspend.c: clean up includes Message-ID: References: <202212292056.2BTKuOIu047460@gitrepo.freebsd.org> 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4Nmrfm3jjzz3lyW X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, Jan 03, 2023 at 01:53:27PM +0200, Konstantin Belousov wrote: > On Mon, Jan 02, 2023 at 06:29:57PM +0100, Mateusz Guzik wrote: > > On 12/29/22, Konstantin Belousov wrote: > > > The branch main has been updated by kib: > > > > > > URL: > > > https://cgit.FreeBSD.org/src/commit/?id=68912701700ca3230f3e2d4b7858a038f884a327 > > > > > > commit 68912701700ca3230f3e2d4b7858a038f884a327 > > > Author: Konstantin Belousov > > > AuthorDate: 2022-12-28 18:17:53 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2022-12-29 20:55:39 +0000 > > > > > > ffs_suspend.c: clean up includes > > > > > > Order includes alphabetically. > > > Remove unneeded sys/param.h, it is already included by sys/systm.h. > > > > > > Reviewed by: mckusick > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D37896 > > > --- > > > sys/ufs/ffs/ffs_suspend.c | 7 +++---- > > > 1 file changed, 3 insertions(+), 4 deletions(-) > > > > > > diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c > > > index d13097109758..e7c976b6e921 100644 > > > --- a/sys/ufs/ffs/ffs_suspend.c > > > +++ b/sys/ufs/ffs/ffs_suspend.c > > > @@ -33,15 +33,14 @@ > > > #include > > > __FBSDID("$FreeBSD$"); > > > > > > -#include > > > #include > > > #include > > > -#include > > > -#include > > > -#include > > > #include > > > +#include > > > #include > > > +#include > > > #include > > > +#include > > > > > > #include > > > > > > > > > > tinderbox fails the KCSAN et al kernels: > > > > In file included from /usr/src/sys/ufs/ffs/ffs_suspend.c:36: > > In file included from /usr/src/sys/sys/systm.h:44: > > In file included from ./machine/atomic.h:73: > > /usr/src/sys/sys/atomic_san.h:117:24: error: unknown type name 'uint8_t' > > ATOMIC_SAN_FUNCS(char, uint8_t); > > ^ > > it bisects to this commit > > > So the problem is that sys/systm.h includes machine/atomic.h which always > had the pre-requisite sys/types.h, and this is documented in atomic(9). > But sys/atomic_san.h uses C89 types in prototypes, not just macros, and > this breaks for real. > > I can > 1. Just add sys/types.h to ufs_suspend.c (I prefer not) > 2. Add sys/types.h to sys/atomic_san.h. > 3. Add sys/types.h to sys/systm.h. > > IMO #2 is not the best solution, since it pollutes systm.h only sometimes, > when the right kernel options are used. All machine/atomic.h include atomic_common.h, which includes sys/types.h. Admittedly this inlcude was added quite recently, but it means that systm.h is always polluted, so it seems reasonable to me. > I would prefer #3, it seems, but > want to ensure that there is a consensus about the addition to sys/systm.h. As Mike notes, systm.h already includes param.h, but it happens too late. Most of systm.h is _KERNEL-only, so I can't see why the includes at the beginning are unguarded. Does userspace (or the boot loader) rely on systm.h for anything? Perhaps we should guard the whole file with _KERNEL and put includes in the right order. That would also solve the problem.