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: <20121003113659.GD2259@redhat.com>
Date:	Wed, 3 Oct 2012 13:37:00 +0200
From:	Stanislaw Gruszka <sgruszka@...hat.com>
To:	Mel Gorman <mgorman@...e.de>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Pavel Machek <pavel@....cz>,
	David Rientjes <rientjes@...gle.com>,
	linux-wireless@...r.kernel.org, johannes.berg@...el.com,
	wey-yi.w.guy@...el.com, ilw@...ux.intel.com,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: iwl3945: order 5 allocation during ifconfig up; vm problem?

On Wed, Sep 12, 2012 at 11:18:26AM +0100, Mel Gorman wrote:
> On Tue, Sep 11, 2012 at 04:25:36PM -0700, Andrew Morton wrote:
> > On Mon, 10 Sep 2012 13:11:13 +0200
> > Pavel Machek <pavel@....cz> wrote:
> > 
> > > On Sun 2012-09-09 15:40:55, David Rientjes wrote:
> > > > On Sun, 9 Sep 2012, Pavel Machek wrote:
> > > > 
> > > > > On 3.6.0-rc2+, I tried to turn on the wireless, but got
> > > > > 
> > > > > root@amd:~# ifconfig wlan0 10.0.0.6 up
> > > > > SIOCSIFFLAGS: Cannot allocate memory
> > > > > SIOCSIFFLAGS: Cannot allocate memory
> > > > > root@amd:~# 
> > > > > 
> > > > > It looks like it uses "a bit too big" allocations to allocate
> > > > > firmware...? Order five allocation....
> > > > > 
> > > > > Hmm... then I did "echo 3  > /proc/sys/vm/drop_caches" and now the
> > > > > network works. Is it VM problem that it failed to allocate memory when
> > > > > it was freeable?
> > > > > 
> > > > 
> > > > Do you have CONFIG_COMPACTION enabled?
> > > 
> > > Yes:
> > > 
> > > pavel@amd:/data/l/linux-good$ zgrep CONFIG_COMPACTION /proc/config.gz 
> > > CONFIG_COMPACTION=y
> > 
> > Asking for a 256k allocation is pretty crazy - this is an operating
> > system kernel, not a userspace application.
> > 
> > I'm wondering if this is due to a recent change, but I'm having trouble
> > working out where the allocation call site is.
> 
> It may be indirectly due to a recent change and this was somewhat
> deliberate. Order-5 is larger than PAGE_ALLOC_COSTLY_ORDER and I doubt
> __GFP_REPEAT was set so it is treated as something that can fail in
> preference to aggressively reclaiming pages to satisfy the allocation. In
> older kernels with lumpy reclaim and an aggressive kswapd it would have
> probably succeeded but now it errs on the side of failing early instead
> assuming that the caller can recover. Drivers that depend on order-5
> allocations to succeed for correct operation are somewhat frowned upon.

So, can this problem be solved like on below patch, or I should rather
split firmware loading into chunks similar like was already iwlwifi did?

diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 5f50177..1b58222 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -2247,7 +2247,7 @@ il_alloc_fw_desc(struct pci_dev *pci_dev, struct fw_desc *desc)
 
 	desc->v_addr =
 	    dma_alloc_coherent(&pci_dev->dev, desc->len, &desc->p_addr,
-			       GFP_KERNEL);
+			       GFP_KERNEL | __GFP_REPEAT);
 	return (desc->v_addr != NULL) ? 0 : -ENOMEM;
 }
 
--
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