mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] minor sched-E1 tweaks and questions
Date: Wed, 9 Jan 2002 22:06:44 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.40.0201092203370.933-100000@blue1.dev.mcafeelabs.com> (raw)
In-Reply-To: <E16OWCo-0000YO-00@wagner.rustcorp.com.au>

On Thu, 10 Jan 2002, Rusty Russell wrote:

> Another question:
>
> 	if (likely(prev != next)) {
> 		rq->nr_switches++;
> 		rq->curr = next;
> 		next->cpu = prev->cpu;
> 		context_switch(prev, next);
> 		/*
> 		 * The runqueue pointer might be from another CPU
> 		 * if the new task was last running on a different
> 		 * CPU - thus re-load it.
> 		 */
> 		barrier();
> 		rq = this_rq();
> 	}
> 	spin_unlock_irq(&rq->lock);
>
> I do not understand this comment.  How can rq (ie. smp_processor_id())
> change?  Nothing sleeps here, and if it DID change, the
> spin_unlock_irq() would be wrong...

If you switch you'll on the stack the rq of the previous cpu
spin_unlock_irq(&rq->lock) is fine if you do not switch and if you switch
you need to reload rq





- Davide



  reply	other threads:[~2002-01-10  6:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.33.0201091126520.2276-100000@localhost.localdomain>
2002-01-10  3:48 ` Rusty Russell
2002-01-10  6:06   ` Davide Libenzi [this message]
2002-01-10 13:07   ` Ingo Molnar

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=Pine.LNX.4.40.0201092203370.933-100000@blue1.dev.mcafeelabs.com \
    --to=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    /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®