[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arch
Subject:    Re: [PATCH 25/60] microblaze_v4: process and init task function
From:       Paul Mundt <lethal () linux-sh ! org>
Date:       2008-06-28 4:50:42
Message-ID: 20080628045042.GF25492 () linux-sh ! org
[Download RAW message or body]

On Thu, Jun 26, 2008 at 02:29:54PM +0200, monstr@seznam.cz wrote:
> +void (*pm_power_off)(void) = NULL;
> +EXPORT_SYMBOL(pm_power_off);
> +
> +void cpu_idle(void)
> +{
> +	set_thread_flag(TIF_POLLING_NRFLAG);
> +
> +	while (1) {
> +		while (!need_resched())
> +			cpu_relax();
> +
> +		preempt_enable_no_resched();
> +		schedule();
> +		preempt_disable();
> +	}
> +}
> +
A couple things to note here. You have a pm_power_off, but no pm_idle.

You set TIF_POLLING_NRFLAG but don't have any explicit clearing and
resetting of it if the CPU is sleeping. In the cpu_relax() case this is
ok, but if you have a cpu_sleep() you will want to use in the SMP case,
you will need to handle it explicitly.

Beyond that, you may also want to stub in the
tick_nohz_stop_sched_tick()/tick_nohz_restart_sched_tick() calls, then
when you implement the generic clockevents you will already have the
tickless bits in place.

check_pgt_cache() is also helpful here for quicklist trimming, though you
may not care if you never plan to have an MMU.

You can look at arch/sh/kernel/process_32.c for examples.
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic