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]
Date:	Sat, 15 Nov 2008 21:47:35 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Lai Jiangshan <laijs@...fujitsu.com>
Cc:	Arjan van de Ven <arjan@...radead.org>,
	Paul Menage <menage@...gle.com>,
	kamezawa.hiroyu@...fujitsu.com,
	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	Jens Axboe <jens.axboe@...cle.com>,
	"David S. Miller" <davem@...emloft.net>, Jan Kara <jack@...e.cz>,
	Jes Sorensen <jes@....com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/7] mm: introduce simple_malloc()/simple_free()

On Sun, 16 Nov 2008 13:35:03 +0800 Lai Jiangshan <laijs@...fujitsu.com> wrote:

> Andrew Morton wrote:
> > On Sat, 15 Nov 2008 20:52:29 -0800 Arjan van de Ven <arjan@...radead.org> wrote:
> > 
> >> On Sun, 16 Nov 2008 12:33:15 +0800
> >> Lai Jiangshan <laijs@...fujitsu.com> wrote:
> >>
> >>> some subsystem needs vmalloc() when required memory is large.
> >>> but current kernel has not APIs for this requirement.
> >>> this patch introduces simple_malloc() and simple_free().
> >> Hi
> >>
> >> I kinda really don't like this approach. vmalloc() (and especially,
> >> vfree()) is a really expensive operation, and vmalloc()'d memory is
> >> also slower (due to tlb pressure).
> > 
> > And it can fragment, which effectively means a dead box.
> > 
> >> Realistically, people should try hard
> >> to use small datastructure instead....
> > 
> > Yup, it makes it easier for people to do something which we strongly
> > discourage.  The risk got worse with all these 64-bit machines with
> > vast amounts of virtual address space.  It makes it easier for people
> > to develop and "test" code which isn't reliable on smaller machines.
> > 
> >
> 
> vmalloc() is not good for performance and increasing fragment.
> but vmalloc() is need for some subsystems' alternative malloc,
> like cgroup's tasks file and other subsystems(about 20 subsystems).
> 
> these subsystems use kmalloc() in the most condition, but may need
> vmalloc() in some rare condition. so they use alternative malloc.
> 
> So, since these subsystems' maintainer have good reasons for using vmalloc(),
> they can use simple_malloc() too. simple_malloc() is not for common using.
> (I should document when we use simple_malloc() in the code)
> 
> simple_free() is useful. there are several subsystems which use a flags
> for selecting kfree() or vfree(), and some subsystems recount the size hardy
> before kfree() or vfree().
> 

Sure.  Apart from the names of the functions, it's a good cleanup of
existing code.

It's just that we must *really* discourage the use of vmalloc :(

Maybe we should call it i_am_a_hopeless_loser_alloc().  Sending the
per-subsystem patches to the maintainers would be fun.

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