From: "Christoph Lameter (Ampere)" <cl@gentwo.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
linux-mm@kvack.org
Subject: Re: [RFC PATCH] mm/slab: fix a memory leak on kobject_init_and_add() failure
Date: Tue, 22 Oct 2024 09:08:52 -0700 (PDT) [thread overview]
Message-ID: <7e4978d7-7f93-5d30-bf2a-736b0e1e9ad4@gentwo.org> (raw)
In-Reply-To: <059dead9-51c5-49b9-bbb9-5f3be741c830@suse.cz>
On Tue, 22 Oct 2024, Vlastimil Babka wrote:
> On 10/21/24 18:27, Christoph Lameter (Ampere) wrote:
> > On Mon, 21 Oct 2024, Vlastimil Babka wrote:
> >
> >> I think the comment "If this function returns an error, kobject_put() must
> >> be called" means that *if* you want to destroy it due to the failure, you
> >> must use kobject_put() and not e.g. kfree(). But IMHO it doesn't mean you
> >> must destroy it because of the kobject_add() failure.
> >
> > Right. The simplest solution is to see the sysfs stuff as optional. If it
>
> To clarify, I only meant the case of boot caches processed for sysfs later.
> I don't think we need to start ignoring all sysfs errors.
Well not ignoring. Write something to the syslog. So it wont affect slab
operations. /sys support is not critical to the slab subsystem operations
and is often not used at all.
If its conks out then it should be fixed but it should not impact current
operations. We have had so many issues with sysfs support in the past that
doing so would be wise to avoid future problems.
next prev parent reply other threads:[~2024-10-22 16:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-21 9:14 Hyeonggon Yoo
2024-10-21 10:13 ` Vlastimil Babka
2024-10-21 16:27 ` Christoph Lameter (Ampere)
2024-10-22 15:12 ` Vlastimil Babka
2024-10-22 16:08 ` Christoph Lameter (Ampere) [this message]
2024-10-23 9:23 ` Hyeonggon Yoo
2024-10-23 9:28 ` Vlastimil Babka
2024-10-23 17:12 ` Vlastimil Babka
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=7e4978d7-7f93-5d30-bf2a-736b0e1e9ad4@gentwo.org \
--to=cl@gentwo.org \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox