aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mlock.c
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2009-04-03 10:43:35 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-07 07:36:13 -0400
commite2b371f00a6f529f6362654239bdec8dcd510760 (patch)
tree36e47cd9fb949fd72893c2d5ddab489fa55b1869 /mm/mlock.c
parenta26b89f05d194413c7238e0bea071054f6b5d3c8 (diff)
mm, x86, ptrace, bts: defer branch trace stopping
When a ptraced task is unlinked, we need to stop branch tracing for that task. Since the unlink is called with interrupts disabled, and we need interrupts enabled to stop branch tracing, we defer the work. Collect all branch tracing related stuff in a branch tracing context. Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Markus Metzger <markus.t.metzger@intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: roland@redhat.com Cc: eranian@googlemail.com Cc: juan.villacis@intel.com Cc: ak@linux.jf.intel.com LKML-Reference: <20090403144550.712401000@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm/mlock.c')
-rw-r--r--mm/mlock.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/mm/mlock.c b/mm/mlock.c
index cbe9e0581b75..749383b442c7 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -660,21 +660,20 @@ void *alloc_locked_buffer(size_t size)
660 return buffer; 660 return buffer;
661} 661}
662 662
663void release_locked_buffer(void *buffer, size_t size) 663void refund_locked_buffer_memory(struct mm_struct *mm, size_t size)
664{ 664{
665 unsigned long pgsz = PAGE_ALIGN(size) >> PAGE_SHIFT; 665 unsigned long pgsz = PAGE_ALIGN(size) >> PAGE_SHIFT;
666 666
667 down_write(&current->mm->mmap_sem); 667 down_write(&mm->mmap_sem);
668 668
669 current->mm->total_vm -= pgsz; 669 mm->total_vm -= pgsz;
670 current->mm->locked_vm -= pgsz; 670 mm->locked_vm -= pgsz;
671 671
672 up_write(&current->mm->mmap_sem); 672 up_write(&mm->mmap_sem);
673} 673}
674 674
675void free_locked_buffer(void *buffer, size_t size) 675void free_locked_buffer(void *buffer, size_t size)
676{ 676{
677 release_locked_buffer(buffer, size); 677 refund_locked_buffer_memory(current->mm, size);
678
679 kfree(buffer); 678 kfree(buffer);
680} 679}