Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2809892ima; Mon, 22 Oct 2018 16:46:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV60KcRoZwYCnvU2uMLlsnkgiFFqN1N+y0D3+WaMwOJhDnU0tjhTIYddYU+qYt4fKMdOeDLY5 X-Received: by 2002:a62:750f:: with SMTP id q15-v6mr225285pfc.70.1540252015414; Mon, 22 Oct 2018 16:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540252015; cv=none; d=google.com; s=arc-20160816; b=luTCy88lPfJFe/cgPyfOHuVWWQ3oCYnJMe+zVYVwYhZzQYN24Y+duRnPLY0RvqNDfk 2Olw6sXIv15KzFmviILjzoaUn/aTftdhXccmHt/Vgo8Cx8pjwwBCOEhJm3Hi3OVj5hMv hW27cTi2ZbkKaDk1uv/q5Dsf8r+JgbpevOWWVR6B8OPJjrO88S1XEMpwG8CaaE7En0+z iXz+ZItyCgYbPbg1h9K1WX+eMqDeNFSth3W1kiTOS2MaV+PXiZE2bnlaDqkazSPklhPl weIkJpTTSzf7RuAYS7H2zxLNvecKZ8fNzoFHrgKJo0gwlAFFhy5BGLreOghS6hWDtgt8 K9vA== 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=6A3eeWqTbkb4uHb+rGFeUy1xYiinB6LS2hceXT9miEU=; b=Rpobi18To6u9oIxbCG0vVuAAfVvRZYGMFxI+hgQNnBGSPa9Pz/E8hl1ezMmQNL+V7h kk4sZV2dK1fQq15V0Zz78l5dNtZgWFU716yIxZHQna/LL8ZqfRoS8xxHZhFzaWzlLwxP nxezbpbXf9v4geujllchLKL4n3/OaSN8NKOIQttaUMCOxQuC8h+n8Jdo8sCAVI0pO1vj YhGYoCYjoZDJn5ldVIhdGpbMbsLDAdi9XoCNMl8lL+Md+6UJeSRSGj9guQhUV65uk1cH KOb53XAZlCcYsCLA1pp3Fi+OxjLtugR7QiAUSzMZL+xspoAOIiPRn4EZNuhmjxp+R9ut tuuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=qRFhj1fa; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=GfsybtWv; 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 t1-v6si14836442ply.279.2018.10.22.16.46.39; Mon, 22 Oct 2018 16:46:55 -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=qRFhj1fa; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=GfsybtWv; 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 S1726742AbeJWIFb (ORCPT + 99 others); Tue, 23 Oct 2018 04:05:31 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:52262 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725752AbeJWIFb (ORCPT ); Tue, 23 Oct 2018 04:05:31 -0400 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9MNZWeO025807; Mon, 22 Oct 2018 16:44:38 -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=6A3eeWqTbkb4uHb+rGFeUy1xYiinB6LS2hceXT9miEU=; b=qRFhj1faw9As1ZDgks1BvJ8Mk3CGu1G6jpbX7+EgqbjrRF1StVsNFh62kbdm+CW81ZRR 5mCsZ8aczpIEzTspSGUn47tHBXb/u45IFSLCuWbtplJ2ewG/qE37JAwgqB7uuUNlRJ5v uJGBP5jTANC8aJYbLgMnWsbzBFboGO/op+0= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2n9myagpew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 22 Oct 2018 16:44:38 -0700 Received: from frc-hub04.TheFacebook.com (2620:10d:c021:18::174) by frc-hub04.TheFacebook.com (2620:10d:c021:18::174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.1531.3; Mon, 22 Oct 2018 16:44:36 -0700 Received: from FRC-CHUB14.TheFacebook.com (2620:10d:c021:18::33) by frc-hub04.TheFacebook.com (2620:10d:c021:18::174) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.1.1531.3 via Frontend Transport; Mon, 22 Oct 2018 16:44:36 -0700 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.34) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 22 Oct 2018 19:44:36 -0400 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=6A3eeWqTbkb4uHb+rGFeUy1xYiinB6LS2hceXT9miEU=; b=GfsybtWveydHNsF7dybhJpjQ6H8LFKciKhNL8XG5zsla1TjPeRwea8kz1aEyvDxDiquSmGG74l8AiqFoS/myDKCZ8ygBtpGdWUizuihr8XVzmPzJnRPlzhOIH4x/JZDHAmyoMLTq7jhQBD0VsRTN3lJn0o993CS5pH33cFVPfBI= Received: from BY2PR15MB0167.namprd15.prod.outlook.com (10.163.64.141) by BY2PR15MB0517.namprd15.prod.outlook.com (10.163.110.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.29; Mon, 22 Oct 2018 23:44:33 +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.1250.028; Mon, 22 Oct 2018 23:44:33 +0000 From: Roman Gushchin To: Spock CC: Spock , "linux-kernel@vger.kernel.org" , Rik van Riel , "Johannes Weiner" , Vladimir Davydov , Shakeel Butt , Andrew Morton , Sasha Levin , Greg Kroah-Hartman , "linux-mm@kvack.org" Subject: Re: Memory management issue in 4.18.15 Thread-Topic: Memory management issue in 4.18.15 Thread-Index: AQHUaeHkHk+DbEcbikCQiNZLx8ZaF6Ur7pMA Date: Mon, 22 Oct 2018 23:44:33 +0000 Message-ID: <20181022234425.GA18716@tower.DHCP.thefacebook.com> References: <20181022083322.GE32333@dhcp22.suse.cz> In-Reply-To: <20181022083322.GE32333@dhcp22.suse.cz> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MWHPR19CA0006.namprd19.prod.outlook.com (2603:10b6:300:d4::16) To BY2PR15MB0167.namprd15.prod.outlook.com (2a01:111:e400:58e0::13) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2620:10d:c090:200::6:b4d] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY2PR15MB0517;20:cPPSSpTyHJw9+v/cXTxgabmAdv5/wcJW2a9O+5ILPuYhA0mUMxeIvcWkIQaHo9sOtuIEeOgLh4Mao6W65u9e7b88Ufk84IxSi6bi215Gug6f40AhS+XEKk/6INtBCi38xM+kvq1fo0dGO2j10jNn0DDbNez9J5+UdGL8Oi6PlFc= x-ms-office365-filtering-correlation-id: 3a4a2af8-5cb2-4dea-e77d-08d6387850fa x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BY2PR15MB0517; x-ms-traffictypediagnostic: BY2PR15MB0517: 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)(8121501046)(5005006)(3002001)(3231355)(11241501184)(944501410)(52105095)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BY2PR15MB0517;BCL:0;PCL:0;RULEID:;SRVR:BY2PR15MB0517; x-forefront-prvs: 08331F819E x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(376002)(346002)(136003)(366004)(396003)(199004)(189003)(2900100001)(5660300001)(1076002)(71200400001)(316002)(7416002)(71190400001)(6916009)(33896004)(305945005)(7736002)(105586002)(76176011)(386003)(6506007)(486006)(106356001)(81156014)(11346002)(9686003)(4326008)(99286004)(39060400002)(476003)(1411001)(33656002)(229853002)(446003)(25786009)(52116002)(8676002)(6512007)(478600001)(14444005)(256004)(97736004)(46003)(6246003)(2906002)(6116002)(54906003)(5250100002)(81166006)(102836004)(14454004)(6486002)(68736007)(53936002)(6436002)(86362001)(8936002)(186003)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0517;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: t6U1hQw61ubzWXCEbxTNAg9fS0H9pJ+eHzWAXihN2WczAoWbC+bnOK8zuQi5GLKVTNPCcbAjB/bloeCJCm41GbFz+elE4uK8m5Q0tLSqCD1aLag1TTlcJiNiGzuy7YVNggDV+oBpX2pcXgeyDuSvBt3c3EeoJssDXEU0qqxDhuQMcnxEmPHieSlAwgYAPbyaojfWzZZ/StrNvenWY6Zi/3gPisATvgYsrBJS6wvlYTSVrGL+XwgeUQd9EFNTSPQS6LuxTSkZVgVRSM+osx9VTRcDbm9l4Y8bpbO1yiCW9BQW1qpivjCCkaiEqia8LOClJw38BnhiTtWbhCpOkPEWNOmz8AOL7MxJ3WXqn+NwUYM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <84C62170042B2E42977CC9963F954C9C@namprd15.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3a4a2af8-5cb2-4dea-e77d-08d6387850fa X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 23:44:33.2230 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0517 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-22_11:,, 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 Sat 20-10-18 14:41:40, Spock wrote: > > Hello, > >=20 > > I have a workload, which creates lots of cache pages. Before 4.18.15, > > the behavior was very stable: pagecache is constantly growing until it > > consumes all the free memory, and then kswapd is balancing it around > > low watermark. After 4.18.15, once in a while khugepaged is waking up > > and reclaims almost all the pages from pagecache, so there is always > > around 2G of 8G unused. THP is enabled only for madvise case and are > > not used. Spock, can you, please, check if the following patch solves the problem for you? Thank you! -- diff --git a/fs/inode.c b/fs/inode.c index 73432e64f874..63aca301a8bc 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -731,7 +731,7 @@ static enum lru_status inode_lru_isolate(struct list_he= ad *item, } =20 /* recently referenced inodes get one more pass */ - if (inode->i_state & I_REFERENCED) { + if (inode->i_state & I_REFERENCED || inode->i_data.nrpages > 1) { inode->i_state &=3D ~I_REFERENCED; spin_unlock(&inode->i_lock); return LRU_ROTATE;