mbox series

[v3,0/3] bootconfig: Fixes to bootconfig memory management

Message ID 163171196689.590070.15063104707696447188.stgit@devnote2 (mailing list archive)
Headers show
Series bootconfig: Fixes to bootconfig memory management | expand

Message

Masami Hiramatsu (Google) Sept. 15, 2021, 1:19 p.m. UTC
Hello,

Here are the series of patches to fix bootconfig memory management issues.
In this version, I removed unneeded patches and add a patch to free xbc_data
in xbc_destroy_all().

But still I'm thinking how I can move lib/bootconfig.c and bootconfig.h
to share with tools, because those functions/data are __init and __initdata.
At least I have to add a dummy macro for those in userspace.
Thus the tools/bootconfig build error is still there. I'll fix that in
another series.

Thank you,

---

Masami Hiramatsu (3):
      bootconfig: init: Fix memblock leak in xbc_make_cmdline()
      bootconfig: init: Fix memblock leak in setup_boot_config()
      bootconfig: Free xbc_data in xbc_destroy_all()


 init/main.c      |    2 ++
 lib/bootconfig.c |    3 +++
 2 files changed, 5 insertions(+)

Comments

Linus Torvalds Sept. 15, 2021, 4:47 p.m. UTC | #1
On Wed, Sep 15, 2021 at 6:19 AM Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> But still I'm thinking how I can move lib/bootconfig.c and bootconfig.h

So having slept on it, I think the solution for now is "it's been a
problem only this once, let's ignore it for now"

IOW, I'll apply your trivial fixup for the bootconfig copy of
memblock.h, and forget about it, and then if we end up having more
problems with it later, we can look at a bigger fix.

          Linus
Linus Torvalds Sept. 15, 2021, 4:51 p.m. UTC | #2
On Wed, Sep 15, 2021 at 9:47 AM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> IOW, I'll apply your trivial fixup for the bootconfig copy of
> memblock.h, and forget about it, and then if we end up having more
> problems with it later, we can look at a bigger fix.

Just to clarify - I applied that build fix directly to my tree, but
this series of leak fixes I'll leave for the tracing tree.

             Linus
Masami Hiramatsu (Google) Sept. 16, 2021, 12:07 a.m. UTC | #3
On Wed, 15 Sep 2021 09:51:15 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, Sep 15, 2021 at 9:47 AM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > IOW, I'll apply your trivial fixup for the bootconfig copy of
> > memblock.h, and forget about it, and then if we end up having more
> > problems with it later, we can look at a bigger fix.

Thanks, and OK, I'll try to solve this issue.

> 
> Just to clarify - I applied that build fix directly to my tree, but
> this series of leak fixes I'll leave for the tracing tree.

OK, I got it.


Thank you,

> 
>              Linus