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 4/4] x86: use generic thread_info allocator
Date: Sat, 27 Dec 2008 14:19:45 +0900 [thread overview]
Message-ID: <20081227051943.GE3295@localhost.localdomain> (raw)
In-Reply-To: <20081227051606.GA3295@localhost.localdomain>
Use generic thread_info allocator for x86.
Because thread_info allocator for x86 and generic one are same now.
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>
---
arch/x86/include/asm/page_32.h | 6 +++---
arch/x86/include/asm/page_64.h | 4 ++--
arch/x86/include/asm/thread_info.h | 13 -------------
arch/x86/kernel/process.c | 5 -----
4 files changed, 5 insertions(+), 23 deletions(-)
Index: 2.6/arch/x86/include/asm/thread_info.h
===================================================================
--- 2.6.orig/arch/x86/include/asm/thread_info.h
+++ 2.6/arch/x86/include/asm/thread_info.h
@@ -147,18 +147,6 @@ struct thread_info {
#define PREEMPT_ACTIVE 0x10000000
-/* thread information allocation */
-#ifdef CONFIG_DEBUG_STACK_USAGE
-#define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO)
-#else
-#define THREAD_FLAGS GFP_KERNEL
-#endif
-
-#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
-
-#define alloc_thread_info(tsk) \
- ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER))
-
#ifdef CONFIG_X86_32
#define STACK_WARN (THREAD_SIZE/8)
@@ -257,7 +245,6 @@ static inline void set_restore_sigmask(v
#ifndef __ASSEMBLY__
extern void arch_task_cache_init(void);
-extern void free_thread_info(struct thread_info *ti);
extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
#define arch_task_cache_init arch_task_cache_init
Index: 2.6/arch/x86/kernel/process.c
===================================================================
--- 2.6.orig/arch/x86/kernel/process.c
+++ 2.6/arch/x86/kernel/process.c
@@ -38,11 +38,6 @@ void free_thread_xstate(struct task_stru
}
}
-void free_thread_info(struct thread_info *ti)
-{
- free_pages((unsigned long)ti, get_order(THREAD_SIZE));
-}
-
static struct kmem_cache *task_struct_cachep;
struct task_struct *alloc_task_struct(void)
Index: 2.6/arch/x86/include/asm/page_32.h
===================================================================
--- 2.6.orig/arch/x86/include/asm/page_32.h
+++ 2.6/arch/x86/include/asm/page_32.h
@@ -14,11 +14,11 @@
#define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
#ifdef CONFIG_4KSTACKS
-#define THREAD_ORDER 0
+#define THREAD_SIZE_ORDER 0
#else
-#define THREAD_ORDER 1
+#define THREAD_SIZE_ORDER 1
#endif
-#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
+#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
#define STACKFAULT_STACK 0
#define DOUBLEFAULT_STACK 1
Index: 2.6/arch/x86/include/asm/page_64.h
===================================================================
--- 2.6.orig/arch/x86/include/asm/page_64.h
+++ 2.6/arch/x86/include/asm/page_64.h
@@ -3,8 +3,8 @@
#define PAGETABLE_LEVELS 4
-#define THREAD_ORDER 1
-#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
+#define THREAD_SIZE_ORDER 1
+#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
#define CURRENT_MASK (~(THREAD_SIZE - 1))
#define EXCEPTION_STACK_ORDER 0
prev parent reply other threads:[~2008-12-27 5:20 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 ` [PATCH 1/4] convert task_struct allocator macros to inline functions Akinobu Mita
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 ` Akinobu Mita [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=20081227051943.GE3295@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 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.