Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302833
b: refs/heads/master
c: 4110180
h: refs/heads/master
i:
  302831: 7a10e3e
v: v3
  • Loading branch information
Thomas Gleixner committed May 8, 2012
1 parent 687d2da commit 6811c16
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2889f60814e15dea644782597d897cdba943564f
refs/heads/master: 41101809a865dd0be1b56eff46c83fad321870b2
21 changes: 17 additions & 4 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,26 @@ int nr_processes(void)
}

#ifndef __HAVE_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) \
kmem_cache_free(task_struct_cachep, (tsk))
static struct kmem_cache *task_struct_cachep;

static inline struct task_struct *alloc_task_struct_node(int node)
{
return kmem_cache_alloc_node(task_struct_cachep, GFP_KERNEL, node);
}

void __weak arch_release_task_struct(struct task_struct *tsk) { }

static inline void free_task_struct(struct task_struct *tsk)
{
arch_release_task_struct(tsk);
kmem_cache_free(task_struct_cachep, tsk);
}
#endif

#ifndef __HAVE_ARCH_THREAD_INFO_ALLOCATOR

void __weak arch_release_thread_info(struct thread_info *ti) { }

static struct thread_info *alloc_thread_info_node(struct task_struct *tsk,
int node)
{
Expand All @@ -131,6 +143,7 @@ static struct thread_info *alloc_thread_info_node(struct task_struct *tsk,

static inline void free_thread_info(struct thread_info *ti)
{
arch_release_thread_info(ti);
free_pages((unsigned long)ti, THREAD_SIZE_ORDER);
}
#endif
Expand Down

0 comments on commit 6811c16

Please sign in to comment.