All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Cowan <ian@linux.cowan.aero>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	cl@linux.com, penberg@kernel.org, rientjes@google.com,
	iamjoonsoo.kim@lge.com, roman.gushchin@linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: include: linux: slab: kmalloc_trace undefined when compiling drivers
Date: Mon, 14 Nov 2022 16:28:07 -0500	[thread overview]
Message-ID: <Y3Ky54xVZdY2IT9L@rhino> (raw)
In-Reply-To: <5dc7529d-9edf-4ea7-35d3-a5f3dc55dd5c@suse.cz>

On Mon, Nov 14, 2022 at 05:56:25PM +0100, Vlastimil Babka wrote:
> On 11/14/22 13:39, Ian Cowan wrote:
> > On Mon, Nov 14, 2022 at 05:59:06PM +0900, Hyeonggon Yoo wrote:
> >> On Sat, Nov 12, 2022 at 08:21:14PM -0500, Ian Cowan wrote:
> >> > On Sat, Nov 12, 2022 at 05:11:27PM -0800, Randy Dunlap wrote:
> >> > > 
> >> > > 
> >> > > On 11/12/22 16:43, Ian Cowan wrote:
> >> > > > On Sat, Nov 12, 2022 at 04:34:18PM -0800, Randy Dunlap wrote:
> >> > > >>
> >> > > >>
> >> > > >> On 11/12/22 13:59, Ian Cowan wrote:
> >> > > >>> On Sat, Nov 12, 2022 at 09:21:34AM -0800, Randy Dunlap wrote:
> >> > > >>>> Hi--
> >> > > >>>>
> >> > > >>>> On 11/12/22 08:37, Ian Cowan wrote:
> >> > > >>>>> When compiling drivers (speficially drivers/pci/hotplug), I am receiving
> >> > > >>>>> the following modpost error for both `kmalloc_trace` and
> >> > > >>>>> `kmalloc_node_trace` on the staging/staging-next branch:
> >> > > >>>>>
> >> > > >>
> >> > > >> Ian, what do you mean by "on the staging/staging-next branch"?
> >> > > >>
> >> > > >> What kernel version are you trying to build?
> >> > > >>
> >> > > >> The .config that you sent is for v6.1.0-rc1.
> >> > > > 
> >> > > > I am building from the staging repository (gregkh/staging) and my
> >> > > > working branch when building is staging-next. So I am trying to build
> >> > > > from staging and not a particular version. I have also run `make modules_prepare`
> >> > > > and updated the .config per that script. However, when I do build
> >> > > > v6.1.0-rc1 from the main repository (torvalds/linux), I run into the same problem.
> >> > > 
> >> > > Have you built the entire kernel already and then you are trying to build
> >> > > only drivers/pci/hotplug?
> >> > Yes, I did build the entire kernel already and then I'm just trying to
> >> > rebuild that module.
> >> > 
> >> > In `include/linux/slab.h` if I remove the lines between `#ifdef
> >> > CONFIG_TRACING` and `#else` (lines 473-480) and then the corresponding
> >> > `#endif` and leave lines 481-499, I'm able to compile that module
> >> > without issue.
> >> 
> >> I don't get what the problem is.
> >> In case kmalloc[_node]_trace() is undefined, it's replaced with kmem_cache_alloc[_node]. 
> >> 
> >> Is the kernel built with same config on tree?
> > 
> > Yes, the same config on tree with no errors or warnings. I was able to
> > trace it back to this commit - building on the commit immediately prior
> > builds without error or warning. It looks like this commit does some
> > refactoring of the kmem_cache_alloc[_node] and kmalloc[_node]_trace.
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?h=staging-next&id=26a40990ba052
> 
> Wonder if you have a stale mm/slab_common.o because for some reason it's not
> being recompiled (a file timestamp in the future?)
> Can you rm it and rebuild? And maybe also mm/built-in.a
> Or maybe a full make clean and/or a fresh checkout.
> 

I pulled a fresh checkout and rebuilt everything and it was fixed after
that. Thanks for your help!


      reply	other threads:[~2022-11-14 21:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12 16:37 include: linux: slab: kmalloc_trace undefined when compiling drivers Ian Cowan
2022-11-12 17:21 ` Randy Dunlap
2022-11-12 21:59   ` Ian Cowan
2022-11-13  0:34     ` Randy Dunlap
2022-11-13  0:43       ` Ian Cowan
2022-11-13  1:11         ` Randy Dunlap
2022-11-13  1:21           ` Ian Cowan
2022-11-14  8:59             ` Hyeonggon Yoo
2022-11-14 12:39               ` Ian Cowan
2022-11-14 16:56                 ` Vlastimil Babka
2022-11-14 21:28                   ` Ian Cowan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y3Ky54xVZdY2IT9L@rhino \
    --to=ian@linux.cowan.aero \
    --cc=42.hyeyoo@gmail.com \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.