Re: [patch 17/18] tile: Use common threadinfo allocator

From: Thomas Gleixner
Date: Tue May 08 2012 - 08:04:19 EST


On Mon, 7 May 2012, Chris Metcalf wrote:

> On 5/7/2012 4:33 PM, Thomas Gleixner wrote:
> > On Mon, 7 May 2012, Chris Metcalf wrote:
> >
> >> I think the only obvious
> >> way is to override something in the threadinfo allocator.
> > Wrong. The obvious way is to use the common code and add a special
> > flag to it.
>
> Well, that's overriding something in the threadinfo allocator :-)
>
> In all seriousness, adding an arch-specific GFP flag sounds like it should
> work OK for tile. Thanks!

I pushed out the minimum set of patches into a separate branch, so you
can base your work on that and we wont run into merge order
dependencies.

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git smp/threadinfo

The patch below lets you define your extra gfp flag for tile.

Thanks,

tglx

-------->

Subject: threadinfo: Add an optional ARCH gfp flag for the threadinfo allocator

Allows architectures to add their magic gfp flags.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

--- tip.orig/include/linux/thread_info.h
+++ tip/include/linux/thread_info.h
@@ -55,11 +55,17 @@ extern long do_no_restart_syscall(struct
#ifdef __KERNEL__

#ifdef CONFIG_DEBUG_STACK_USAGE
-# define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
+# define __THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
#else
-# define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK)
+# define __THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK)
#endif

+#ifndef ARCH_THREAD_INFO_GFP
+# define ARCH_THREAD_INFO_GFP (0)
+#endif
+
+#define THREADINFO_GFP (__THREADINFO_GFP | ARCH_THREAD_INFO_GFP)
+
/*
* flag set/clear/test wrappers
* - pass TIF_xxxx constants to these functions
--
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/