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: <20160105152602.GR9938@ZenIV.linux.org.uk>
Date:	Tue, 5 Jan 2016 15:26:02 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Michal Hocko <mhocko@...nel.org>
Cc:	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-mm@...ck.org
Subject: Re: [RFC] free_pages stuff

On Tue, Jan 05, 2016 at 02:59:03PM +0100, Michal Hocko wrote:

> > 3) vmalloc() is for large allocations.  They will be page-aligned,
> > but *not* physically contiguous.  OTOH, large physically contiguous
> > allocations are generally a bad idea.  Unlike other allocators, there's
> > no variant that could be used in interrupt; freeing is possible there,
> > but allocation is not.  Note that non-blocking variant *does* exist -
> > __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL) can be used in atomic
> > contexts; it's the interrupt ones that are no-go.

The last sentence I'd put into that part was complete crap...

> It is also hardcoded GFP_KERNEL context so a usage from NOFS context
> needs a special treatment.

... in part because of this.  GFP_ATOMIC __vmalloc() will be anything but,
and the only caller passing that is almost certainly bogus.  As for NOFS/NOIO,
I wonder if we should apply that special treatment inside __vmalloc_area_node
rather than in callers; see the current thread on linux-mm for details...

Another interesting issue is __GFP_HIGHMEM meaning for kmalloc and __vmalloc
resp. (should never be passed to kmalloc, should almost always be passed
to __vmalloc - the former needs pages mapped in kernel space, the latter
probably never needs a separate kernel alias for the data pages, to such
degree that I'm not sure if we shouldn't _force_ __GFP_HIGHMEM for data pages
allocation in __vmalloc_area_node())

> > 4) if it's very early in bootstrap, alloc_bootmem() and friends
> > may be the only option.  Rule of the thumb: if it's already printed
> > Memory: ...../..... available.....
> > you shouldn't be using that one.  Allocations are physically contiguous
> > and at that point large physically contiguous allocations are still OK.

Probably needs at least some discussion of memblock vs. bootmem APIs.
--
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