Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4235349rdb; Mon, 11 Dec 2023 12:51:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEO0Mt3BeOXyLxP7TzAktzXYo45Nwy71f7F/N6yseF/bW/45Qu4AeIpDhjdUIKh13byeipt X-Received: by 2002:a05:6a00:1ac7:b0:6cb:bb92:1ce6 with SMTP id f7-20020a056a001ac700b006cbbb921ce6mr5346778pfv.18.1702327899527; Mon, 11 Dec 2023 12:51:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702327899; cv=none; d=google.com; s=arc-20160816; b=waXJ599DXAZkzjubJ9Auv9J4wqp6JoquuElqSewz8kbsL2hoAaynn2g3lyBsOj0VAT +Hne6gKCpbTfHKdnluveRBPE3MlfWfYcQmkEmw9WW0arxvd2T4ryMH6aOpqmBRCpxZuo mAR5Ux1sHgIfJNqh5fZ+Yg7Ty9q2oEopQGzcOThPnE3UXVetF+axxVNCsdvwRyw4sYmm F5bp4N1xvVjNcOqc2tk22httYhTIexr1D29wqC7uY5XxyPjkT9shIonF1SP0KDLOXxIz DRJq0c5MIyQBqkuZqdCNOwqoFkWse5h9FgMTGLUzbNXnMaacsDyysH5FnoUEpl9aor/2 Xv8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=nuKB0tiRMyjq3zqgkwtMyPd6sd/CFmnAl3rOjtlfa4Y=; fh=V/O9sVQdGwCkYVCiyREw29dVErJHqQCcAG2z7EhmTi8=; b=KJuSub5SPL2uTKCdLJjmsTkYkjXB3RpLqnaCgtE+QTgNEqhPzW/udeQEopvEncYMO5 kBp7gL4TZNQ/5il+QhlW9hioMAwVp+x+ctsU/H8XacJabxrH8T1FzLW0w+vOqmtOUE0z diiF6UEl5vL3swPlXAt0SRSzsvLSyMn9EBGefZq9/8zncMSmh/GItHYgNjeNnSIaqAuf P8GW6be3k3HA+VZAHaHxghBzvCPw3kqaQkepUHGKaRqLtiGk3JSVJFFYzQdkpJZE/gcQ XARuCmiSZ/F88kGhwnPagtuKpBQiUb8UJNPOwBW2epmVBqgBxwWyD8vnCBwwI4uB35xz 8kcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HDi7hLG+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id m12-20020a056a00080c00b006cb63c86cc2si6739263pfk.100.2023.12.11.12.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 12:51:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HDi7hLG+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id EA8F4805EB03; Mon, 11 Dec 2023 12:51:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344855AbjLKUvW (ORCPT + 99 others); Mon, 11 Dec 2023 15:51:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344856AbjLKUvV (ORCPT ); Mon, 11 Dec 2023 15:51:21 -0500 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75F8AC8; Mon, 11 Dec 2023 12:51:27 -0800 (PST) Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-67abaab0bc7so30636696d6.2; Mon, 11 Dec 2023 12:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702327886; x=1702932686; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nuKB0tiRMyjq3zqgkwtMyPd6sd/CFmnAl3rOjtlfa4Y=; b=HDi7hLG+u6hDrNOY6XNQhn3+iN0yMIj5GhkNHNOyTOaKDH0H4kevLMhUnvqUAqyfSr g5OIqyEM39TJZHMft5DdYqZgK73AZtW2KKHcP2AqhwVDMhjq+PAj/psKcBJjhYPyaaMm lFo4dUp68Lpd4UaT++5aOa8uPYARlB/3OggWTrJ3+jdDO+1xNBXLfyLu0IDlo+MYJoZS zIGy3Idlb2BuVg3eSnV0CUdsfXp2zq5H6NQSB9oLCYarvkvviMxh0SpVPlgEqg3drEjF Oigh5Mcddod0pmioZSKkY3W8nYbd44se6g9sSdOF4077NM17CcxTXmask6wMh4u9G6kX SODQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702327886; x=1702932686; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nuKB0tiRMyjq3zqgkwtMyPd6sd/CFmnAl3rOjtlfa4Y=; b=UhZGUAeZQAx+B9tRgtKAMlG50s5FtWbxXG3honBf65dbPwwaMzwRKwp5WGJxVvF3qN HHNnfwlpGCF8HAfDtpLnptV9w4izlBI9SBaTCVA1gFgXsVPumszM6EsHeXKMlAoEmvNm ptgPqs2hDJngDonlWAjSoSEnAaFUG2dea5Qv0fjs+poOaV42kv6INqpnhTFpF7a4eYzv nnlZKsWbO/Gn8L9h6kd6xoOLkOP5qwkT6TkodfpoRi+lOyy3CVVROk7U8s0PhRREP6+5 arhgXCiTNqrI+X4cc5s8GJZR6edxm1srhaoah20S7FGaSs0zo3exiUqRDHiFebMOlSvf UNaQ== X-Gm-Message-State: AOJu0YzHJ+HMcuSXYQxslkT+QXNAludms8goILjWVhsL0kHnuKIuxidl VcRBY/6tc0f+qRvF/nUqb/G/XIRMb4lnpknuGYc= X-Received: by 2002:a0c:d684:0:b0:67a:a721:9ecc with SMTP id k4-20020a0cd684000000b0067aa7219eccmr5100260qvi.125.1702327886385; Mon, 11 Dec 2023 12:51:26 -0800 (PST) MIME-Version: 1.0 References: <20231205-libstringheader-v1-1-7f9c573053a7@gmail.com> <20231205130449.8e330a26ecbed1f7b5ad5d7a@linux-foundation.org> <20231205132452.418722bea8f6878dca88142a@linux-foundation.org> <20231205214359.GF1674809@ZenIV> In-Reply-To: From: Andy Shevchenko Date: Mon, 11 Dec 2023 22:50:49 +0200 Message-ID: Subject: Re: [PATCH] lib/string: shrink lib/string.i via IWYU To: Nick Desaulniers Cc: Al Viro , Greg KH , Andrew Morton , tanzirh@google.com, Kees Cook , Andy Shevchenko , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Christoph Hellwig Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 11 Dec 2023 12:51:37 -0800 (PST) On Mon, Dec 11, 2023 at 10:48=E2=80=AFPM Nick Desaulniers wrote: > On Tue, Dec 5, 2023 at 1:44=E2=80=AFPM Al Viro = wrote: > > On Tue, Dec 05, 2023 at 01:39:47PM -0800, Nick Desaulniers wrote: > > > > > The tooling Tanzir is working on does wrap IWYU, and does support suc= h > > > mapping (of 'low level' to 'high level' headers; more so, if it > > > recommends X you can override to suggest Y instead). > > > > > > arch/nios/ also doesn't provide a bug.h, which this patch is > > > suggesting we include directly. I guess the same goes for > > > asm/rwonce.h. > > > > See include/asm-generic/Kbuild: > > mandatory-y +=3D bug.h > > ... > > mandatory-y +=3D rwonce.h > > > > IOW, sh will have asm/bug.h and as/rwonce.h copied from asm-generic. > > > > Still, includes of asm/*.h had been a massive headache historically > > and breeding more of those shouldn't be overdone. > > > > More painful problem is arch- and config-dependent stuff, though... > > Ah, it looks like include/uapi/asm-generic/Kbuild also makes use of > this pattern using mandatory-y. > > So I think we can handle this as a two step translation. We can tell > the tooling to 'nevermind recommending X, always replace > recommendations for X with Y ', so: > 1. any recommendation to use asm-generic/foo.h should be replaced with > asm/foo.h (always, based on those 2 Kbuild files, could autogenerate) > 2. some recommendations to use asm/foo.h should be replaced with > linux/foo.h (not necessarily codified anywhere; depends on if there is > a linux/foo.h, will manually curate this list for now) > > Orthogonal but some places in tree can be cleaned up to include > linux/foo.h rather than asm/foo.h. > > Does this sound like an improvement to my mental model of the > conventions used for kernel header inclusion within the linux kernel? > > Tanzir nearly has the above done (for 1, 2 we will probably need to > iterate on more). We've also beefed up our local testing to test more > architectures. I expect Tanzir to send a v2 of this patch (as a > series, with the fix for ARCH=3Dsh) later this week, if the above seems > correct. Whatever you choose, please make sure it gets documented, so we won't go another round in the future for something similar. --=20 With Best Regards, Andy Shevchenko