lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090327142215.GC14504@redhat.com>
Date:	Fri, 27 Mar 2009 15:22:15 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Markus Metzger <markus.t.metzger@...el.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, tglx@...utronix.de,
	hpa@...or.com, markus.t.metzger@...il.com, roland@...hat.com,
	eranian@...glemail.com, juan.villacis@...el.com,
	ak@...ux.jf.intel.com
Subject: Re: [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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ