Re: 2.4.23 *_task_struct() observations ...

From: Russell King
Date: Mon Dec 01 2003 - 12:52:26 EST


On Mon, Dec 01, 2003 at 06:26:20PM +0100, Herbert Poetzl wrote:
> just wanted to get an opinion on the following ...
>
> include/asm-i386/processor.h defines ...
>
> #define alloc_task_struct() ((struct task_struct *) \
> __get_free_pages(GFP_KERNEL,1))
> #define free_task_struct(p) free_pages((unsigned long) (p), 1)
> #define get_task_struct(tsk) atomic_inc(&virt_to_page(tsk)->count)
>
> now there seems to be no put_task_struct(), but
> there are some examples where get/free is used
> where I would expect a put_* ...

put_* is free_*. The reference count for the task struct is the page
count (virt_to_page(tsk)->count).

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/