From: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
To: "Zwane Mwaikambo" <zwane@holomorphy.com>
Cc: "Martin J. Bligh" <mbligh@aracnet.com>,
"Linus Torvalds" <torvalds@transmeta.com>,
"linux-kernel" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] (2/3) Initial load balancing
Date: Fri, 17 Jan 2003 10:49:06 -0800 [thread overview]
Message-ID: <C8C38546F90ABF408A5961FC01FDBF1912E244@fmsmsx405.fm.intel.com> (raw)
> -----Original Message-----
> From: Zwane Mwaikambo [mailto:zwane@holomorphy.com]
> Sent: Friday, January 17, 2003 10:42 AM
> To: Pallipadi, Venkatesh
> Cc: Martin J. Bligh; Linus Torvalds; linux-kernel
> Subject: RE: [PATCH] (2/3) Initial load balancing
>
>
> On Fri, 17 Jan 2003, Pallipadi, Venkatesh wrote:
>
> > > +{
> > > + unsigned long old_mask;
> > > +
> > > + old_mask = p->cpus_allowed;
> > > + if (!(old_mask & (1UL << dest_cpu)))
> > > + return;
> > > + /* force the process onto the specified CPU */
> > > + set_cpus_allowed(p, 1UL << dest_cpu);
> > > +
> > > + /* restore the cpus allowed mask */
> > > + set_cpus_allowed(p, old_mask);
> > > +}
> >
> > It may be better to add a _note_ to this function saying
> that it is not
> > supposed to be called by multiple callers at the same time.
> As of now,
> > as it is called at exec time only, I think it is safe. But,
> if it get used at other
> > places, (or called once+preempt) we may have situations
> where we may loose the cpus_allowed mask
> > or miss some sched_migrate_task(). I am looking at, what if
> some sched_migrate_task()
> > or user set_affinity gets initiated in between two
> set_cpus_allowed in
> > this routine.
>
> Shouldn't there be a get_task_struct there?
>
> Zwane
Yes. A get_task_struct() and put_task_struct() there will make the whole
stuff in there lock-protected and should get rid of the issues I was
mentioning.
Thanks,
-Venkatesh
next reply other threads:[~2003-01-17 18:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-17 18:49 Pallipadi, Venkatesh [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-01-17 17:39 Pallipadi, Venkatesh
2003-01-17 18:42 ` Zwane Mwaikambo
2003-01-16 18:29 Martin J. Bligh
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=C8C38546F90ABF408A5961FC01FDBF1912E244@fmsmsx405.fm.intel.com \
--to=venkatesh.pallipadi@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@aracnet.com \
--cc=torvalds@transmeta.com \
--cc=zwane@holomorphy.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
all inboxes | Powered by JetHome®