Re: [2.1.90 patch] SMP sys_idle() user level hang

Alexander Kjeldaas (astor@guardian.no)
Wed, 25 Mar 1998 16:17:59 +0100


On Wed, Mar 25, 1998 at 03:49:12PM +0100, Andrea Arcangeli wrote:
>
> Here the patch:
> --- linux/arch/i386/kernel/process.c 1998/03/25 14:29:40 1.1
> +++ linux/arch/i386/kernel/process.c 1998/03/25 14:35:05
> @@ -171,6 +171,8 @@
>
> asmlinkage int sys_idle(void)
> {
> + if (current->pid != 0)
> + return -EPERM;
> cpu_idle(NULL);
> return 0;
> }

If you want to check whether the process is kernel or userland, it is
probably better to compare current->mm to &init_mm since kernel
threads don't have pid == 0.

astor

-- 
 Alexander Kjeldaas, Guardian Networks AS, Trondheim, Norway
 http://www.guardian.no/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu