From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH 1/4] convert task_struct allocator macros to inline functions
Date: Sat, 27 Dec 2008 14:17:12 +0900 [thread overview]
Message-ID: <20081227051710.GB3295@localhost.localdomain> (raw)
In-Reply-To: <20081227051606.GA3295@localhost.localdomain>
Usually inline function is better than function-like macro.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
kernel/fork.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
Index: 2.6/kernel/fork.c
===================================================================
--- 2.6.orig/kernel/fork.c
+++ 2.6/kernel/fork.c
@@ -92,9 +92,19 @@ int nr_processes(void)
}
#ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
-# define alloc_task_struct() kmem_cache_alloc(task_struct_cachep, GFP_KERNEL)
-# define free_task_struct(tsk) kmem_cache_free(task_struct_cachep, (tsk))
+
static struct kmem_cache *task_struct_cachep;
+
+static inline struct task_struct *alloc_task_struct(void)
+{
+ return kmem_cache_alloc(task_struct_cachep, GFP_KERNEL);
+}
+
+static inline void free_task_struct(struct task_struct *tsk)
+{
+ kmem_cache_free(task_struct_cachep, tsk);
+}
+
#endif
#ifndef __HAVE_ARCH_THREAD_INFO_ALLOCATOR
next prev parent reply other threads:[~2008-12-27 5:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-27 5:16 [PATCH 0/4] x86: fix free_thread_info() with uninitalized thread_info Akinobu Mita
2008-12-27 5:17 ` Akinobu Mita [this message]
2008-12-27 5:18 ` [PATCH 2/4] x86: arch specific task_struct allocator Akinobu Mita
2008-12-27 5:19 ` [PATCH 3/4] x86: call free_thread_xstate() in free_task_struct() Akinobu Mita
2008-12-27 5:19 ` [PATCH 4/4] x86: use generic thread_info allocator Akinobu Mita
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=20081227051710.GB3295@localhost.localdomain \
--to=akinobu.mita@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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®