[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <66f5abd431dce_964f2294b9@dwillia2-xfh.jf.intel.com.notmuch>
Date: Thu, 26 Sep 2024 11:45:40 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: "Huang, Ying" <ying.huang@...el.com>, Geert Uytterhoeven
<geert@...ux-m68k.org>, Dan Williams <dan.j.williams@...el.com>
CC: Guenter Roeck <linux@...ck-us.net>, Andrew Morton
<akpm@...ux-foundation.org>, <linux-kernel@...r.kernel.org>, Linus Torvalds
<torvalds@...ux-foundation.org>
Subject: Re: [PATCH] resource, kunit: add dependency on SPARSEMEM
Huang, Ying wrote:
> Geert Uytterhoeven <geert@...ux-m68k.org> writes:
>
> > Hi Huang,
> >
> > On Tue, Sep 24, 2024 at 3:25 AM Huang, Ying <ying.huang@...el.com> wrote:
> >> Guenter Roeck <linux@...ck-us.net> writes:
> >> > On 9/23/24 05:58, Geert Uytterhoeven wrote:
> >> >> Hi Günter,
> >> >> On Mon, Sep 23, 2024 at 12:50 AM Guenter Roeck <linux@...ck-us.net>
> >> >> wrote:
> >> >>> Building allmodconfig images on systems with SPARSEMEM=n results in
> >> >>> the following message.
> >> >>>
> >> >>> WARNING: unmet direct dependencies detected for GET_FREE_REGION
> >> >>> Depends on [n]: SPARSEMEM [=n]
> >> >>> Selected by [m]:
> >> >>> - RESOURCE_KUNIT_TEST [=m] && RUNTIME_TESTING_MENU [=y] && KUNIT [=m]
> >
> >> After Linus' fix for PHYSMEM_END, GET_FREE_REGION doesn't need to depend
> >> on SPARSEMEM anymore. So, I think we can remove the dependency. Can
> >> you check whether the following patch work for you on top of latest
> >> upstream kernel (with Linus' fix).
> >
> > Yes it does, thanks!
> >
> > One remaining issue is that RESOURCE_KUNIT_TEST selects GET_FREE_REGION.
> > IMHO merely enabling a test should not enable extra functionality
> > in the kernel. Can the individual test(s) that do depend on
> > GET_FREE_REGION be protected by #ifdef CONFIG_GET_FREE_REGION instead?
>
> After checking GET_FREE_REGION, I don't think that it's a special
> functionality. I guess it's selectable because it depends on SPARSEMEM
> and to reduce code size.
>
> Hi, Dan, please correct me if I'm wrong here.
Right, the only reason it is selectable is just to be mindful is
micro-bloat in kernel/resource.c for the small number of drivers that
need that call.
> So, to reduce #ifdef in .c file as much as possible and make code
> simpler, I prefer to select it for RESOURCE_KUNIT_TEST.
I agree with the result, but for a different rationale.
RESOURCE_KUNIT_TEST is simply another "driver" that needs
GET_FREE_REGION. So while I agree with the general idea that "enabling a
test should not enable extra functionality", in this case the *test* is
the extra functionality and GET_FREE_REGION comes along for the ride.
Powered by blists - more mailing lists