linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: pavel@ucw.cz, mhocko@kernel.org, akpm@osdl.org,
	linux-kernel@vger.kernel.org, jcliburn@gmail.com,
	chris.snook@gmail.com, netdev@vger.kernel.org, rjw@rjwysocki.net,
	linux-mm@kvack.org, nic-devel@qualcomm.com, ronangeles@gmail.com,
	ebiederm@xmission.com
Subject: Re: [PATCH net] atl1c: Improve driver not to do order 4 GFP_ATOMIC allocation
Date: Thu, 03 Dec 2015 12:32:49 -0500 (EST)	[thread overview]
Message-ID: <20151203.123249.2158644928982094593.davem@davemloft.net> (raw)
In-Reply-To: <1449163048.25029.2.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 03 Dec 2015 09:17:28 -0800

> On Thu, 2015-12-03 at 16:59 +0100, 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.
>> 
>> atl1c_setup_ring_resources() is called from .open() function, and
>> already uses GFP_KERNEL, so this change is safe.
>>     
>> Signed-off-by: Pavel Machek <pavel@ucw.cz>
>> 
>> diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
>> index 2795d6d..afb71e0 100644
>> --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
>> +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
>> @@ -1016,10 +1016,10 @@ static int atl1c_setup_ring_resources(struct atl1c_adapter *adapter)
>>  		sizeof(struct atl1c_recv_ret_status) * rx_desc_count +
>>  		8 * 4;
>>  
>> -	ring_header->desc = pci_alloc_consistent(pdev, ring_header->size,
>> -				&ring_header->dma);
>> +	ring_header->desc = dma_alloc_coherent(&pdev->dev, ring_header->size,
>> +					       &ring_header->dma, GFP_KERNEL);
>>  	if (unlikely(!ring_header->desc)) {
>> -		dev_err(&pdev->dev, "pci_alloc_consistend failed\n");
>> +		dev_err(&pdev->dev, "could not get memory for DMA buffer\n");
>>  		goto err_nomem;
>>  	}
>>  	memset(ring_header->desc, 0, ring_header->size);
>> 
>> 
> 
> So this memset() will really require a different patch to get removed ?
> 
> Sigh, not sure why I review patches.

Agreed, please use dma_zalloc_coherent() and kill that memset().

Thanks.

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-12-03 17:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 16:34 4.3+: Atheros ethernet fails after resume from s2ram, due to order 4 allocation Pavel Machek
2015-11-26 21:56 ` Francois Romieu
2015-11-27  8:20 ` Michal Hocko
2015-11-28 14:50   ` Pavel Machek
2015-11-28 14:51   ` [PATCH] Improve Atheros ethernet driver not to do order 4 GFP_ATOMIC allocation Pavel Machek
2015-11-29 21:58     ` Sergei Shtylyov
2015-11-30 13:21     ` Michal Hocko
2015-12-01 20:35       ` David Miller
2015-12-02 22:43         ` Chris Snook
2015-12-03  7:49           ` Pavel Machek
2015-12-03  8:16           ` Michal Hocko
2015-12-03 19:26             ` Chris Snook
2015-11-30 17:58     ` Eric Dumazet
2015-12-01 20:36       ` David Miller
2015-12-03 15:59         ` Pavel Machek
2015-12-03 15:59     ` [PATCH net] atl1c: Improve " Pavel Machek
2015-12-03 16:13       ` Michal Hocko
2015-12-03 17:17       ` Eric Dumazet
2015-12-03 17:32         ` David Miller [this message]
2015-12-04  8:11           ` Pavel Machek
2015-12-04 16:21             ` David Miller
2015-12-04 21:30               ` Pavel Machek
2015-12-04 22:01                 ` David Miller
2015-12-04  8:50       ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151203.123249.2158644928982094593.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@osdl.org \
    --cc=chris.snook@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=eric.dumazet@gmail.com \
    --cc=jcliburn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic-devel@qualcomm.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=ronangeles@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).