LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Gregory Haskins" <ghaskins@novell.com>
To: <dwalker@mvista.com>
Cc: "Ingo Molnar" <mingo@elte.hu>,
	"Max Krasnyanskiy" <maxk@qualcomm.com>,
	"LKML" <linux-kernel@vger.kernel.org>,
	<linux-rt-users@vger.kernel.org>
Subject: Re: CPU hotplug and IRQ affinity with 2.6.24-rt1
Date: Tue, 05 Feb 2008 15:03:55 -0700	[thread overview]
Message-ID: <47A896FB.BA47.005A.0@novell.com> (raw)
In-Reply-To: <20080205215805.GD18613@dwalker1.mvista.com>

>>> On Tue, Feb 5, 2008 at  4:58 PM, in message
<20080205215805.GD18613@dwalker1.mvista.com>, Daniel Walker
<dwalker@dwalker1.mvista.com> wrote: 
> On Tue, Feb 05, 2008 at 11:25:18AM -0700, Gregory Haskins wrote:
>> @@ -6241,7 +6242,7 @@ static void rq_attach_root(struct rq *rq, struct 
> root_domain *rd)
>>                 cpu_clear(rq->cpu, old_rd->online);
>> 
>>                 if (atomic_dec_and_test(&old_rd->refcount))
>> -                       kfree(old_rd);
>> +                       reap = old_rd;
> 
> Unrelated to the in atomic issue, I was wondering if this if statement
> isn't true can the old_rd memory get leaked, or is it cleaned up
> someplace else?

Each RQ always has a reference to one root-domain and is thus represented by the rd->refcount.  When the last RQ drops its reference to a particular instance, we free the structure.  So this is the only place where we clean up, but it should also be the only place we need to (unless I am misunderstanding you?)

Note that there is one exception: the default root-domain is never freed, which is why we initialize it with a refcount = 1.  So it is theoretically possible to have this particular root-domain dangling with no RQs associated with it, but that is by design. 

Regards,
-Greg


  reply	other threads:[~2008-02-05 22:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-04 23:35 Max Krasnyanskiy
2008-02-05  2:51 ` Daniel Walker
2008-02-05  3:27   ` Gregory Haskins
2008-02-05  4:21   ` Max Krasnyansky
2008-02-05  5:02   ` Gregory Haskins
2008-02-05 16:59     ` Daniel Walker
2008-02-05 17:13       ` Gregory Haskins
2008-02-05 18:25       ` Gregory Haskins
2008-02-05 21:58         ` Daniel Walker
2008-02-05 22:03           ` Gregory Haskins [this message]
2008-02-05 14:00   ` Gregory Haskins

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=47A896FB.BA47.005A.0@novell.com \
    --to=ghaskins@novell.com \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=maxk@qualcomm.com \
    --cc=mingo@elte.hu \
    --subject='Re: CPU hotplug and IRQ affinity with 2.6.24-rt1' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).