diff options
author | David Rientjes <rientjes@google.com> | 2009-09-21 20:04:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:47 -0400 |
commit | 4af5a2f770cc8575840ccb1514ec76ecb592985c (patch) | |
tree | 7af18234d7d171a946925e65e987fd51648be3aa /include/linux/flex_array.h | |
parent | 19da3dd157f8db6fe727ff268dab4791d55a6371 (diff) |
flex_array: add flex_array_shrink function
Add a new function to the flex_array API:
int flex_array_shrink(struct flex_array *fa)
This function will free all unused second-level pages. Since elements are
now poisoned if they are not allocated with __GFP_ZERO, it's possible to
identify parts that consist solely of unused elements.
flex_array_shrink() returns the number of pages freed.
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/flex_array.h')
-rw-r--r-- | include/linux/flex_array.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h index 3887b21f883f..f12401e485fe 100644 --- a/include/linux/flex_array.h +++ b/include/linux/flex_array.h | |||
@@ -46,5 +46,6 @@ int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, | |||
46 | gfp_t flags); | 46 | gfp_t flags); |
47 | int flex_array_clear(struct flex_array *fa, unsigned int element_nr); | 47 | int flex_array_clear(struct flex_array *fa, unsigned int element_nr); |
48 | void *flex_array_get(struct flex_array *fa, unsigned int element_nr); | 48 | void *flex_array_get(struct flex_array *fa, unsigned int element_nr); |
49 | int flex_array_shrink(struct flex_array *fa); | ||
49 | 50 | ||
50 | #endif /* _FLEX_ARRAY_H */ | 51 | #endif /* _FLEX_ARRAY_H */ |