Message ID | 20231017143408.2876181-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4178182vqb; Tue, 17 Oct 2023 07:34:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTQWrtStDCUMH+Rv+ZSzRTBwfVCcdbXzl+RYyziQ1Y6fDvapKKgQGeMsuYVcqt/Vqj7NwH X-Received: by 2002:a05:6a21:8cc5:b0:15c:b7ba:e9ba with SMTP id ta5-20020a056a218cc500b0015cb7bae9bamr2101177pzb.0.1697553267838; Tue, 17 Oct 2023 07:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697553267; cv=none; d=google.com; s=arc-20160816; b=HXKqKmSzXAYWMC9W61QC0L+6ffeDoVVSF0vCAJTLZmzjlaVWnpWzWKCH2vJGRMYHuG 9ZIkwt1nBOD81RKx4NG8kZAZrLpEiU9JeNz3GihwPWMLiOPf38IaR2sV/60owNQdAY88 qi9Y5/Wnvd52RAa6TiTy6w4hbKwuu5b7I+C6hhvs6QkoLg/XkD1ifbto4xNx05glw+jk 43plp852d5V3E/mhIOL3VkTknnGtXSwVqCT9gi++P4U85b9zoJxwrCy2Al73+zVxtiOG 6Dp+dmFsk/s/Fq1VqcpZt/DPQ65Hn2a6Q7VTwadUZcKwKv/gdAEkSHKnIyIxG4PvOJS3 u+Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=XFkhbcMuzE1RrMvC4jI/IMTTM/oTw/sUXhYkrcPnQVY=; fh=emP0J7Hmy7DUy9iklv6bXzH+ss6aVyHRc4EnkYwxK/8=; b=Eo7wT+vS1TQgy07nGYGsUCuG5kahwMzh1rj3rnFZ83uS35R0e3X/lj7R2o8wAPXWuZ 6bMb2Wyl5u4QqHqd7ALaE+FWN/PH679ZTkFx+XQsvM3WpE0OfwpputLld7ecdliidsPS +uIDV3mU40ZLTHP6yRN3JtMAKyRFOWH12YmRKe+K1fIXMzp1YHYphEKWEFSLlEy3oyri YzlbJkn09n3MsadaYMUKWMTnxcyfkccNAAt4FgphtpL7zDj0c/jb0Q8Z5JG+CO0yGAGi 8Fyv1tVq7J5WG+K1mNMHGf9BhJNDISnckV+ltd2Z957H2XcqTtpJB7UvNlK+V4uLvp+o 833A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="F4ZSSv2/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id z16-20020a656650000000b00578d5a135dasi1873925pgv.891.2023.10.17.07.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="F4ZSSv2/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C486D8031F35; Tue, 17 Oct 2023 07:34:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344012AbjJQOeQ (ORCPT <rfc822;hjfbswb@gmail.com> + 20 others); Tue, 17 Oct 2023 10:34:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234917AbjJQOeP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 17 Oct 2023 10:34:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F1B9A2 for <linux-kernel@vger.kernel.org>; Tue, 17 Oct 2023 07:34:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A5FAC433C8; Tue, 17 Oct 2023 14:34:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697553254; bh=6chpSi2cSFs/mmCxw/PjMVSCy+uwdZlMJRYapzy+Luc=; h=From:To:Cc:Subject:Date:From; b=F4ZSSv2/78hTJu0ofr6DFeZvK5j4SEBNVinMTlcRldItDBIuqBGz1oBMNziBelz/u Bf6jcfKWZht7H9Nlp19X9O8nLpvF1UlAOtAKJuygWX4TSqPNnY6jLCO1qsZ/d7mk5n tDB/RawtoxVzupBFoqLei7/BmWAwVjzo5nh4gUXTpD1ZzG+vHU6uxyL3GHk+cKyDBA MVu3ZBW0xB44gUJ0cAkeY9dNoKCVZAd/aVV0rEXHxeHVhiTqc/3XrsaYFvGGwbYgrj BsI0KyEpP4x5cErkZ9TdHah6RnNVZNt+CvCNJydf9eOtbUiPa/3w63fqWDAJ0NYAAS On4R7yFoqHAdg== From: Arnd Bergmann <arnd@kernel.org> To: Yury Norov <yury.norov@gmail.com>, Jiri Olsa <jolsa@kernel.org>, Song Liu <songliubraving@fb.com>, Alexei Starovoitov <ast@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org Subject: [PATCH] buildid: reduce header file dependencies for module Date: Tue, 17 Oct 2023 16:33:58 +0200 Message-Id: <20231017143408.2876181-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 17 Oct 2023 07:34:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780013615746147788 X-GMAIL-MSGID: 1780013615746147788 |
Series |
buildid: reduce header file dependencies for module
|
|
Commit Message
Arnd Bergmann
Oct. 17, 2023, 2:33 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> The vmlinux decompressor code intentionally has only a limited set of included header files, but this started running into a build failure because of the bitmap logic needing linux/errno.h: In file included from include/linux/cpumask.h:12, from include/linux/mm_types_task.h:14, from include/linux/mm_types.h:5, from include/linux/buildid.h:5, from include/linux/module.h:14, from arch/arm/boot/compressed/../../../../lib/lz4/lz4_decompress.c:39, from arch/arm/boot/compressed/../../../../lib/decompress_unlz4.c:10, from arch/arm/boot/compressed/decompress.c:60: include/linux/bitmap.h: In function 'bitmap_allocate_region': include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared (first use in this function) 527 | return -EBUSY; | ^~~~~ include/linux/bitmap.h:527:25: note: each undeclared identifier is reported only once for each function it appears in include/linux/bitmap.h: In function 'bitmap_find_free_region': include/linux/bitmap.h:554:17: error: 'ENOMEM' undeclared (first use in this function) 554 | return -ENOMEM; | ^~~~~~ This is easily avoided by changing linux/buildid.h to no longer depend on linux/mm_types.h, a header that pulls in a huge number of indirect dependencies. Fixes: b9c957f554442 ("bitmap: move bitmap_*_region() functions to bitmap.h") Fixes: bd7525dacd7e2 ("bpf: Move stack_map_get_build_id into lib") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- include/linux/buildid.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Tue, Oct 17, 2023 at 04:33:58PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The vmlinux decompressor code intentionally has only a limited set of > included header files, but this started running into a build failure > because of the bitmap logic needing linux/errno.h: > > In file included from include/linux/cpumask.h:12, > from include/linux/mm_types_task.h:14, > from include/linux/mm_types.h:5, > from include/linux/buildid.h:5, > from include/linux/module.h:14, > from arch/arm/boot/compressed/../../../../lib/lz4/lz4_decompress.c:39, > from arch/arm/boot/compressed/../../../../lib/decompress_unlz4.c:10, > from arch/arm/boot/compressed/decompress.c:60: > include/linux/bitmap.h: In function 'bitmap_allocate_region': > include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared (first use in this function) > 527 | return -EBUSY; > | ^~~~~ > include/linux/bitmap.h:527:25: note: each undeclared identifier is reported only once for each function it appears in > include/linux/bitmap.h: In function 'bitmap_find_free_region': > include/linux/bitmap.h:554:17: error: 'ENOMEM' undeclared (first use in this function) > 554 | return -ENOMEM; > | ^~~~~~ > > This is easily avoided by changing linux/buildid.h to no longer depend on > linux/mm_types.h, a header that pulls in a huge number of indirect dependencies. > > Fixes: b9c957f554442 ("bitmap: move bitmap_*_region() functions to bitmap.h") > Fixes: bd7525dacd7e2 ("bpf: Move stack_map_get_build_id into lib") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Yury Norov <yury.norov@gmail.com> Would you like me to add this into bitmap-for-next?
On Tue, Oct 17, 2023, at 17:29, Yury Norov wrote: > On Tue, Oct 17, 2023 at 04:33:58PM +0200, Arnd Bergmann wrote: >> >> This is easily avoided by changing linux/buildid.h to no longer depend on >> linux/mm_types.h, a header that pulls in a huge number of indirect dependencies. >> >> Fixes: b9c957f554442 ("bitmap: move bitmap_*_region() functions to bitmap.h") >> Fixes: bd7525dacd7e2 ("bpf: Move stack_map_get_build_id into lib") >> Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > Acked-by: Yury Norov <yury.norov@gmail.com> > > Would you like me to add this into bitmap-for-next? Yes, I think that would be best to avoid the regression. Thanks, Arnd
On Tue, Oct 17, 2023 at 04:33:58PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The vmlinux decompressor code intentionally has only a limited set of > included header files, but this started running into a build failure > because of the bitmap logic needing linux/errno.h: > > In file included from include/linux/cpumask.h:12, > from include/linux/mm_types_task.h:14, > from include/linux/mm_types.h:5, > from include/linux/buildid.h:5, > from include/linux/module.h:14, > from arch/arm/boot/compressed/../../../../lib/lz4/lz4_decompress.c:39, > from arch/arm/boot/compressed/../../../../lib/decompress_unlz4.c:10, > from arch/arm/boot/compressed/decompress.c:60: > include/linux/bitmap.h: In function 'bitmap_allocate_region': > include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared (first use in this function) > 527 | return -EBUSY; > | ^~~~~ > include/linux/bitmap.h:527:25: note: each undeclared identifier is reported only once for each function it appears in > include/linux/bitmap.h: In function 'bitmap_find_free_region': > include/linux/bitmap.h:554:17: error: 'ENOMEM' undeclared (first use in this function) > 554 | return -ENOMEM; > | ^~~~~~ > > This is easily avoided by changing linux/buildid.h to no longer depend on > linux/mm_types.h, a header that pulls in a huge number of indirect dependencies. > > Fixes: b9c957f554442 ("bitmap: move bitmap_*_region() functions to bitmap.h") > Fixes: bd7525dacd7e2 ("bpf: Move stack_map_get_build_id into lib") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > include/linux/buildid.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/linux/buildid.h b/include/linux/buildid.h > index 3b7a0ff4642fd..8a582d242f067 100644 > --- a/include/linux/buildid.h > +++ b/include/linux/buildid.h > @@ -2,10 +2,11 @@ > #ifndef _LINUX_BUILDID_H > #define _LINUX_BUILDID_H > > -#include <linux/mm_types.h> > +#include <linux/types.h> looks good, but I think we should now include <linux/mm_types.h> in lib/buildid.c ? thanks, jirka > > #define BUILD_ID_SIZE_MAX 20 > > +struct vm_area_struct; > int build_id_parse(struct vm_area_struct *vma, unsigned char *build_id, > __u32 *size); > int build_id_parse_buf(const void *buf, unsigned char *build_id, u32 buf_size); > -- > 2.39.2 >
diff --git a/include/linux/buildid.h b/include/linux/buildid.h index 3b7a0ff4642fd..8a582d242f067 100644 --- a/include/linux/buildid.h +++ b/include/linux/buildid.h @@ -2,10 +2,11 @@ #ifndef _LINUX_BUILDID_H #define _LINUX_BUILDID_H -#include <linux/mm_types.h> +#include <linux/types.h> #define BUILD_ID_SIZE_MAX 20 +struct vm_area_struct; int build_id_parse(struct vm_area_struct *vma, unsigned char *build_id, __u32 *size); int build_id_parse_buf(const void *buf, unsigned char *build_id, u32 buf_size);