All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: linux-kernel@vger.kernel.org,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Subject: Re: 2.4.23 *_task_struct() observations ...
Date: Mon, 1 Dec 2003 17:51:28 +0000	[thread overview]
Message-ID: <20031201175128.B13621@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20031201172620.GA312@MAIL.13thfloor.at>; from herbert@13thfloor.at on Mon, Dec 01, 2003 at 06:26:20PM +0100

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

      reply	other threads:[~2003-12-01 17:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-01 17:26 2.4.23 *_task_struct() observations Herbert Poetzl
2003-12-01 17:51 ` Russell King [this message]

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=20031201175128.B13621@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.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.