All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Lynch <ntl@pobox.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Paul Jackson <pj@sgi.com>, Jack Steiner <steiner@sgi.com>,
	linux-kernel@vger.kernel.org, Robert Love <rml@novell.com>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: 2.6.16 - sys_sched_getaffinity & hotplug
Date: Sat, 28 Jan 2006 13:27:36 -0600	[thread overview]
Message-ID: <20060128192736.GD18730@localhost.localdomain> (raw)
In-Reply-To: <20060128133244.GA22704@elte.hu>

Ingo Molnar wrote:
> 
> > Jack wrote:
> > > Should the following change be made to sched_getaffinity(). 
> > > 
> > > Index: linux/kernel/sched.c
> > > ===================================================================
> > > --- linux.orig/kernel/sched.c	2006-01-25 08:50:21.401747695 -0600
> > > +++ linux/kernel/sched.c	2006-01-27 16:57:24.504871895 -0600
> > > @@ -4031,7 +4031,7 @@ long sched_getaffinity(pid_t pid, cpumas
> > >  		goto out_unlock;
> > >  
> > >  	retval = 0;
> > > -	cpus_and(*mask, p->cpus_allowed, cpu_possible_map);
> > > +	cpus_and(*mask, p->cpus_allowed, cpu_online_map);
> > 
> In any case, Jack's change looks reasonable and obviously correct.

Are you sure?  Assuming this change is in effect, consider the
following:

Task starts with default affinity.

Task does sched_getaffinity, stashes the result in saved_mask.

Task pins itself to one cpu and does some work.

Meanwhile, more cpus are brought online.

Task finishes work and does sched_setaffinity(saved_mask).

Task will never run on the new cpus.



  parent reply	other threads:[~2006-01-28 19:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-27 23:06 2.6.16 - sys_sched_getaffinity & hotplug Jack Steiner
2006-01-28  2:58 ` Nathan Lynch
2006-01-29 13:06   ` Jack Steiner
2006-01-28  3:14 ` Paul Jackson
2006-01-28  3:42   ` Nathan Lynch
2006-01-28  4:58     ` Paul Jackson
2006-01-28  5:23       ` Nathan Lynch
2006-01-28  6:40         ` Paul Jackson
2006-01-28  7:04         ` Paul Jackson
2006-01-28 13:32   ` Ingo Molnar
2006-01-28 16:08     ` Jack Steiner
2006-01-28 19:27     ` Nathan Lynch [this message]
2006-01-28 20:06       ` Paul Jackson
2006-01-29 13:51         ` [PATCH] " Jack Steiner
2006-01-28 20:09     ` 2.6.16 " Paul Jackson
2006-01-28 20:50       ` Robert Love
2006-01-28 21:00         ` Paul Jackson
2006-01-29 13:01         ` Ingo Molnar
2006-01-29 16:09           ` Robert Love
2006-01-29 17:26             ` 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=20060128192736.GD18730@localhost.localdomain \
    --to=ntl@pobox.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pj@sgi.com \
    --cc=rml@novell.com \
    --cc=steiner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.