Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2507978imd; Fri, 2 Nov 2018 12:39:52 -0700 (PDT) X-Google-Smtp-Source: AJdET5fRddx0GlG7fS17YYcVsRjPJmklMOvVOshSb16Jk212shIgKjQcGe3QxURiMuoPIzY6RhWz X-Received: by 2002:a63:7154:: with SMTP id b20mr12054116pgn.342.1541187592683; Fri, 02 Nov 2018 12:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541187592; cv=none; d=google.com; s=arc-20160816; b=TNqRf14T/LUH/CDQDuBd2mL7i2B6p9qAq0vxGwPcxQ+AWwvPzoDdUoeNIERHuBtTQP cBTx7AebUJg35i1JQUyj1ef8oSNRA+H6CdCw/xnc2z1cTscvSihJlpuimb9OVkqHrMQw wExhd8cXquE1NGEemU84qqoScQFOSkfTebKptyUm39IQFw63qeE5gxJ8XgfS1CtkmFIv rJBmNdrJoJoRLOQwwbmhX3H+kxLzt5jQXfTdJG1RamRai5pN6KgKxvSjeFymwyPATKrK 16yh/VOI3mRhi+vUi1bOwhko2esml2wv0RCiZVDa59KKTp4i/JU9dM/l6BVjIxJRtGEW uzJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-signature; bh=N9Dp2eOl8eCan2QEUva8IP9EmOMRCkpvCqtvLs7T32U=; b=bTWXdsSxE9gr0EVhDqgsSPdHZ7lXVpD6Omen/s/Wa8SPGjKkaiKKUZLm1YuUwx2szW QCtglDJKQX1dgNKN8mSwNuWJc5ngRwLRHgyvl8Pbhekxj7pTcTRh35kxyogL0qTneklH fAU8Evnuoizsj96R6dPlXXPYYCftoUdR102e2MrgScml6Yqld7ZDoKND352SKi6YxZAM Rzqba7kob+ocnfv/yNsmMkx62c31PX0X2qYi6raCrS8G1Ckzgj2HSPQqbYVyq183yTaB xRiD0PS4XUXo0OMIGROPm3Ejn2yCNkExCuLWQs2Z6nEN62vC1KFrWGXTIhE7PmESvRb6 AP9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=mnM2iE6a; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=hcSVbOne; 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=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10-v6si26226358pll.334.2018.11.02.12.39.37; Fri, 02 Nov 2018 12:39:52 -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; dkim=pass header.i=@fb.com header.s=facebook header.b=mnM2iE6a; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=hcSVbOne; 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=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726603AbeKCErn (ORCPT + 99 others); Sat, 3 Nov 2018 00:47:43 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:54026 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbeKCErn (ORCPT ); Sat, 3 Nov 2018 00:47:43 -0400 Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wA2JZ1HK002062; Fri, 2 Nov 2018 12:38:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=facebook; bh=N9Dp2eOl8eCan2QEUva8IP9EmOMRCkpvCqtvLs7T32U=; b=mnM2iE6acQ6RaK/atrjkQKyvn5Gu1U593LehkC2VZWzR4E0k8+d46IFwjKJ6abi6htl0 JN4aqXv3saxqI7CMiHszO6JNrr5zrps9wEp6hn7RsieYl6J9z0FEbpS/c17M5Co2xzIN g+7LvX9tk2tJiK1mvfDjN7zRnDrEsy6+wBg= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2ngtc90j97-17 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 02 Nov 2018 12:38:48 -0700 Received: from prn-hub02.TheFacebook.com (2620:10d:c081:35::126) by prn-hub02.TheFacebook.com (2620:10d:c081:35::126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.1531.3; Fri, 2 Nov 2018 12:38:41 -0700 Received: from PRN-CHUB05.TheFacebook.com (2620:10d:c081:35::14) by prn-hub02.TheFacebook.com (2620:10d:c081:35::126) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.1.1531.3 via Frontend Transport; Fri, 2 Nov 2018 12:38:41 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.15) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 2 Nov 2018 12:38:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N9Dp2eOl8eCan2QEUva8IP9EmOMRCkpvCqtvLs7T32U=; b=hcSVbOnen0QsGQkde6zFzfGiFy9SP/G6bjLS6p0CxGRuWKOIUSncRTyMUGBTtXFLtFMo5CXDq1Y2GsgErmzWK0nPHymSpmCFMvOSflvJYskuzIrAqV0HTdkRF/OPohz/nURsr/KVpU3nX13joUvtd9C1AOMVKRLDtc37XFgaf2o= Received: from BY2PR15MB0167.namprd15.prod.outlook.com (10.163.64.141) by BY2PR15MB0728.namprd15.prod.outlook.com (10.164.170.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Fri, 2 Nov 2018 19:38:35 +0000 Received: from BY2PR15MB0167.namprd15.prod.outlook.com ([fe80::8e8:753:f746:ed14]) by BY2PR15MB0167.namprd15.prod.outlook.com ([fe80::8e8:753:f746:ed14%2]) with mapi id 15.20.1273.030; Fri, 2 Nov 2018 19:38:35 +0000 From: Roman Gushchin To: Michal Hocko 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? Thread-Topic: Will the recent memory leak fixes be backported to longterm kernels? Thread-Index: AdRyQEG5VIfdELkdR3eQ5BGm0rZVc///mGwAgACTWwCAAFjogIAADIgAgAB8LwD//41GgIAAfX+A//+UKoCAAHungIAAHsQA Date: Fri, 2 Nov 2018 19:38:35 +0000 Message-ID: <20181102193827.GA18024@castle.DHCP.thefacebook.com> 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> <20181102174823.GI28039@dhcp22.suse.cz> In-Reply-To: <20181102174823.GI28039@dhcp22.suse.cz> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MWHPR0201CA0057.namprd02.prod.outlook.com (2603:10b6:301:73::34) To BY2PR15MB0167.namprd15.prod.outlook.com (2a01:111:e400:58e0::13) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2620:10d:c090:200::7:a49] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY2PR15MB0728;20:ZHGi024nVnEj3ViX5D9lQJbuWA7zl6fJkNSy9XOn8xAez7enel9uQABa/3XUqRvlGnuEM3gc1E27Jw1qPOe2dU2qeQQ75poyd4OweNZlJP4mB/D3Akhv54ExshwjKYhISlnH7YLmOqr81TBy8ve8i56+TtugjIZdK4RvC1RryqQ= x-ms-office365-filtering-correlation-id: a287286c-b2f1-4033-14e3-08d640fac769 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BY2PR15MB0728; x-ms-traffictypediagnostic: BY2PR15MB0728: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823302103)(10201501046)(3231382)(11241501184)(944501410)(52105095)(3002001)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:BY2PR15MB0728;BCL:0;PCL:0;RULEID:;SRVR:BY2PR15MB0728; x-forefront-prvs: 08444C7C87 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(376002)(366004)(396003)(39860400002)(136003)(199004)(189003)(86362001)(4326008)(81166006)(81156014)(478600001)(106356001)(54906003)(46003)(6916009)(8676002)(105586002)(229853002)(476003)(8936002)(11346002)(14454004)(446003)(186003)(7416002)(6512007)(9686003)(486006)(53936002)(52116002)(71190400001)(5660300001)(25786009)(2900100001)(6246003)(76176011)(71200400001)(6436002)(6506007)(386003)(68736007)(2906002)(7736002)(93886005)(6486002)(102836004)(305945005)(99286004)(97736004)(1076002)(33656002)(256004)(33896004)(39060400002)(6116002)(316002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0728;H:BY2PR15MB0167.namprd15.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: fb.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: sbvunmiyZoi2m3VJpFE9K3h1VNEw3DKULE9j6x8/zUFHp/PTiZgjhi8gxP2OG1lhT/CGCGrEq/+6rJabSsH8gSCadJk0McnuxLBcH8GZt+1dHu5vkB6y/zLATSjMDc3WHD3pmVg1RDWJCVDTRhZwZ9B4qia/KQ1OwImXxqHU493EfIL1byFfxfaR1gHFH2oFl1YpeInEMpRajdoKJq+hsavepMdkAEoIyjSTAXiQ0OEtVl5YpSG/tDep3tqw+3kVF2vZDqAiQytK2KopmAn75/FjK1D5XGfZglfh03IAvvGvHha5BDlo+Q5ZrJGNVpA7KPkjhWkyUSvIBcUgdG0gF1Fsjh9RywTRR76bsAGjuHs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <91355EADA23A1D47A4B5ABA6759992D0@namprd15.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a287286c-b2f1-4033-14e3-08d640fac769 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2018 19:38:35.6413 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0728 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-02_13:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 end= ed up with > > > > 1-page long LRU, it can stay there basically forever. > > >=20 > > > Why=20 > > > /* > > > * If the cgroup's already been deleted, make sure to > > > * scrape out the remaining cache. > > > */ > > > if (!scan && !mem_cgroup_online(memcg)) > > > scan =3D min(size, SWAP_CLUSTER_MAX); > > >=20 > > > in get_scan_count doesn't work for that case? > >=20 > > No, it doesn't. Let's look at the whole picture: > >=20 > > size =3D lruvec_lru_size(lruvec, lru, sc->reclaim_idx); > > scan =3D 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 =3D min(size, SWAP_CLUSTER_MAX); > >=20 > > If size =3D=3D 1, scan =3D=3D 0 =3D> scan =3D min(1, 32) =3D=3D 1. > > And after proportional adjustment we'll have 0. >=20 > 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 =3D div64_u64(scan * fraction[file], denominator); reliable turns 1 page to scan to 0 pages to scan. And this is the issue which my patches do address. Thanks!