linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Wang <wangyun@linux.vnet.ibm.com>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: mingo@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sched: update_top_cache_domain only at the times of building sched domain.
Date: Wed, 24 Jul 2013 16:34:39 +0800	[thread overview]
Message-ID: <51EF919F.2000706@linux.vnet.ibm.com> (raw)
In-Reply-To: <CADZ9YHiJ4MYFkWqikKu0qHOsBYGEPYvC2JL5wE3iCUH6vTMKcA@mail.gmail.com>

On 07/24/2013 04:01 PM, Rakib Mullick wrote:
> On Wed, Jul 24, 2013 at 9:26 AM, Michael Wang
> <wangyun@linux.vnet.ibm.com> wrote:
>> Hi, Rakib
>>
>> On 07/24/2013 01:42 AM, Rakib Mullick wrote:
>>> Currently, update_top_cache_domain() is called whenever schedule domain is built or destroyed. But, the following
>>> callpath shows that they're at the same callpath and can be avoided update_top_cache_domain() while destroying schedule
>>> domain and update only at the times of building schedule domains.
>>>
>>>       partition_sched_domains()
>>>               detach_destroy_domain()
>>>                       cpu_attach_domain()
>>>                               update_top_cache_domain()
>>
>> IMHO, cpu_attach_domain() and update_top_cache_domain() should be
>> paired, below patch will open a window which 'rq->sd == NULL' while
>> 'sd_llc != NULL', isn't it?
>>
>> I don't think we have the promise that before we rebuild the stuff
>> correctly, no one will utilize 'sd_llc'...
>>
> I never said it. My point is different.  partition_sched_domain works as -
> 
> 	- destroying existing schedule domain (if previous domain and new
> domain aren't same)
> 	- building new partition
> 
> while doing the first it needs to detach all the cpus on that domain.
> By detaching what it does,
> it fall backs to it's root default domain. In this context (which i've
> proposed to skip), by means
> of updating top cache domain it takes the highest flag domain to setup
> it's sd_llc_id or cpu itself.
> 
> Whatever done above gets overwritten (updating top cache domain),
> while building new partition.
> Then, why we did that before? Hope you understand my point.

I think you missed this in PeterZ's suggestion:

-               cpu_attach_domain(NULL, &def_root_domain, i);

With this change, it will be safe since you will still get an un-freed
sd, although it's an old one.

But your patch will run the risk to get a freed sd, since you make
'sd_llc' wrong for a period of time (between destroy and rebuild) IMO.

I guess I get you point, you are trying to save one time update since
you think this will be done twice, but actually the result of this two
time update was different, it's not redo and it's in order to sync
'sd_llc' with 'rq->sd'.

Regards,
Michael Wang


> 
> Thanks,
> Rakib.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


  reply	other threads:[~2013-07-24  8:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 17:42 [PATCH v2] sched: update_top_cache_domain only at the times of building sched domain Rakib Mullick
2013-07-24  3:26 ` Michael Wang
2013-07-24  8:01   ` Rakib Mullick
2013-07-24  8:34     ` Michael Wang [this message]
2013-07-24 10:49       ` Peter Zijlstra
2013-07-25  2:49         ` Michael Wang
2013-07-24 13:57       ` Rakib Mullick
2013-07-25  3:15         ` Michael Wang

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=51EF919F.2000706@linux.vnet.ibm.com \
    --to=wangyun@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rakib.mullick@gmail.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;
as well as URLs for NNTP newsgroup(s).