public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Mike Kravetz <kravetz@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: Re: set_cpus_allowed() optimization
Date: 13 May 2002 16:05:46 -0700	[thread overview]
Message-ID: <1021331147.18799.2997.camel@summit> (raw)
In-Reply-To: <20020510130903.B1544@w-mikek2.des.beaverton.ibm.com>

n Fri, 2002-05-10 at 13:09, Mike Kravetz wrote: 
> Please consider the following optimization to set_cpus_allowed().
> In the case where the task does not reside on a runqueue, is it
> not safe/sufficient to simply set the task's cpu field?  This
> would avoid scheduling the migration thread to perform the task.
> 
> Previously, set_cpus_allowed() was always called for a task that
> resides on a runqueue.  With the introduction of the 'cpu affinity'
> system calls, this is no longer the case.

I like!  I agree, if the task is not runnable then it should be
sufficient to just set task->cpu as when it is activated it will be put
into the runqueue based on ->cpu.

There was a chance even without the CPU affinity runqueues a process
would dequeue before set_cpus_allowed returned.  Look at the case in
migration_thread where exactly what your patch does is done.  If !array,
then the code just sets task->cpu and returns.

Ingo?  Good?

	Robert Love


      reply	other threads:[~2002-05-13 23:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-10 20:09 set_cpus_allowed() optimization Mike Kravetz
2002-05-13 23:05 ` Robert Love [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=1021331147.18799.2997.camel@summit \
    --to=rml@tech9.net \
    --cc=kravetz@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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