Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2405758imd; Fri, 2 Nov 2018 10:49:03 -0700 (PDT) X-Google-Smtp-Source: AJdET5cJmrbyEuwLS6wlZzk1l4JsBcocDKUX8tGnTVStVe/zxpVNRT/b2PjyQ+iB3OE8I4CSjRzN X-Received: by 2002:a17:902:bb88:: with SMTP id m8-v6mr12200239pls.120.1541180942894; Fri, 02 Nov 2018 10:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541180942; cv=none; d=google.com; s=arc-20160816; b=b40EStZVt2psa4Kr+XrKdmq9wwl8Qw3vgjXA/YH/sRuzX122cbRvGhlBBmar7zYFOD mgIJVJeY8fxCnwpzdSpL6pPz3YcySXQ97AdiDKEgWSuqSS5EwaSN3sJTTjhzTDalgXBd ie7i6SwJ66sqdRtiB61s2DoTADpdwGtYYsjbPy1/PTjd5EibIcdbYSiL4Srnr6McazgV kPA1jt1T4rSBo9cg6k0SSZ3lAk5hbEeGrzaArXNeR6tvLwHusn4COzLlKz04NRJRqcrk kvaT/7C8dAUDKqHgiRy3G7hVxyJCmfGswO3NB3JdlPRKyjAeUzWvRar/zL+CGLyp9x9u Pfzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cAGbFt6UwnpE7C/Ct1sQdn2rZXLswWN5MQQSUcJvHT0=; b=iibDcA924ltN4Fd+eKw49aRaqRzZdzXQxLf3wM1DCKa+vE/8kx0iCvIR9gRzmzpE6T DEsQnkX4yvzoBss+Hh1XiYTQn/9ghjKjSbE8w+9+zXFb+4cBxvfyU8vpvlI4Ou6u9HAd fCHaXWMGSFETPgaz9uevlRYYglKzdjwUacbDavd0EUdm4JhMyd6d3CAf7xLbv46yVSB0 Y+dPDB5C3nkiHGD+Sq7xSvdSesCa0RreTH8yUgLN7wr+UKsw6zAA4/49b70mTG+1+Dhp hnx5PfMTdH7cu1TKuqlbYFLfw7dC7qb+sM3g6do68BNil2M89ue+CWNFdco7HjDnWybX YoTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4-v6si16067775plc.277.2018.11.02.10.48.47; Fri, 02 Nov 2018 10:49:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727966AbeKCC4Y (ORCPT + 99 others); Fri, 2 Nov 2018 22:56:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:38510 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726700AbeKCC4Y (ORCPT ); Fri, 2 Nov 2018 22:56:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0669AAF77; Fri, 2 Nov 2018 17:48:23 +0000 (UTC) Date: Fri, 2 Nov 2018 18:48:23 +0100 From: Michal Hocko To: Roman Gushchin Cc: Dexuan Cui , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Kernel Team , Shakeel Butt , Johannes Weiner , Tejun Heo , Rik van Riel , Konstantin Khlebnikov , Matthew Wilcox , "Stable@vger.kernel.org" Subject: Re: Will the recent memory leak fixes be backported to longterm kernels? Message-ID: <20181102174823.GI28039@dhcp22.suse.cz> References: <20181102005816.GA10297@tower.DHCP.thefacebook.com> <20181102073009.GP23921@dhcp22.suse.cz> <20181102154844.GA17619@tower.DHCP.thefacebook.com> <20181102161314.GF28039@dhcp22.suse.cz> <20181102162237.GB17619@tower.DHCP.thefacebook.com> <20181102165147.GG28039@dhcp22.suse.cz> <20181102172547.GA19042@tower.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181102172547.GA19042@tower.DHCP.thefacebook.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 02-11-18 17:25:58, Roman Gushchin wrote: > On Fri, Nov 02, 2018 at 05:51:47PM +0100, Michal Hocko wrote: > > On Fri 02-11-18 16:22:41, Roman Gushchin wrote: [...] > > > 2) We do forget to scan the last page in the LRU list. So if we ended up with > > > 1-page long LRU, it can stay there basically forever. > > > > Why > > /* > > * If the cgroup's already been deleted, make sure to > > * scrape out the remaining cache. > > */ > > if (!scan && !mem_cgroup_online(memcg)) > > scan = min(size, SWAP_CLUSTER_MAX); > > > > in get_scan_count doesn't work for that case? > > No, it doesn't. Let's look at the whole picture: > > size = lruvec_lru_size(lruvec, lru, sc->reclaim_idx); > scan = size >> sc->priority; > /* > * If the cgroup's already been deleted, make sure to > * scrape out the remaining cache. > */ > if (!scan && !mem_cgroup_online(memcg)) > scan = min(size, SWAP_CLUSTER_MAX); > > If size == 1, scan == 0 => scan = min(1, 32) == 1. > And after proportional adjustment we'll have 0. My friday brain hurst when looking at this but if it doesn't work as advertized then it should be fixed. I do not see any of your patches to touch this logic so how come it would work after them applied? -- Michal Hocko SUSE Labs