mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Breno Leitao <leitao@debian.org>, 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>,
	Valentin Schneider <vschneid@redhat.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched/topology: don't claim sched_domain_shared twice on the same domain
Date: Mon, 30 Nov 2026 10:07:50 +0530	[thread overview]
Message-ID: <ba8ca63d-c8db-4922-9cb7-480d2958cbb9@amd.com> (raw)
In-Reply-To: <20260810-b4-sched_shared_leak-v1-1-3eacd249d0a3@debian.org>

Hello Breno,

On 8/10/2026 5:16 PM, Breno Leitao wrote:
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 5a29e506c25d5..206552d51ce2e 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -3169,7 +3169,13 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att
>  			sd = sd->parent;
>  
>  		if (sd->flags & SD_SHARE_LLC) {
> -			init_sched_domain_shared(&d, sd, SD_SHARE_LLC);
> +			/*
> +			 * The asym path above may have claimed a shared object
> +			 * on this very domain; claiming it again overwrites
> +			 * sd->shared and leaks the first reference.
> +			 */
> +			if (!sd->shared)
> +				init_sched_domain_shared(&d, sd, SD_SHARE_LLC);

I would prefer pushing that as an early return into
init_sched_domain_shared() but this works too. Feel free to include:

Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>

P.S. I think you should also add a
Closes: https://lore.kernel.org/lkml/akeMbyZGmbjWSZqp@gmail.com/
for the record.

>  
>  			/*
>  			 * In presence of higher domains, adjust the
> 
> ---

-- 
Thanks and Regards,
Prateek


      parent reply	other threads:[~2026-11-30  4:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 11:46 Breno Leitao
2026-11-26 11:46 ` André Draszik
2026-11-26 15:41 ` [tip: sched/urgent] sched/topology: Don't " tip-bot2 for Breno Leitao
2026-11-30  4:37 ` K Prateek Nayak [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=ba8ca63d-c8db-4922-9cb7-480d2958cbb9@amd.com \
    --to=kprateek.nayak@amd.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®