mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Pierre Gondois <pierre.gondois@arm.com>
Cc: linux-kernel@vger.kernel.org, Rob.Herring@arm.com,
	sudeep.holla@arm.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH -next] cacheinfo: Remove of_node_put() for fw_token
Date: Wed, 16 Nov 2022 09:03:41 +0100	[thread overview]
Message-ID: <CAMuHMdWB_PZAL7dgWfYVVBQL2tkb92bg_tuvxeGrWFbGQD9fNw@mail.gmail.com> (raw)
In-Reply-To: <20221115220520.2076189-1-pierre.gondois@arm.com>

On Tue, Nov 15, 2022 at 11:06 PM Pierre Gondois <pierre.gondois@arm.com> wrote:
> fw_token is used for DT/ACPI systems to identify CPUs sharing caches.
> For DT based systems, fw_token is set to a pointer to a DT node.
>
> commit ("cacheinfo: Decrement refcount in cache_setup_of_node()")
> doesn't increment the refcount of fw_token anymore in
> cache_setup_of_node(). fw_token is indeed used as a token and not
> as a (struct device_node*), so no reference to fw_token should be
> kept.
>
> However, [1] is triggered when hotplugging a CPU multiple times
> since cache_shared_cpu_map_remove() decrements the refcount to
> fw_token at each CPU unplugging, eventually reaching 0.
>
> Remove of_node_put() for fw_token in cache_shared_cpu_map_remove().
>
> [1]
> [   53.651182] ------------[ cut here ]------------
> [   53.651186] refcount_t: saturated; leaking memory.
> [   53.651223] WARNING: CPU: 4 PID: 32 at lib/refcount.c:22 refcount_warn_saturate (lib/refcount.c:22 (discriminator 3))
> [   53.651241] Modules linked in:
> [   53.651249] CPU: 4 PID: 32 Comm: cpuhp/4 Tainted: G        W          6.1.0-rc1-14091-g9fdf2ca7b9c8 #76
> [   53.651261] Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Oct 31 2022
> [   53.651268] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> [   53.651279] pc : refcount_warn_saturate (lib/refcount.c:22 (discriminator 3))
> [   53.651293] lr : refcount_warn_saturate (lib/refcount.c:22 (discriminator 3))
> [...]
> [   53.651513] Call trace:
> [...]
> [   53.651735] of_node_release (drivers/of/dynamic.c:335)
> [   53.651750] kobject_put (lib/kobject.c:677 lib/kobject.c:704 ./include/linux/kref.h:65 lib/kobject.c:721)
> [   53.651762] of_node_put (drivers/of/dynamic.c:49)
> [   53.651776] free_cache_attributes.part.0 (drivers/base/cacheinfo.c:712)
> [   53.651792] cacheinfo_cpu_pre_down (drivers/base/cacheinfo.c:718)
> [   53.651807] cpuhp_invoke_callback (kernel/cpu.c:247 (discriminator 4))
> [   53.651819] cpuhp_thread_fun (kernel/cpu.c:785)
> [   53.651832] smpboot_thread_fn (kernel/smpboot.c:164 (discriminator 3))
> [   53.651847] kthread (kernel/kthread.c:376)
> [   53.651858] ret_from_fork (arch/arm64/kernel/entry.S:861)
> [   53.651869] ---[ end trace 0000000000000000 ]---
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>

Thanks, this fixes the issue for me!

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

      parent reply	other threads:[~2022-11-16  8:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 22:05 Pierre Gondois
2022-11-16  7:26 ` Sudeep Holla
2022-11-16  8:03 ` Geert Uytterhoeven [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=CAMuHMdWB_PZAL7dgWfYVVBQL2tkb92bg_tuvxeGrWFbGQD9fNw@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=Rob.Herring@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pierre.gondois@arm.com \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.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

all inboxes | Powered by JetHome®