Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751804AbbKVIos (ORCPT ); Sun, 22 Nov 2015 03:44:48 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34397 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbbKVIoq (ORCPT ); Sun, 22 Nov 2015 03:44:46 -0500 From: Shunqian Zheng To: peppe.cavallaro@st.com Cc: linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, netdev@vger.kernel.org, dianders@google.com, ZhengShunQian Subject: [RFC PATCH v1] Trying to fix the stmmac memory leak during suspend/resume Date: Sun, 22 Nov 2015 16:44:17 +0800 Message-Id: <1448181858-5935-1-git-send-email-zhengsq@rock-chips.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1893 Lines: 48 From: ZhengShunQian When I run Suspend-to-Ram stress test on my Rockchip RK3288(SoC) board that integrated stmmac ethernet, it always OOM after a few iterations, usually 50 times is enough to reproduce. Compiled kernel with KMEMLEAK feature, I got the logs as below: unreferenced object 0xed89ac00 (size 192): comm "busybox", pid 79, jiffies 2251 (age 54.580s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 d1 ed 00 00 00 00 00 00 00 00 ................ backtrace: [] kmemleak_alloc+0x44/0x78 [] kmem_cache_alloc+0x1ac/0x264 [] __build_skb+0x38/0x9c [] __netdev_alloc_skb+0xac/0x118 [] init_dma_desc_rings+0xcc/0x474 [] stmmac_resume+0xc4/0x14c [] stmmac_pltfr_resume+0x3c/0x40 [] platform_pm_resume+0x3c/0x50 [] dpm_run_callback+0x7c/0x160 [] device_resume+0x174/0x1c0 [] dpm_resume+0x110/0x2cc [] dpm_resume_end+0x1c/0x28 [] suspend_devices_and_enter+0x53c/0x6ec [] pm_suspend+0x334/0x478 [] state_store+0xac/0xc8 [] kobj_attr_store+0x1c/0x28 Actually I don't think I know net/stmmac good enough to fix this bug. I really appreciate that the exports of net/stmmac can take over it if you think it is a bug too. ZhengShunQian (1): net: stmmac: Free rx_skbufs before realloc drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) -- 1.9.1 -- 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/