Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5278036imu; Tue, 29 Jan 2019 16:24:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN5KkHvuLXxtu17zvbONaCiFjaNn2+rLk85nexxPMD+ErYBlzN5wZ+9IO30MWfqG1LwZI6L9 X-Received: by 2002:a63:4e41:: with SMTP id o1mr26241538pgl.282.1548807858205; Tue, 29 Jan 2019 16:24:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548807858; cv=none; d=google.com; s=arc-20160816; b=Z1UIJWP5hteoK7HhBd2zeAAUeC8X3nDJF6Tvhu0AWswqzenoFdmBU99aYX1IyrP/39 gJD39UCLDXOVBqeetUdjQTRxqy+D5QneT0jB37GE+CAQFnAchMru1Fjre14v495oNwer B8+sat/ZDG8JdtVxp5mv5qzQKGftYT3D8+9eenWXD2C0zpXSFm68UP2lbDws1gF0Tz8b biUmtVgRgNr+94loT88bZRFT3jgT8zfBylu/UfNk/U3FbolSWzyg8O0V6TOHPMhy619s 9JD+T3pynMG1shNGwdiySyIT/h7JcV419molkhe/ey8qSTGWjD5R1nZzeixsCHBObb4j NsEA== 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:dkim-signature; bh=EegVelnyvrKDkR5jEv97mZvgbmU9h9IG3+6MUWPsjeI=; b=xErbZPLmFge55NGtLB6uR8lS3rpAf/cBoanyOCMr1REagX4FTeTpd0mP+6dwPXUIt5 91owcdYsiU1vHcFW+WEFrDJUHOsg9Ts4s1Wa6oQhUwR3JyjO18vL4M2u2Q9aRzvEPbIz WD6ANWgiYnnbxKGhAtbby31D/pbCMr1+h15zAL+efWNgkeVCkAJftbKYHWj8xMkumuJc sTlqJAG/yrs/3V5Wviw5E4Xdn5GkAFuEN6TA/zYUKVeA1r4lUzcwWsoFOKKVMB/Lo0C4 ir3AeJSAoUi0akQAtsV6+aHN/L+WKiG41qoChS3PBHl56Dxfxb0wvuYYKTIDeKzmsd1H OhNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jmp5v6OD; 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=pass (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 193si21483572pfa.256.2019.01.29.16.24.01; Tue, 29 Jan 2019 16:24:18 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=jmp5v6OD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727525AbfA3AX7 (ORCPT + 99 others); Tue, 29 Jan 2019 19:23:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:39544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727148AbfA3AX6 (ORCPT ); Tue, 29 Jan 2019 19:23:58 -0500 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8A7F820881; Wed, 30 Jan 2019 00:23:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548807837; bh=uRNu24/8CQ88tUh3cvXgGy7RgmiCGkf93XVlmmgKdmw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jmp5v6ODdLkL2P+d3BycB5vJN3owR2gpeSZqp35VIljUJF93dAhsvh5wR3Erknh5f zwvgdhA+nsU8OnQk1o3ic48FpbqlBJ6s0g+SKea2oZ4qHUnYkNIg7PqOvpPJZ7Bhes +C6MmCrgjD7Fwq7JfXiKNxxPzINlwiJ9cr0ao9u8= Date: Tue, 29 Jan 2019 19:23:56 -0500 From: Sasha Levin To: Greg KH Cc: Michal Hocko , Roman Gushchin , 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: <20190130002356.GQ3973@sasha-vm> References: <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> <20181102174823.GI28039@dhcp22.suse.cz> <20181102193827.GA18024@castle.DHCP.thefacebook.com> <20181105092053.GC4361@dhcp22.suse.cz> <20181228105008.GB15967@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20181228105008.GB15967@kroah.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, Dec 28, 2018 at 11:50:08AM +0100, Greg KH wrote: >On Mon, Nov 05, 2018 at 10:21:23AM +0100, Michal Hocko wrote: >> On Fri 02-11-18 19:38:35, Roman Gushchin wrote: >> > On Fri, Nov 02, 2018 at 06:48:23PM +0100, Michal Hocko wrote: >> > > 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? >> > >> > This part works as expected. But the following >> > scan = div64_u64(scan * fraction[file], denominator); >> > reliable turns 1 page to scan to 0 pages to scan. >> >> OK, 68600f623d69 ("mm: don't miss the last page because of round-off >> error") sounds like a good and safe stable backport material. > >Thanks for this, now queued up. > >greg k-h It seems that 172b06c32b949 ("mm: slowly shrink slabs with a relatively small number of objects") and a76cf1a474d ("mm: don't reclaim inodes with many attached pages") cause a regression reported against the 4.19 stable tree: https://bugzilla.kernel.org/show_bug.cgi?id=202441 . Given the history and complexity of these (and other patches from that series) it would be nice to understand if this is something that will be fixed soon or should we look into reverting the series for now? -- Thanks, Sasha