From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Snook Subject: Re: [PATCH] Improve Atheros ethernet driver not to do order 4 GFP_ATOMIC allocation Date: Thu, 03 Dec 2015 19:26:01 +0000 Message-ID: References: <20151127082010.GA2500@dhcp22.suse.cz> <20151128145113.GB4135@amd> <20151130132129.GB21950@dhcp22.suse.cz> <20151201.153517.224543138214404348.davem@davemloft.net> <20151203081646.GB9264@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113cf54404df780526035d0d Cc: David Miller , pavel@ucw.cz, akpm@osdl.org, linux-kernel@vger.kernel.org, jcliburn@gmail.com, netdev@vger.kernel.org, rjw@rjwysocki.net, linux-mm@kvack.org, nic-devel@qualcomm.com, ronangeles@gmail.com, ebiederm@xmission.com To: Michal Hocko Return-path: In-Reply-To: <20151203081646.GB9264@dhcp22.suse.cz> Sender: owner-linux-mm@kvack.org List-Id: netdev.vger.kernel.org --001a113cf54404df780526035d0d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Dec 3, 2015 at 12:16 AM Michal Hocko wrote: > On Wed 02-12-15 22:43:31, Chris Snook wrote: > > On Tue, Dec 1, 2015 at 12:35 PM David Miller > wrote: > > > > > From: Michal Hocko > > > Date: Mon, 30 Nov 2015 14:21:29 +0100 > > > > > > > On Sat 28-11-15 15:51:13, Pavel Machek wrote: > > > >> > > > >> atl1c driver is doing order-4 allocation with GFP_ATOMIC > > > >> priority. That often breaks networking after resume. Switch to > > > >> GFP_KERNEL. Still not ideal, but should be significantly better. > > > > > > > > It is not clear why GFP_KERNEL can replace GFP_ATOMIC safely neithe= r > > > > from the changelog nor from the patch context. > > > > > > Earlier in the function we do a GFP_KERNEL kmalloc so: > > > > > > =C2=AF\_(=E3=83=84)_/=C2=AF > > > > > > It should be fine. > > > > > > > AFAICT, the people who benefit from GFP_ATOMIC are the people running a= ll > > their storage over NFS/iSCSI who are suspending their machines while > > they're so busy they don't have any clean order 4 pagecache to drop, an= d > > want the machine to panic rather than hang. > > Why would GFP_KERNEL order-4 allocation hang? It will fail if there are > not >=3D4 order pages available even after reclaim and/or compaction. > GFP_ATOMIC allocations should be used only when an access to memory > reserves is really required. If the allocation just doesn't want to > invoke direct reclaim then GFP_NOWAIT is a more suitable alternative. > The *machine* may hang if you can't bring back the interface that's required to access the storage. It's a ridiculous use case, as Pavel noted. I only pointed it out to note that there exists a rationale for GFP_ATOMIC. It just isn't nearly as good as the rationale for using GFP_KERNEL. -- Chris --001a113cf54404df780526035d0d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Thu, Dec 3,= 2015 at 12:16 AM Michal Hocko <mho= cko@kernel.org> wrote:
On We= d 02-12-15 22:43:31, Chris Snook wrote:
> On Tue, Dec 1, 2015 at 12:35 PM David Miller <davem@davemloft.net> wrote:
>
> > From: Michal Hocko <mhocko@kernel.org>
> > Date: Mon, 30 Nov 2015 14:21:29 +0100
> >
> > > On Sat 28-11-15 15:51:13, Pavel Machek wrote:
> > >>
> > >> atl1c driver is doing order-4 allocation with GFP_ATOMIC=
> > >> priority. That often breaks=C2=A0 networking after resum= e. Switch to
> > >> GFP_KERNEL. Still not ideal, but should be significantly= better.
> > >
> > > It is not clear why GFP_KERNEL can replace GFP_ATOMIC safely= neither
> > > from the changelog nor from the patch context.
> >
> > Earlier in the function we do a GFP_KERNEL kmalloc so:
> >
> > =C2=AF\_(=E3=83=84)_/=C2=AF
> >
> > It should be fine.
> >
>
> AFAICT, the people who benefit from GFP_ATOMIC are the people running = all
> their storage over NFS/iSCSI who are suspending their machines while > they're so busy they don't have any clean order 4 pagecache to= drop, and
> want the machine to panic rather than hang.

Why would GFP_KERNEL order-4 allocation hang? It will fail if there are
not >=3D4 order pages available even after reclaim and/or compaction. GFP_ATOMIC allocations should be used only when an access to memory
reserves is really required. If the allocation just doesn't want to
invoke direct reclaim then GFP_NOWAIT is a more suitable alternative.

The *machine* may hang if you can't brin= g back the interface that's required to access the storage. It's a = ridiculous use case, as Pavel noted. I only pointed it out to note that the= re exists a rationale for GFP_ATOMIC. It just isn't nearly as good as t= he rationale for using GFP_KERNEL.

-- Chris
--001a113cf54404df780526035d0d-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org