[patch V2 03/31] task_allocator: Use config switches instead of magicdefines

From: Thomas Gleixner
Date: Thu May 03 2012 - 05:11:09 EST


Replace __HAVE_ARCH_TASK_ALLOCATOR and __HAVE_ARCH_THREAD_ALLOCATOR
with proper config switches.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: David Howells <dhowells@xxxxxxxxxx>
Cc: Tony Luck <tony.luck@xxxxxxxxx>
---
arch/Kconfig | 6 ++++++
arch/frv/Kconfig | 1 +
arch/frv/include/asm/thread_info.h | 2 --
arch/ia64/Kconfig | 2 ++
arch/ia64/include/asm/thread_info.h | 3 ---
kernel/fork.c | 6 +++---
6 files changed, 12 insertions(+), 8 deletions(-)

Index: tip/arch/Kconfig
===================================================================
--- tip.orig/arch/Kconfig
+++ tip/arch/Kconfig
@@ -219,4 +219,10 @@ config HAVE_CMPXCHG_DOUBLE
config ARCH_WANT_OLD_COMPAT_IPC
bool

+config ARCH_TASK_STRUCT_ALLOCATOR
+ bool
+
+config ARCH_THREAD_INFO_ALLOCATOR
+ bool
+
source "kernel/gcov/Kconfig"
Index: tip/arch/frv/Kconfig
===================================================================
--- tip.orig/arch/frv/Kconfig
+++ tip/arch/frv/Kconfig
@@ -9,6 +9,7 @@ config FRV
select GENERIC_IRQ_SHOW
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select GENERIC_CPU_DEVICES
+ select ARCH_THREAD_INFO_ALLOCATOR

config ZONE_DMA
bool
Index: tip/arch/frv/include/asm/thread_info.h
===================================================================
--- tip.orig/arch/frv/include/asm/thread_info.h
+++ tip/arch/frv/include/asm/thread_info.h
@@ -80,8 +80,6 @@ register struct thread_info *__current_t

#define current_thread_info() ({ __current_thread_info; })

-#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
-
/* thread information allocation */
#ifdef CONFIG_DEBUG_STACK_USAGE
#define alloc_thread_info_node(tsk, node) \
Index: tip/arch/ia64/Kconfig
===================================================================
--- tip.orig/arch/ia64/Kconfig
+++ tip/arch/ia64/Kconfig
@@ -34,6 +34,8 @@ config IA64
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select GENERIC_IOMAP
select GENERIC_SMP_IDLE_THREAD
+ select ARCH_TASK_STRUCT_ALLOCATOR
+ select ARCH_THREAD_INFO_ALLOCATOR
default y
help
The Itanium Processor Family is Intel's 64-bit successor to
Index: tip/arch/ia64/include/asm/thread_info.h
===================================================================
--- tip.orig/arch/ia64/include/asm/thread_info.h
+++ tip/arch/ia64/include/asm/thread_info.h
@@ -54,8 +54,6 @@ struct thread_info {
}, \
}

-#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
-
#ifndef ASM_OFFSETS_C
/* how to get the thread information struct from C */
#define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE))
@@ -84,7 +82,6 @@ struct thread_info {
#endif
#define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET)

-#define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
#define alloc_task_struct_node(node) \
({ \
struct page *page = alloc_pages_node(node, GFP_KERNEL | __GFP_COMP, \
Index: tip/kernel/fork.c
===================================================================
--- tip.orig/kernel/fork.c
+++ tip/kernel/fork.c
@@ -111,7 +111,7 @@ int nr_processes(void)
return total;
}

-#ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
+#ifndef CONFIG_ARCH_TASK_STRUCT_ALLOCATOR
# define alloc_task_struct_node(node) \
kmem_cache_alloc_node(task_struct_cachep, GFP_KERNEL, node)
# define free_task_struct(tsk) \
@@ -119,7 +119,7 @@ int nr_processes(void)
static struct kmem_cache *task_struct_cachep;
#endif

-#ifndef __HAVE_ARCH_THREAD_INFO_ALLOCATOR
+#ifndef CONFIG_ARCH_THREAD_INFO_ALLOCATOR
static struct thread_info *alloc_thread_info_node(struct task_struct *tsk,
int node)
{
@@ -213,7 +213,7 @@ EXPORT_SYMBOL_GPL(__put_task_struct);

void __init fork_init(unsigned long mempages)
{
-#ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
+#ifndef CONFIG_ARCH_TASK_STRUCT_ALLOCATOR
#ifndef ARCH_MIN_TASKALIGN
#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES
#endif


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/