All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: AVR32 architecture patch against Linux 2.6.18-rc1 available
Date: Fri, 07 Jul 2006 18:08:48 +1000	[thread overview]
Message-ID: <44AE1690.5070509@yahoo.com.au> (raw)
In-Reply-To: <20060706105227.220565f8@cad-250-152.norway.atmel.com>

Haavard Skinnemoen wrote:
> Hi everyone,
> 
> I've put up an updated set of patches for AVR32 support at
> http://avr32linux.org/twiki/bin/view/Main/LinuxPatches
> 
> The most interesting patch probably is
> http://avr32linux.org/twiki/pub/Main/LinuxPatches/avr32-arch-2.patch
> 
> which, at 544K, is too large to attach here. Please let me know if you
> want me to do it anyway.
> 
> Anyone want to have a look at this? I understand that a full review is
> a huge job, but I'd appreciate a pointer or two in the general
> direction that I need to take this in order to get it acceptable for
> mainline.
> 

Hi,

+void cpu_idle(void)
+{
+	/* endless idle loop with no priority at all */
+	while (1) {
+		/* TODO: Enter sleep mode */
+		if (need_resched())
+			schedule();
+	}
+}

AFAIKS, this is buggy.

need_resched() translates to a test_bit, which doesn't have any barriers,
so it could be optimised away completely. And if you're intending to use
preempt, you need to have preemption disabled in the idle loop.

Documentation/sched-arch.txt attempts to explain, and  something like
arm26's cpu_idle() is a nice, simple example to follow.

Actually, I'm wrong about the test_bit. It casts to volatile there, which
is probably why you don't end up with infinite loops. Still, it would be
nicer to have an explicit barrier (eg. cpu_relax()).

Why do we cast to volatile in places like this? Linus? I don't see why
test_bit() should be any more "special" than the & operator. What's more,
some architectures do cast and others don't, which is just insane.

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

  parent reply	other threads:[~2006-07-07 15:08 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-06  8:52 AVR32 architecture patch against Linux 2.6.18-rc1 available Haavard Skinnemoen
2006-07-06  9:19 ` Andrew Morton
2006-07-06  9:51   ` Russell King
2006-07-06  9:58   ` Arjan van de Ven
2006-07-06 10:43     ` Haavard Skinnemoen
2006-07-06 15:17       ` Russell King
2006-07-06 10:03   ` Haavard Skinnemoen
2006-07-06 10:14     ` Andrew Morton
2006-07-06 13:57       ` Haavard Skinnemoen
2006-07-10  9:03       ` Haavard Skinnemoen
2006-07-10  9:31         ` Andrew Morton
2006-07-10  9:37         ` Andrew Morton
2006-07-10 11:04           ` Haavard Skinnemoen
2006-07-10  9:57         ` David Woodhouse
2006-07-10 11:25           ` Haavard Skinnemoen
2006-07-06 11:30     ` Thomas Gleixner
2006-07-06 11:50       ` Haavard Skinnemoen
2006-07-06 12:10         ` Thomas Gleixner
2006-07-06 11:58 ` David Woodhouse
2006-07-06 14:13   ` Haavard Skinnemoen
2006-07-06 14:34     ` David Woodhouse
2006-07-06 18:48       ` Haavard Skinnemoen
2006-07-06 23:17         ` David Woodhouse
2006-07-07 10:39   ` Haavard Skinnemoen
2006-07-07 10:44     ` Arjan van de Ven
2006-07-07  8:08 ` Nick Piggin [this message]
2006-07-07  8:18   ` Nick Piggin
2006-07-07 16:36   ` Haavard Skinnemoen

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=44AE1690.5070509@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=hskinnemoen@atmel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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 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.