public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Major Chen <major.chen@samsung.com>, stable <stable@kernel.org>,
	Kuyo Chang <kuyo.chang@mediatek.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <vschneid@redhat.com>,
	Matthias Brugger <matthias.bgg@gmail.com>
Subject: Re: [PATCH 2/2] sched/debug: fix dentry leak in update_sched_domain_debugfs
Date: Fri, 2 Sep 2022 14:46:44 +0200	[thread overview]
Message-ID: <YxH7NIe0Inz2V6sH@kroah.com> (raw)
In-Reply-To: <20220902123107.109274-2-gregkh@linuxfoundation.org>

On Fri, Sep 02, 2022 at 02:31:07PM +0200, Greg Kroah-Hartman wrote:
> Kuyo reports that the pattern of using debugfs_remove(debugfs_lookup())
> leaks a dentry and with a hotplug stress test, the machine eventually
> runs out of memory.
> 
> Fix this up by using the newly created debugfs_lookup_and_remove() call
> instead which properly handles the dentry reference counting logic.
> 
> Cc: Major Chen <major.chen@samsung.com>
> Cc: stable <stable@kernel.org>
> Reported-by: Kuyo Chang <kuyo.chang@mediatek.com>
> Tested-by: Kuyo Chang <kuyo.chang@mediatek.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Juri Lelli <juri.lelli@redhat.com>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ben Segall <bsegall@google.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
> Cc: Valentin Schneider <vschneid@redhat.com>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  kernel/sched/debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

As this needs patch 1/2 to work properly, and Kuyo has tested this out
already, I'll take both of them through my driver core git tree to Linus
so that we can start getting the other debugfs_lookup() leaks fixed up
as well.

thanks,

greg k-h

  reply	other threads:[~2022-09-02 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02 12:31 [PATCH 1/2] debugfs: add debugfs_lookup_and_remove() Greg Kroah-Hartman
2022-09-02 12:31 ` [PATCH 2/2] sched/debug: fix dentry leak in update_sched_domain_debugfs Greg Kroah-Hartman
2022-09-02 12:46   ` Greg Kroah-Hartman [this message]
2022-09-02 12:59   ` Peter Zijlstra
2022-09-02 14:59 ` [PATCH 1/2 v2] debugfs: add debugfs_lookup_and_remove() Greg Kroah-Hartman

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=YxH7NIe0Inz2V6sH@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kuyo.chang@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=major.chen@samsung.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /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