From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sat, 16 Jul 2016 23:47:40 +0900 From: Minchan Kim To: Jens Rottmann CC: Lukasz Odzioba , Sasha Levin , , Michal Hocko , , Subject: Re: 4.1.28: memory leak introduced by "mm/swap.c: flush lru pvecs on compound page arrival" Message-ID: <20160716144740.GA29708@bbox> References: <83d21ffc-eeb8-40f8-7443-8d8291cd5973@ADLINKtech.com> MIME-Version: 1.0 In-Reply-To: <83d21ffc-eeb8-40f8-7443-8d8291cd5973@ADLINKtech.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-ID: On Fri, Jul 15, 2016 at 09:27:55PM +0200, Jens Rottmann wrote: > Hi, > > 4.1.y stable commit c5ad33184354260be6d05de57e46a5498692f6d6 (Upstream > commit 8f182270dfec432e93fae14f9208a6b9af01009f) "mm/swap.c: flush lru > pvecs on compound page arrival" in 4.1.28 introduces a memory leak. > > Simply running > > while sleep 0.1; do clear; free; done > > shows mem continuously going down, eventually system panics with no > killable processes left. Using "unxz -t some.xz" instead of sleep brings > system down within minutes. > > Kmemleak did not report anything. Bisect ended at named commit, and > reverting only this commit is indeed sufficient to fix the leak. Swap > partition on/off makes no difference. > > My set-up: > i.MX6 (ARM Cortex-A9) dual-core, 2 GB RAM. Kernel sources are from > git.freescale.com i.e. heavily modified by Freescale for i.MX SoCs, > kernel.org stable patches up to 4.1.28 manually added. > > I tried to reproduce with vanilla 4.1.28, but that wouldn't boot at all > on my hardware, hangs immediately after "Starting kernel", sorry. > However there is not a single difference between Freescale and vanilla > in the whole mm/ subdirectory, so I don't think it's i.MX-specific. I > didn't cross-check with an x86 system (yet). I didn't have 4.1 stable tree in my local so just looked at git web and found __lru_cache_add has a bug. Please change static void __lru_cache_add(struct page *page) { struct pagevec *pvec = &get_cpu_var(lru_add_pvec); page_cache_get(page); if (!pagevec_space(pvec) || PageCompound(page)) <== __pagevec_lru_add(pvec); put_cpu_var(lru_add_pvec); } with static void __lru_cache_add(struct page *page) { struct pagevec *pvec = &get_cpu_var(lru_add_pvec); page_cache_get(page); if (!pagevec_add(pvec, page) || PageCompound(page)) <== __pagevec_lru_add(pvec); put_cpu_var(lru_add_pvec); } -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751668AbcGPOro (ORCPT ); Sat, 16 Jul 2016 10:47:44 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:57533 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751481AbcGPOrm (ORCPT ); Sat, 16 Jul 2016 10:47:42 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.98.204 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Sat, 16 Jul 2016 23:47:40 +0900 From: Minchan Kim To: Jens Rottmann CC: Lukasz Odzioba , Sasha Levin , , Michal Hocko , , Subject: Re: 4.1.28: memory leak introduced by "mm/swap.c: flush lru pvecs on compound page arrival" Message-ID: <20160716144740.GA29708@bbox> References: <83d21ffc-eeb8-40f8-7443-8d8291cd5973@ADLINKtech.com> MIME-Version: 1.0 In-Reply-To: <83d21ffc-eeb8-40f8-7443-8d8291cd5973@ADLINKtech.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/07/16 23:47:38, Serialize by Router on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/07/16 23:47:38, Serialize complete at 2016/07/16 23:47:38 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 15, 2016 at 09:27:55PM +0200, Jens Rottmann wrote: > Hi, > > 4.1.y stable commit c5ad33184354260be6d05de57e46a5498692f6d6 (Upstream > commit 8f182270dfec432e93fae14f9208a6b9af01009f) "mm/swap.c: flush lru > pvecs on compound page arrival" in 4.1.28 introduces a memory leak. > > Simply running > > while sleep 0.1; do clear; free; done > > shows mem continuously going down, eventually system panics with no > killable processes left. Using "unxz -t some.xz" instead of sleep brings > system down within minutes. > > Kmemleak did not report anything. Bisect ended at named commit, and > reverting only this commit is indeed sufficient to fix the leak. Swap > partition on/off makes no difference. > > My set-up: > i.MX6 (ARM Cortex-A9) dual-core, 2 GB RAM. Kernel sources are from > git.freescale.com i.e. heavily modified by Freescale for i.MX SoCs, > kernel.org stable patches up to 4.1.28 manually added. > > I tried to reproduce with vanilla 4.1.28, but that wouldn't boot at all > on my hardware, hangs immediately after "Starting kernel", sorry. > However there is not a single difference between Freescale and vanilla > in the whole mm/ subdirectory, so I don't think it's i.MX-specific. I > didn't cross-check with an x86 system (yet). I didn't have 4.1 stable tree in my local so just looked at git web and found __lru_cache_add has a bug. Please change static void __lru_cache_add(struct page *page) { struct pagevec *pvec = &get_cpu_var(lru_add_pvec); page_cache_get(page); if (!pagevec_space(pvec) || PageCompound(page)) <== __pagevec_lru_add(pvec); put_cpu_var(lru_add_pvec); } with static void __lru_cache_add(struct page *page) { struct pagevec *pvec = &get_cpu_var(lru_add_pvec); page_cache_get(page); if (!pagevec_add(pvec, page) || PageCompound(page)) <== __pagevec_lru_add(pvec); put_cpu_var(lru_add_pvec); } From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f200.google.com (mail-io0-f200.google.com [209.85.223.200]) by kanga.kvack.org (Postfix) with ESMTP id 596B36B0260 for ; Sat, 16 Jul 2016 10:47:42 -0400 (EDT) Received: by mail-io0-f200.google.com with SMTP id q83so269805793iod.2 for ; Sat, 16 Jul 2016 07:47:42 -0700 (PDT) Received: from lgeamrelo13.lge.com (LGEAMRELO13.lge.com. [156.147.23.53]) by mx.google.com with ESMTP id z75si541346ioz.219.2016.07.16.07.47.40 for ; Sat, 16 Jul 2016 07:47:41 -0700 (PDT) Date: Sat, 16 Jul 2016 23:47:40 +0900 From: Minchan Kim Subject: Re: 4.1.28: memory leak introduced by "mm/swap.c: flush lru pvecs on compound page arrival" Message-ID: <20160716144740.GA29708@bbox> References: <83d21ffc-eeb8-40f8-7443-8d8291cd5973@ADLINKtech.com> MIME-Version: 1.0 In-Reply-To: <83d21ffc-eeb8-40f8-7443-8d8291cd5973@ADLINKtech.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-ID: To: Jens Rottmann Cc: Lukasz Odzioba , Sasha Levin , stable@vger.kernel.org, Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org On Fri, Jul 15, 2016 at 09:27:55PM +0200, Jens Rottmann wrote: > Hi, > > 4.1.y stable commit c5ad33184354260be6d05de57e46a5498692f6d6 (Upstream > commit 8f182270dfec432e93fae14f9208a6b9af01009f) "mm/swap.c: flush lru > pvecs on compound page arrival" in 4.1.28 introduces a memory leak. > > Simply running > > while sleep 0.1; do clear; free; done > > shows mem continuously going down, eventually system panics with no > killable processes left. Using "unxz -t some.xz" instead of sleep brings > system down within minutes. > > Kmemleak did not report anything. Bisect ended at named commit, and > reverting only this commit is indeed sufficient to fix the leak. Swap > partition on/off makes no difference. > > My set-up: > i.MX6 (ARM Cortex-A9) dual-core, 2 GB RAM. Kernel sources are from > git.freescale.com i.e. heavily modified by Freescale for i.MX SoCs, > kernel.org stable patches up to 4.1.28 manually added. > > I tried to reproduce with vanilla 4.1.28, but that wouldn't boot at all > on my hardware, hangs immediately after "Starting kernel", sorry. > However there is not a single difference between Freescale and vanilla > in the whole mm/ subdirectory, so I don't think it's i.MX-specific. I > didn't cross-check with an x86 system (yet). I didn't have 4.1 stable tree in my local so just looked at git web and found __lru_cache_add has a bug. Please change static void __lru_cache_add(struct page *page) { struct pagevec *pvec = &get_cpu_var(lru_add_pvec); page_cache_get(page); if (!pagevec_space(pvec) || PageCompound(page)) <== __pagevec_lru_add(pvec); put_cpu_var(lru_add_pvec); } with static void __lru_cache_add(struct page *page) { struct pagevec *pvec = &get_cpu_var(lru_add_pvec); page_cache_get(page); if (!pagevec_add(pvec, page) || PageCompound(page)) <== __pagevec_lru_add(pvec); put_cpu_var(lru_add_pvec); } -- 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