public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: David Miller <davem@davemloft.net>, <zhengsq@rock-chips.com>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-rockchip@lists.infradead.org>, <netdev@vger.kernel.org>,
	<dianders@google.com>
Subject: Re: [PATCH v1] net: stmmac: Free rx_skbufs before realloc
Date: Wed, 25 Nov 2015 16:13:08 +0100	[thread overview]
Message-ID: <5655D004.4040502@st.com> (raw)
In-Reply-To: <20151124.130924.1365382562223060152.davem@davemloft.net>

Hello

On 11/24/2015 7:09 PM, David Miller wrote:
> From: Shunqian Zheng <zhengsq@rock-chips.com>
> Date: Sun, 22 Nov 2015 16:44:18 +0800
>
>> From: ZhengShunQian <zhengsq@rock-chips.com>
>>
>> The init_dma_desc_rings() may realloc the rx_skbuff[] when
>> suspend and resume. This patch free the rx_skbuff[] before
>> reallocing memory.
>>
>> Signed-off-by: ZhengShunQian <zhengsq@rock-chips.com>
>
> This isn't really the right way to fix this.
>
> I see two reasonable approaches:
>
> 1) suspend liberates the RX ring, although this approach is less
>     desirable
>
> 2) resume doesn't try to allocate already populated RX ring
>     entries
>
> Freeing the whole RX ring just to allocate it again immediately
> makes no sense at all and is wasteful work.

This is a bug in this driver version that, to be honest, we fixed with
the first approach on STi kernel.
The patch just called the dma_free_rx_skbufs(priv) in the suspend.
I can give you this patch that is tested on my side too.
But! I do think we should move on second approach.
Indeed, also on ST platforms, when we play with suspend states
the DDR although in self-refresh the data are not lost at all.
No reason to free and reallocate all in suspend/resume.
I can test that and then provide another patch to this mailing list
asap.

Let me know.
peppe


  reply	other threads:[~2015-11-25 15:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-22  8:44 [RFC PATCH v1] Trying to fix the stmmac memory leak during suspend/resume Shunqian Zheng
2015-11-22  8:44 ` [PATCH v1] net: stmmac: Free rx_skbufs before realloc Shunqian Zheng
2015-11-24 18:09   ` David Miller
2015-11-25 15:13     ` Giuseppe CAVALLARO [this message]
2015-11-26 10:26       ` Giuseppe CAVALLARO

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=5655D004.4040502@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=davem@davemloft.net \
    --cc=dianders@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=zhengsq@rock-chips.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