diff options
author | Lee Schermerhorn <lee.schermerhorn@hp.com> | 2008-04-28 05:13:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:23 -0400 |
commit | f0be3d32b05d3fea2fcdbbb81a39dac2a7163169 (patch) | |
tree | 5794ce6a8befbce82cd3e44ff15fbf3bb5f2f3bf /kernel | |
parent | 3b1163006332302117b1b2acf226d4014ff46525 (diff) |
mempolicy: rename mpol_free to mpol_put
This is a change that was requested some time ago by Mel Gorman. Makes sense
to me, so here it is.
Note: I retain the name "mpol_free_shared_policy()" because it actually does
free the shared_policy, which is NOT a reference counted object. However, ...
The mempolicy object[s] referenced by the shared_policy are reference counted,
so mpol_put() is used to release the reference held by the shared_policy. The
mempolicy might not be freed at this time, because some task attached to the
shared object associated with the shared policy may be in the process of
allocating a page based on the mempolicy. In that case, the task performing
the allocation will hold a reference on the mempolicy, obtained via
mpol_shared_policy_lookup(). The mempolicy will be freed when all tasks
holding such a reference have called mpol_put() for the mempolicy.
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 2 | ||||
-rw-r--r-- | kernel/fork.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 97f609f574b1..2a9d98c641ac 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -967,7 +967,7 @@ NORET_TYPE void do_exit(long code) | |||
967 | proc_exit_connector(tsk); | 967 | proc_exit_connector(tsk); |
968 | exit_notify(tsk, group_dead); | 968 | exit_notify(tsk, group_dead); |
969 | #ifdef CONFIG_NUMA | 969 | #ifdef CONFIG_NUMA |
970 | mpol_free(tsk->mempolicy); | 970 | mpol_put(tsk->mempolicy); |
971 | tsk->mempolicy = NULL; | 971 | tsk->mempolicy = NULL; |
972 | #endif | 972 | #endif |
973 | #ifdef CONFIG_FUTEX | 973 | #ifdef CONFIG_FUTEX |
diff --git a/kernel/fork.c b/kernel/fork.c index c674aa8d3c31..1a5ae2084574 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1374,7 +1374,7 @@ bad_fork_cleanup_security: | |||
1374 | security_task_free(p); | 1374 | security_task_free(p); |
1375 | bad_fork_cleanup_policy: | 1375 | bad_fork_cleanup_policy: |
1376 | #ifdef CONFIG_NUMA | 1376 | #ifdef CONFIG_NUMA |
1377 | mpol_free(p->mempolicy); | 1377 | mpol_put(p->mempolicy); |
1378 | bad_fork_cleanup_cgroup: | 1378 | bad_fork_cleanup_cgroup: |
1379 | #endif | 1379 | #endif |
1380 | cgroup_exit(p, cgroup_callbacks_done); | 1380 | cgroup_exit(p, cgroup_callbacks_done); |