aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2009-04-24 03:51:43 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-24 04:18:52 -0400
commit1cb81b143fa8f0e4629f10690862e2e52ca792ff (patch)
tree667b9677f8ad1211ca3d094bedabe47a3d4f5ba9 /include
parent7e0bfad24d85de7cf2202a7b0ce51de11a077b21 (diff)
x86, bts, mm: clean up buffer allocation
The current mm interface is asymetric. One function allocates a locked buffer, another function only refunds the memory. Change this to have two functions for accounting and refunding locked memory, respectively; and do the actual buffer allocation in ptrace. [ Impact: refactor BTS buffer allocation code ] Signed-off-by: Markus Metzger <markus.t.metzger@intel.com> Acked-by: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <20090424095143.A30265@sedona.ch.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a3963ba23a6d..009eabd3c21c 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -19,6 +19,7 @@ struct anon_vma;
19struct file_ra_state; 19struct file_ra_state;
20struct user_struct; 20struct user_struct;
21struct writeback_control; 21struct writeback_control;
22struct rlimit;
22 23
23#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ 24#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */
24extern unsigned long max_mapnr; 25extern unsigned long max_mapnr;
@@ -1319,7 +1320,8 @@ int vmemmap_populate_basepages(struct page *start_page,
1319int vmemmap_populate(struct page *start_page, unsigned long pages, int node); 1320int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
1320void vmemmap_populate_print_last(void); 1321void vmemmap_populate_print_last(void);
1321 1322
1322extern void *alloc_locked_buffer(size_t size); 1323extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim,
1323extern void refund_locked_buffer_memory(struct mm_struct *mm, size_t size); 1324 size_t size);
1325extern void refund_locked_memory(struct mm_struct *mm, size_t size);
1324#endif /* __KERNEL__ */ 1326#endif /* __KERNEL__ */
1325#endif /* _LINUX_MM_H */ 1327#endif /* _LINUX_MM_H */