Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1276686

Re: [PATCH v1] net: stmmac: Free rx_skbufs before realloc

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH v1] net: stmmac: Free rx_skbufs before realloc
Date 2015-11-24 19:10 +0100
Message-ID <qyqcp-3aV-1@gated-at.bofh.it> (permalink)
References <qxyvn-1fD-3@gated-at.bofh.it> <qxyvn-1fD-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v1] net: stmmac: Free rx_skbufs before realloc Shunqian Zheng <zhengsq@rock-chips.com> - 2015-11-22 09:50 +0100
  Re: [PATCH v1] net: stmmac: Free rx_skbufs before realloc David Miller <davem@davemloft.net> - 2015-11-24 19:10 +0100
    Re: [PATCH v1] net: stmmac: Free rx_skbufs before realloc Giuseppe CAVALLARO <peppe.cavallaro@st.com> - 2015-11-25 16:20 +0100
      Re: [PATCH v1] net: stmmac: Free rx_skbufs before realloc Giuseppe CAVALLARO <peppe.cavallaro@st.com> - 2015-11-26 11:30 +0100

csiph-web