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:	Thu, 2 Apr 2015 09:25:37 -0500 (CDT)
From:	Christoph Lameter <cl@...ux.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	Jesper Dangaard Brouer <brouer@...hat.com>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	akpm@...uxfoundation.org, Pekka Enberg <penberg@...nel.org>,
	iamjoonsoo@....com
Subject: Re: Slab infrastructure for bulk object allocation and freeing V2

On Tue, 31 Mar 2015, Andrew Morton wrote:

> This patch doesn't really do anything.  I guess nailing down the
> interface helps a bit.

Right.

> to modules.  And it isn't completely obvious, because the return
> semantics are weird.

Ok.

> What's the reason for returning a partial result when ENOMEM?  Some
> callers will throw away the partial result and simply fail out.  If a
> caller attempts to go ahead and use the partial result then great, but
> you can bet that nobody will actually runtime test this situation, so
> the interface is an invitation for us to release partially-tested code
> into the wild.

Just rely on the fact that small allocations never fail? The caller get
all the requested objects if the function returns?

> Instead of the above, did you consider doing
>
> int __weak kmem_cache_alloc_array(struct kmem_cache *s, gfp_t flags, size_t nr,
>
> ?
>
> This way we save a level of function call and all that wrapper code in
> the allocators simply disappears.

I think we will need the auxiliary function in the common code later
because that allows the allocations to only do the allocations that
can be optimized and for the rest just fall back to the generic
implementations. There may be situations in which the optimizations wont
work. For SLUB this may be the case f.e. if debug options are enabled.

> > --- linux.orig/mm/slab.c	2015-03-30 08:48:12.923927793 -0500
> > +++ linux/mm/slab.c	2015-03-30 08:49:08.398137844 -0500
> > @@ -3401,6 +3401,17 @@ void *kmem_cache_alloc(struct kmem_cache
> >  }
> >  EXPORT_SYMBOL(kmem_cache_alloc);
> >
> > +void kmem_cache_free_array(struct kmem_cache *s, size_t size, void **p) {
> > +	__kmem_cache_free_array(s, size, p);
> > +}
>
> Coding style is weird.

Ok. Will fix.

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