From: Herbert Poetzl <herbert@13thfloor.at>
To: linux-kernel@vger.kernel.org
Cc: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Subject: 2.4.23 *_task_struct() observations ...
Date: Mon, 1 Dec 2003 18:26:20 +0100 [thread overview]
Message-ID: <20031201172620.GA312@MAIL.13thfloor.at> (raw)
Hi All!
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_* ...
fs/proc/base.c for example does:
read_lock(&tasklist_lock);
task = find_task_by_pid(pid);
if (task)
get_task_struct(task);
read_unlock(&tasklist_lock);
if (!task)
goto out;
inode = proc_pid_make_inode(dir->i_sb, task, PROC_PID_INO);
free_task_struct(task);
which is a little suspicious ...
please could anybody explain the logic behind that?
(if it isn't a widespread bug(tm))
TIA,
Herbert
next reply other threads:[~2003-12-01 17:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-01 17:26 Herbert Poetzl [this message]
2003-12-01 17:51 ` 2.4.23 *_task_struct() observations Russell King
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=20031201172620.GA312@MAIL.13thfloor.at \
--to=herbert@13thfloor.at \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).