提交 2889f608 编写于 作者: T Thomas Gleixner

fork: Move thread info gfp flags to header

These flags can be useful for extra allocations outside of the core
code.

Add __GFP_NOTRACK to them, so the archs which have kmemcheck do
not have to provide extra allocators just for that reason.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20120505150141.428211694@linutronix.de
上级 6c0a9fa6
...@@ -54,6 +54,12 @@ extern long do_no_restart_syscall(struct restart_block *parm); ...@@ -54,6 +54,12 @@ extern long do_no_restart_syscall(struct restart_block *parm);
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifdef CONFIG_DEBUG_STACK_USAGE
# define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
#else
# define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK)
#endif
/* /*
* flag set/clear/test wrappers * flag set/clear/test wrappers
* - pass TIF_xxxx constants to these functions * - pass TIF_xxxx constants to these functions
......
...@@ -123,12 +123,8 @@ static struct kmem_cache *task_struct_cachep; ...@@ -123,12 +123,8 @@ static struct kmem_cache *task_struct_cachep;
static struct thread_info *alloc_thread_info_node(struct task_struct *tsk, static struct thread_info *alloc_thread_info_node(struct task_struct *tsk,
int node) int node)
{ {
#ifdef CONFIG_DEBUG_STACK_USAGE struct page *page = alloc_pages_node(node, THREADINFO_GFP,
gfp_t mask = GFP_KERNEL | __GFP_ZERO; THREAD_SIZE_ORDER);
#else
gfp_t mask = GFP_KERNEL;
#endif
struct page *page = alloc_pages_node(node, mask, THREAD_SIZE_ORDER);
return page ? page_address(page) : NULL; return page ? page_address(page) : NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册