From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758309AbcEFPLR (ORCPT ); Fri, 6 May 2016 11:11:17 -0400 Received: from mga14.intel.com ([192.55.52.115]:41112 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757910AbcEFPLP convert rfc822-to-8bit (ORCPT ); Fri, 6 May 2016 11:11:15 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,587,1455004800"; d="scan'208";a="974130157" From: "Odzioba, Lukasz" To: Michal Hocko CC: "Hansen, Dave" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "Shutemov, Kirill" , "Anaczkowski, Lukasz" Subject: RE: mm: pages are not freed from lru_add_pvecs after process termination Thread-Topic: mm: pages are not freed from lru_add_pvecs after process termination Thread-Index: AdGgo2TVXttFnfzXSCKoCVtWFlAf9///+AIAgAFnVQCABi40AP/8X4QQgAdEuoCAALQegP/93Xig Date: Fri, 6 May 2016 15:10:00 +0000 Message-ID: References: <5720F2A8.6070406@intel.com> <20160428143710.GC31496@dhcp22.suse.cz> <20160502130006.GD25265@dhcp22.suse.cz> <20160504203643.GI21490@dhcp22.suse.cz> <20160505072122.GA4386@dhcp22.suse.cz> In-Reply-To: <20160505072122.GA4386@dhcp22.suse.cz> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTk1NTM0YzUtZDFlYi00NWQ3LWJkZTItYjVlYWYzNTc4MmI4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImpaYkdPN01JbnI3MGg3cWtKeVwvSXpxOVwvb2pMK1JuWmZwajJXOE9kMko5ST0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 05-05-16 09:21:00, Michal Hocko wrote: > Or maybe the async nature of flushing turns > out to be just impractical and unreliable and we will end up skipping > THP (or all compound pages) for pcp LRU add cache. Let's see... What if we simply skip lru_add pvecs for compound pages? That way we still have compound pages on LRU's, but the problem goes away. It is not quite what this naïve patch does, but it works nice for me. diff --git a/mm/swap.c b/mm/swap.c index 03aacbc..c75d5e1 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -392,7 +392,9 @@ static void __lru_cache_add(struct page *page) get_page(page); if (!pagevec_space(pvec)) __pagevec_lru_add(pvec); pagevec_add(pvec, page); + if (PageCompound(page)) + __pagevec_lru_add(pvec); put_cpu_var(lru_add_pvec); } Do we have any tests that I could use to measure performance impact of such changes before I start to tweak it up? Or maybe it doesn't make sense at all ? Thanks, Lukas