public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
To: Paul Jackson <pj@sgi.com>
Cc: mingo@elte.hu, clameter@sgi.com, linux-kernel@vger.kernel.org,
	dino@in.ibm.com, akpm@linux-foundation.org
Subject: Re: cpuset attach_task to touch per-cpu kernel threads?
Date: Fri, 22 Jun 2007 22:46:34 +0530	[thread overview]
Message-ID: <20070622171634.GA21543@linux.vnet.ibm.com> (raw)
In-Reply-To: <20070621105152.8daf87ad.pj@sgi.com>

On Thu, Jun 21, 2007 at 10:51:52AM -0700, Paul Jackson wrote:
> The only problem comes with kernel tasks that are pinned to less than
> the entire system, and that are in the top cpuset.

That again is not fool-proof. What if kernel-tasks change their cpu affinity
after we have done the is_pinned_kernel_thread() test? Ideally they
should not, but one never knows!

IMHO we simply should not allow kernel threads to move out of top-cpuset
(unless you know of a good reason where we may want to move them).


int cpuset_can_attach()
{

	int is_kthread = !tsk->mm || (tsk->flags & PF_BORROWED_MM);

	...

 	/* Don't moved pinned kernel threads out of top cpuset */
 	if (is_kthread && oldcs == &top_cpuset && cs != oldcs) {
                 task_unlock(tsk);
                 mutex_unlock(&callback_mutex);
                 put_task_struct(tsk);
 		return -EINVAL;
 	}

}


What do you think?

-- 
Regards,
vatsa

  reply	other threads:[~2007-06-22 17:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-21  1:49 cpuset attach_task to touch per-cpu kernel threads? Srivatsa Vaddagiri
2007-06-21  2:35 ` Paul Jackson
2007-06-21 12:16 ` Ingo Molnar
2007-06-21 17:07   ` Paul Jackson
2007-06-21 17:32     ` Srivatsa Vaddagiri
2007-06-21 17:51       ` Paul Jackson
2007-06-22 17:16         ` Srivatsa Vaddagiri [this message]
2007-06-22 17:41           ` Paul Jackson

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=20070622171634.GA21543@linux.vnet.ibm.com \
    --to=vatsa@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=dino@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pj@sgi.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