The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Markus Metzger <markus.t.metzger@intel.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, tglx@linutronix.de,
	hpa@zytor.com, markus.t.metzger@gmail.com, roland@redhat.com,
	eranian@googlemail.com, juan.villacis@intel.com,
	ak@linux.jf.intel.com
Subject: Re: [patch 2/14] x86, mm: add release_locked_buffer_on_behalf
Date: Fri, 27 Mar 2009 15:22:15 +0100	[thread overview]
Message-ID: <20090327142215.GC14504@redhat.com> (raw)
In-Reply-To: <20090327094836.A11033@sedona.ch.intel.com>

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.


  reply	other threads:[~2009-03-27 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-27  8:48 [patch 2/14] x86, mm: add release_locked_buffer_on_behalf Markus Metzger
2009-03-27 14:22 ` Oleg Nesterov [this message]
2009-03-27 15:18   ` Metzger, Markus T

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090327142215.GC14504@redhat.com \
    --to=oleg@redhat.com \
    --cc=ak@linux.jf.intel.com \
    --cc=eranian@googlemail.com \
    --cc=hpa@zytor.com \
    --cc=juan.villacis@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.t.metzger@gmail.com \
    --cc=markus.t.metzger@intel.com \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox