From: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jan Dittmer <jdittmer@ppp0.net>,
Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux/m68k <linux-m68k@vger.kernel.org>
Subject: Re: Linux 2.6.12-rc3
Date: Thu, 21 Apr 2005 18:39:08 +0100 [thread overview]
Message-ID: <20050421173908.GZ13052@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20050421161106.GY13052@parcelfarce.linux.theplanet.co.uk>
thread_info, part 1:
new helper - task_thread_info(task). On platforms that have thread_info
allocated separately (i.e. in default case) it simply returns task->thread_info.
m68k wants (and for good reasons) to embed its thread_info into task_struct.
So it will (in later patch) have task_thread_info() of its own.
For now we just add a macro for generic case and convert existing users in
core kernel to its user. Obviously safe - all normal architectures get
the same preprocessor output they used to get.
diff -urN RC12-rc3-delta23/include/linux/sched.h RC12-rc3-task_thread_info/include/linux/sched.h
--- RC12-rc3-delta23/include/linux/sched.h Wed Apr 20 21:25:54 2005
+++ RC12-rc3-task_thread_info/include/linux/sched.h Wed Apr 20 22:51:13 2005
@@ -1102,32 +1102,34 @@
spin_unlock(&p->alloc_lock);
}
+#define task_thread_info(task) (task)->thread_info
+
/* set thread flags in other task's structures
* - see asm/thread_info.h for TIF_xxxx flags available
*/
static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag)
{
- set_ti_thread_flag(tsk->thread_info,flag);
+ set_ti_thread_flag(task_thread_info(tsk), flag);
}
static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
{
- clear_ti_thread_flag(tsk->thread_info,flag);
+ clear_ti_thread_flag(task_thread_info(tsk), flag);
}
static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
{
- return test_and_set_ti_thread_flag(tsk->thread_info,flag);
+ return test_and_set_ti_thread_flag(task_thread_info(tsk), flag);
}
static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
{
- return test_and_clear_ti_thread_flag(tsk->thread_info,flag);
+ return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag);
}
static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag)
{
- return test_ti_thread_flag(tsk->thread_info,flag);
+ return test_ti_thread_flag(task_thread_info(tsk), flag);
}
static inline void set_tsk_need_resched(struct task_struct *tsk)
@@ -1198,12 +1200,12 @@
static inline unsigned int task_cpu(const struct task_struct *p)
{
- return p->thread_info->cpu;
+ return task_thread_info(p)->cpu;
}
static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
{
- p->thread_info->cpu = cpu;
+ task_thread_info(p)->cpu = cpu;
}
#else
diff -urN RC12-rc3-delta23/kernel/exit.c RC12-rc3-task_thread_info/kernel/exit.c
--- RC12-rc3-delta23/kernel/exit.c Wed Apr 20 21:25:54 2005
+++ RC12-rc3-task_thread_info/kernel/exit.c Wed Apr 20 22:51:13 2005
@@ -827,7 +827,7 @@
if (group_dead && tsk->signal->leader)
disassociate_ctty(1);
- module_put(tsk->thread_info->exec_domain->module);
+ module_put(task_thread_info(tsk)->exec_domain->module);
if (tsk->binfmt)
module_put(tsk->binfmt->module);
diff -urN RC12-rc3-delta23/kernel/fork.c RC12-rc3-task_thread_info/kernel/fork.c
--- RC12-rc3-delta23/kernel/fork.c Wed Apr 20 21:25:54 2005
+++ RC12-rc3-task_thread_info/kernel/fork.c Wed Apr 20 22:51:13 2005
@@ -893,7 +893,7 @@
if (nr_threads >= max_threads)
goto bad_fork_cleanup_count;
- if (!try_module_get(p->thread_info->exec_domain->module))
+ if (!try_module_get(task_thread_info(p)->exec_domain->module))
goto bad_fork_cleanup_count;
if (p->binfmt && !try_module_get(p->binfmt->module))
@@ -1138,7 +1138,7 @@
if (p->binfmt)
module_put(p->binfmt->module);
bad_fork_cleanup_put_domain:
- module_put(p->thread_info->exec_domain->module);
+ module_put(task_thread_info(p)->exec_domain->module);
bad_fork_cleanup_count:
put_group_info(p->group_info);
atomic_dec(&p->user->processes);
diff -urN RC12-rc3-delta23/kernel/sched.c RC12-rc3-task_thread_info/kernel/sched.c
--- RC12-rc3-delta23/kernel/sched.c Wed Apr 20 21:25:55 2005
+++ RC12-rc3-task_thread_info/kernel/sched.c Wed Apr 20 22:51:13 2005
@@ -1151,7 +1151,7 @@
* but it also can be p->switch_lock.) So we compensate with a count
* of 1. Also, we want to start with kernel preemption disabled.
*/
- p->thread_info->preempt_count = 1;
+ task_thread_info(p)->preempt_count = 1;
#endif
/*
* Share the timeslice between parent and child, thus the
@@ -4018,9 +4018,9 @@
/* Set the preempt count _outside_ the spinlocks! */
#if defined(CONFIG_PREEMPT) && !defined(CONFIG_PREEMPT_BKL)
- idle->thread_info->preempt_count = (idle->lock_depth >= 0);
+ task_thread_info(idle)->preempt_count = (idle->lock_depth >= 0);
#else
- idle->thread_info->preempt_count = 0;
+ task_thread_info(idle)->preempt_count = 0;
#endif
}
next prev parent reply other threads:[~2005-04-21 17:39 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-21 0:59 Linus Torvalds
2005-04-21 1:09 ` Alejandro Bonilla
2005-04-21 1:26 ` James Purser
2005-04-21 1:38 ` Patrick McFarland
2005-04-21 2:01 ` Alejandro Bonilla
2005-04-21 4:03 ` Barry K. Nathan
2005-04-21 8:17 ` Martin Schlemmer
2005-04-21 8:49 ` Jan Dittmer
2005-04-21 8:59 ` Jan Dittmer
2005-04-21 9:10 ` Geert Uytterhoeven
2005-04-21 16:11 ` Al Viro
2005-04-21 17:39 ` Al Viro [this message]
2005-04-22 22:18 ` Roman Zippel
2005-05-30 23:48 ` more thread_info patches Roman Zippel
2005-05-30 23:50 ` Roman Zippel
2005-05-30 23:51 ` Roman Zippel
2005-05-31 12:16 ` Vincent Hanquez
2005-05-30 23:52 ` Roman Zippel
2005-05-31 1:25 ` randy_dunlap
2005-05-31 9:35 ` Roman Zippel
2005-05-31 15:37 ` randy_dunlap
2005-04-21 17:45 ` Linux 2.6.12-rc3 Al Viro
2005-04-21 17:57 ` Al Viro
2005-04-21 18:08 ` Al Viro
2005-04-25 19:14 ` Geert Uytterhoeven
2005-04-26 3:24 ` Al Viro
2005-04-26 8:21 ` Geert Uytterhoeven
2005-04-21 18:04 ` Al Viro
2005-04-25 19:12 ` Geert Uytterhoeven
2005-04-21 11:20 ` Pavel Machek
2005-04-21 12:03 ` Pavel Machek
2005-04-21 16:22 ` Petr Baudis
2005-04-21 19:00 ` Pavel Machek
2005-04-21 19:09 ` Petr Baudis
2005-04-21 21:38 ` Pavel Machek
2005-04-21 21:41 ` Petr Baudis
2005-04-23 21:31 ` Pavel Machek
2005-04-21 23:22 ` Pavel Machek
2005-04-21 23:33 ` Linus Torvalds
2005-04-22 0:21 ` Petr Baudis
2005-04-22 23:18 ` Pavel Machek
2005-04-23 0:21 ` Linus Torvalds
2005-04-23 11:19 ` Pavel Machek
2005-04-23 14:15 ` Linus Torvalds
2005-04-23 16:27 ` Pierre Ossman
2005-04-23 22:02 ` Greg KH
2005-04-23 22:29 ` Pavel Machek
2005-04-23 23:38 ` Greg KH
2005-04-24 10:26 ` Andrew Morton
2005-04-24 17:44 ` Linus Torvalds
2005-04-24 19:06 ` Sam Ravnborg
2005-04-24 19:55 ` Greg KH
2005-04-24 20:17 ` Pavel Machek
2005-04-24 20:29 ` Pavel Machek
2005-04-24 22:48 ` David S. Miller
2005-04-24 23:17 ` Marcel Holtmann
2005-04-25 7:40 ` Anton Altaparmakov
2005-04-26 5:25 ` Len Brown
2005-04-26 5:50 ` Andrew Morton
2005-04-23 23:00 ` Pavel Machek
2005-04-23 23:06 ` Petr Baudis
2005-04-24 7:21 ` Pavel Machek
2005-04-24 7:35 ` Dmitry Torokhov
2005-04-24 5:45 ` Greg KH
2005-04-23 12:21 ` Ed Tomlinson
2005-04-23 23:23 ` Petr Baudis
2005-04-24 7:25 ` Pavel Machek
2005-04-21 12:18 ` Martin Schlemmer
2005-04-22 7:55 ` H. Peter Anvin
2005-04-21 12:19 ` Ralf Hildebrandt
2005-04-21 15:45 ` Randy.Dunlap
2005-04-21 13:33 ` Andreas Steinmetz
2005-04-22 0:31 ` Greg KH
2005-04-21 14:24 ` Linux 2.6.12-rc3: Oops on IDE flash disk eject Andreas Steinmetz
2005-04-21 15:27 ` Andreas Steinmetz
2005-04-21 17:00 ` Linux 2.6.12-rc3: various swsusp problems Andreas Steinmetz
2005-04-21 18:57 ` Pavel Machek
2005-04-21 20:02 ` Andreas Steinmetz
2005-04-25 9:50 ` Pavel Machek
2005-04-21 20:55 ` Andreas Steinmetz
2005-04-22 15:13 ` Stefan Seyfried
2005-04-23 2:57 ` Dmitry Torokhov
2005-04-23 8:18 ` Stefan Seyfried
2005-04-23 9:14 ` Pavel Machek
2005-04-21 19:10 ` Linux 2.6.12-rc3 Benoit Boissinot
2005-04-22 7:56 Borislav Petkov
2005-04-24 5:42 ` Greg KH
2005-04-24 6:27 ` Borislav Petkov
2005-04-24 7:30 ` Christoph Hellwig
[not found] <3VIcq-8ls-9@gated-at.bofh.it>
[not found] ` <3VIFr-px-7@gated-at.bofh.it>
[not found] ` <3VMJj-3Hv-61@gated-at.bofh.it>
[not found] ` <3VThx-16N-7@gated-at.bofh.it>
[not found] ` <3VUnf-1Ua-21@gated-at.bofh.it>
[not found] ` <3WfL8-33i-15@gated-at.bofh.it>
[not found] ` <3WgH8-3LO-3@gated-at.bofh.it>
[not found] ` <3WqZS-3qK-21@gated-at.bofh.it>
[not found] ` <3WtEl-5Ao-11@gated-at.bofh.it>
[not found] ` <3WBVe-3Qn-11@gated-at.bofh.it>
[not found] ` <3WIaj-8vN-3@gated-at.bofh.it>
2005-04-24 15:10 ` Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>
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=20050421173908.GZ13052@parcelfarce.linux.theplanet.co.uk \
--to=viro@parcelfarce.linux.theplanet.co.uk \
--cc=geert@linux-m68k.org \
--cc=jdittmer@ppp0.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
/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
all inboxes | Powered by JetHome®