mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: Paul Mackerras <paulus@samba.org>
Cc: linux-kernel@vger.kernel.org, James.Bottomley@SteelEye.com
Subject: Re:smp_send_reschedule vs. smp_migrate_task
Date: Wed, 13 Feb 2002 11:59:07 -0500	[thread overview]
Message-ID: <200202131659.g1DGx7Y02165@localhost.localdomain> (raw)

> I am looking at the updates for PPC that are needed because of the
> changes to the scheduler in 2.5.x.  I need to implement
> smp_migrate_task(), but I do not have another IPI easily available;
> the Open PIC interrupt controller used in a lot of SMP PPC machines
> supports 4 IPIs in hardware and we are already using all of them.

I have this problem with the older voyager architectures that effectively have 
only one IPI.  I solved it by using a per-cpu area mailbox for IPIs (to send 
an IPI, set the bit in the per CPU area for all CPUs you want to send it to 
and then send of the global IPI.  Each receiving CPU clears the bit in their 
area before they begin processing the particular IPI).  It's not very 
efficient through (especially with cache transfers from sender to recipient), 
so using what you have is probably better.

> Thus I was thinking of using the same IPI for smp_migrate_task and
> smp_send_reschedule.  The idea is that smp_send_reschedule(cpu) will
> be effectively smp_migrate_task(cpu, NULL), and the code that receives
> that IPI will check for the NULL and do set_need_resched() instead of
> sched_task_migrated().

I wouldn't necessarily do this.  smp_send_reschedule is used a lot by the 
scheduler and is designed to be fast execution (i.e. you just send out the IPI 
and continue).  Adding spinlocks to this code will slow it down and add cache 
thrashing contention.

smp_migrate_task is designed to be fast executing, but it is only used in 
set_cpus_allowed(), which is rarely called and is not time critical.  Why not 
use the smp_call_function interface instead?  The semantics aren't entirely 
the same, but I don't believe the impact to set_cpus_allowed() will be felt at 
all.

James Bottomley



                 reply	other threads:[~2002-02-13 16:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200202131659.g1DGx7Y02165@localhost.localdomain \
    --to=james.bottomley@steeleye.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    /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®