lkml.org 
[lkml]   [2009]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/14] x86, mm: add release_locked_buffer_on_behalf
On 03/27, Markus Metzger wrote:
>
> -void release_locked_buffer(void *buffer, size_t size)
> +void release_locked_buffer_on_behalf(struct mm_struct *mm,
> + void *buffer, size_t size)
> {
> unsigned long pgsz = PAGE_ALIGN(size) >> PAGE_SHIFT;
>
> - down_write(&current->mm->mmap_sem);
> + down_write(&mm->mmap_sem);
>
> - current->mm->total_vm -= pgsz;
> - current->mm->locked_vm -= pgsz;
> + mm->total_vm -= pgsz;
> + mm->locked_vm -= pgsz;
>
> - up_write(&current->mm->mmap_sem);
> + up_write(&mm->mmap_sem);
> }

If you change this helper, perhaps you can remove the "void *buffer"
argument? It is not used. Actually, this helper should be renamed.
It doesn't free the memory, it only updates mm->xxx_vm.

Oleg.



\
 
 \ /
  Last update: 2009-03-27 15:29    [W:0.041 / U:3.052 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site