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: <20101014153223.a710d70c.akpm@linux-foundation.org>
Date:	Thu, 14 Oct 2010 15:32:23 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Ingo Molnar <mingo@...hat.com>, "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Casey Dahlin <cdahlin@...hat.com>, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [patch] x86: allow ZONE_DMA to be configurable

On Thu, 14 Oct 2010 15:15:28 -0700 (PDT)
David Rientjes <rientjes@...gle.com> wrote:

> On Thu, 14 Oct 2010, Andrew Morton wrote:
> 
> > > ZONE_DMA is unnecessary for a large number of machines that do not
> > > require addressing in the lower 16MB of memory because they do not use
> > > ISA devices with 16-bit address registers (plus one page byte register).
> > > 
> > > This patch allows users to disable ZONE_DMA for x86 if they know they
> > > will not be using such devices with their kernel.
> > > 
> > > This prevents the VM from unnecessarily reserving a ratio of memory
> > > (defaulting to 1/256th of system capacity) with lowmem_reserve_ratio
> > > for such allocations when it will never be used.
> > > 
> > 
> > I wonder how hard it would be to do this at runtime, probably with a
> > boot parameter.
> > 
> 
> A "no_zone_dma" boot parameter wouldn't allow us to achieve the text or 
> data savings that we see from disabling all three options in question 
> here.

True, but doing it at runtime is vastly more user-friendly.  Distros
aren't doing to double the number of kernels they package for this
option!

Of course, we could do both.

> Hot-adding ZONE_DMA at runtime would be possible but there's no guarantee 
> that memory hasn't fully been used by the time you do it, so it disregards 
> lowmem_reserve_ratio unless you migrate everything, which has a dependency 
> on it being movable.
> 
> > I'd be a little concerned at the effects of this on page reclaim and
> > the page allocator - it might expose weird pre-existing bugs or
> > inefficiencies.  But we can cross that bridge when we fall off it, I
> > guess.
> > 
> 
> We've run with it for a couple years, we can even undefine __GFP_DMA to 
> find allocations that we compile into the kernel to ensure we don't have a 
> requirement for the zone.

"we" is google, I assume.

>  Perhaps only define the gfp flag when we have 
> CONFIG_ZONE_DMA and break users' builds until they disable options that 
> require it

That sounds a good idea.

What happens in the current patch if someone passes __GFP_DMA when
CONFIG_ZONE_DMA=n?  ENOMEM?  Perhaps it should WARN() as well.

> (or enable CONFIG_ZONE_DMA)?

hm.  It'd be better to make all the drivers depend on ZONE_DMA.  Good
luck with that :)

> It would be great if we could do "select ZONE_DMA" for all options that 
> require it, though.
--
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