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: <4920D238.8090905@cn.fujitsu.com>
Date:	Mon, 17 Nov 2008 10:08:56 +0800
From:	Lai Jiangshan <laijs@...fujitsu.com>
To:	Arjan van de Ven <arjan@...radead.org>
CC:	Dave Airlie <airlied@...il.com>,
	David Miller <davem@...emloft.net>, akpm@...ux-foundation.org,
	menage@...gle.com, kamezawa.hiroyu@...fujitsu.com,
	balbir@...ux.vnet.ibm.com, jens.axboe@...cle.com, jack@...e.cz,
	jes@....com, linux-kernel@...r.kernel.org,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	dada1@...mosbay.com, Alexey Dobriyan <adobriyan@...il.com>
Subject: Re: [PATCH 1/7] mm: introduce simple_malloc()/simple_free()

Arjan van de Ven wrote:
> On Mon, 17 Nov 2008 07:39:55 +1000
> 
> I would go further than this.
> 
> Make the code just use vmalloc(). Period.
> 
> But then make vmalloc() smart and try do a direct mapping allocation
> first, before falling back to a virtual mapping. (and based on size it
> wouldn't even try it for just big things)
> 
> 
> 

Hi, Arjan van de Ven

(I'll rename simple_malloc/simple_free to kvmalloc/kvfree)

I think vmalloc() should only do one thing(virtual mapping). Your idea
can be implemented in helper function kvmalloc() if there is a good
algorithm provided for it.

kvmalloc() is for cleanup mostly. It will remove existed duplicate code.
As David and I pointed out, vmalloc() is need for some good reason.

If we do not introduce a helper function, these duplicate code
are still spread everywhere.


kvfree() is not only for free the memory allocated by kvmalloc().

kvfree() frees the memory that we don't know whether it was allocated
by kmalloc() nor vmalloc().

Someone use a flag for it, and other guys calculate size of memory again
before kfree() or vfree(). these two ways increase complexity, and
it is hard to prove the re-calculated size is reliable.

kvfree() will remove these needless complexity!



Thanx, Lai

--
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