All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>,
	Chris Zankel <czankel@tensilica.com>, Ingo Molnar <mingo@elte.hu>,
	linux-arch@vger.kernel.org
Subject: Re: Lots of possible arch breakage in cpu_idle!!
Date: Mon, 30 May 2005 21:18:44 +1000	[thread overview]
Message-ID: <429AF694.4080104@yahoo.com.au> (raw)
In-Reply-To: <OF7BE04D3C.BB28882F-ONC1257011.003BCCE8-C1257011.003C987D@de.ibm.com>

Martin Schwidefsky wrote:
> Hi Nick,
> 
> 
>>s390 - local irq disable before checking need_resched doesn't gain
>>        anything (removed, OK?)
> 
> 
> Well, currently there seems to be only the pfault interrupt that can
> set TIF_NEED_RESCHED and pfault interrupts can't happen for idle. So
> it should work. But if there is any chance that an interrupt will ever
> set TIF_NEED_RESCHED we have to disable the interrupts before doing
> the resched check.

But other processors can set your TIF_NEED_RESCHED too,
so simply disabling local interrupts does not give any
synchronisation of TIF_NEED_RESCHED.

What it can give is a guarantee that some interrupt will
get queued and not processed. This can be used to sleep
the processor until the next interrupt (because when the
other CPU sets TIF_NEED_RESCHED it will also send an IPI).
Now it could well be that this is what you need, in which
case I'm wrong.

However:

   local_irq_disable();
   if (need_resched()) {
     local_irq_enable();
     return;
   }

   /* need_resched() can become true here */

   [... do stuff ...]

Basically you just cut your losses and pick up the
need_resched() when you get around to testing it again.

> As I implemented this I wanted to make absolutly
> sure that we don't miss any reschedule. It works the way it is and
> the additional cycles in idle() for local_irq_disable/local_irq_enable
> won't hurt. I don't see the benefit of the change. Only chances that
> it might break something we haven't thought of.
> 

No, it doesn't hurt (well, it may slightly slow down your
interrupt processing rate, but who's counting!).

However, I would like to try to tighten things up in this
area a bit if possible now that we're looking at it.

Thanks very much,
Nick

Send instant messages to your online friends http://au.messenger.yahoo.com 

  reply	other threads:[~2005-05-30 11:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-29  5:25 Lots of possible arch breakage in cpu_idle!! Nick Piggin
2005-05-29  5:44 ` Andrew Morton
2005-05-29  8:45 ` William Lee Irwin III
2005-05-29 10:03   ` Nick Piggin
2005-05-29 10:13     ` William Lee Irwin III
2005-05-29 11:39       ` William Lee Irwin III
2005-05-29  9:42 ` William Lee Irwin III
2005-05-29 10:08   ` Nick Piggin
2005-05-29 10:14     ` William Lee Irwin III
2005-05-29 16:55 ` Richard Henderson
2005-05-29 20:41   ` David S. Miller
2005-05-29 20:56     ` Richard Henderson
2005-05-30  0:37   ` Nick Piggin
2005-05-30 11:01 ` Martin Schwidefsky
2005-05-30 11:18   ` Nick Piggin [this message]
2005-05-30 11:34     ` Martin Schwidefsky
2005-05-30 11:49       ` Nick Piggin
2005-05-31  8:56 ` David Howells
2005-05-31  9:02   ` Nick Piggin
2005-05-31  9:05     ` David Howells

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=429AF694.4080104@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=czankel@tensilica.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=schwidefsky@de.ibm.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.