Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2508102ima; Mon, 22 Oct 2018 10:54:34 -0700 (PDT) X-Google-Smtp-Source: AJdET5cX/kfbzMxKcVZklFa7qgmRteYBSFNz7dHfCPl653gf3b3xG0z9vfGAfASbmFdymJ6fmujM X-Received: by 2002:a63:8e43:: with SMTP id k64mr4721059pge.346.1540230874901; Mon, 22 Oct 2018 10:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540230874; cv=none; d=google.com; s=arc-20160816; b=YhTwm6BorImBFQPPiyl1//IN7M1glQlCGkPyb/BomYAO4ZoeamFdmsAqlJdU2KRxY0 A8TcjwF4UF/vgWi45wFG0fcej1AgKLE+DaDPxeKR4PJJDZVEHIIcM0N0L+OG0ORcnIU1 V+V4jRfoieNFxB8Op20uFTAj++Ea0BoJle/qFUsBrCnlojqTx4WSSIeuyjd3c+JqvRpo 6VRdEpKEf3ZTyYPTcGElePfoQ9DwKV7j3pzK3pQuqmdJXODDcIXxtN0KXxuvwJTKTAQK tnh1xcuxcp10s6UpkeTq6FJ3Tz0Lhbv1oRVzLzHC8FoFxuVwyh0Pv8fDHigfVCO08qGs vIBg== 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=WUOIFklUIvTAL2Afk9cPJ8hrqdwrtaRsjN6acajM+P8=; b=qC1julymNqxRT4h22nrjEXtpRSBxGeVOvuukKB6j1rwB5Q2Z0Ojr3W4uV6mYkp+/Od G9VL4UegpOn3rqUXCj+nrWHxad9lPv3klUMqPMbO4xP8fFmCSYNPsCDVZpYMi/ycYVt1 Qj65ATHtcUg/sO5eN4M4V5ETLxGzSF7dWtzHDAO4rxu46ZH+aAQAxw6Q3vMKAqeIdaRZ jvdISMiPqpewSGQpEq3qOjJfntZHh3NBrdY1BDgstnwAz0LmyzIkUSHSUzj+Ej3i88CX Ywv2pw2ZqWkAALpH/Zrf7b0A0CGenAM6zc968tRBa0Mb+ohywLOamU1EBgLpP9FDXUqY pE5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=p85zWE8O; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=QAPi5B+q; 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 b7-v6si37153017pfm.93.2018.10.22.10.54.19; Mon, 22 Oct 2018 10:54:34 -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=p85zWE8O; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=QAPi5B+q; 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 S1728805AbeJWBzs (ORCPT + 99 others); Mon, 22 Oct 2018 21:55:48 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:45916 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728628AbeJWBzs (ORCPT ); Mon, 22 Oct 2018 21:55:48 -0400 Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9MHYsmc011500; Mon, 22 Oct 2018 10:36:05 -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=WUOIFklUIvTAL2Afk9cPJ8hrqdwrtaRsjN6acajM+P8=; b=p85zWE8Ouhj9NZxZj8O2VvjvaJabGnKg+w3V9tTC+pzB0LxHS+qCd13Gms3MOmnnKE7/ ZWwZ/D8uIFCuX7sH33JMiv+FU6xr73NBky5Sdtm67docD/YZ0fBQ6pJePGQ5br9VTBpS Aa/kKARJxZHzxDFfv9xyq7EbYoAQb4m/IJo= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 2n9fshrwta-10 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 22 Oct 2018 10:36:05 -0700 Received: from prn-hub06.TheFacebook.com (2620:10d:c081:35::130) by prn-hub06.TheFacebook.com (2620:10d:c081:35::130) 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 10:36:00 -0700 Received: from PRN-CHUB06.TheFacebook.com (2620:10d:c081:35::15) by prn-hub06.TheFacebook.com (2620:10d:c081:35::130) 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 10:36:00 -0700 Received: from NAM01-BN3-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.16) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 22 Oct 2018 10:36:00 -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=WUOIFklUIvTAL2Afk9cPJ8hrqdwrtaRsjN6acajM+P8=; b=QAPi5B+qpjIAHY6gg7j7TMEIxDi2A9uLsdL0FN6D9ryvVt+WZKSgfewA61hRLbsLESiqtSxlJu7BASfqzfiYc2gj7bLm3QZrqUUTCxjbSwnqfxYm+uAVU4MbzD1wVvJ6JcNXbktjMlU0VWUp4RrXaZ+CX97K4Sf8YV51fp9YTqw= Received: from BY2PR15MB0167.namprd15.prod.outlook.com (10.163.64.141) by BY2PR15MB0262.namprd15.prod.outlook.com (10.163.64.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.20; Mon, 22 Oct 2018 17:35:57 +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 17:35:57 +0000 From: Roman Gushchin To: Michal Hocko 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+DbEcbikCQiNZLx8ZaF6Urh5iA Date: Mon, 22 Oct 2018 17:35:57 +0000 Message-ID: <20181022173550.GA9592@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: MWHPR22CA0057.namprd22.prod.outlook.com (2603:10b6:300:12a::19) To BY2PR15MB0167.namprd15.prod.outlook.com (2a01:111:e400:58e0::13) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2620:10d:c090:200::4:c82f] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY2PR15MB0262;20:NQj/MbdRkxC2/5xYqka/cT1065Es+uTRllx0bSORvyVvCnK1TqWQsU3Ct/4gIIFIh1QDLx8B78pf+fIHsx8LJaDVIsIXPcVBtbwwoJraCbs0obI0f6CxwsmUiEfs8C8dsrhRfoGr2DQyato30mut68oxX149yv2MhEPj+OJ7bCo= x-ms-office365-filtering-correlation-id: e0e8f5cb-70c8-46c3-7018-08d63844d309 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY2PR15MB0262; x-ms-traffictypediagnostic: BY2PR15MB0262: 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)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:BY2PR15MB0262;BCL:0;PCL:0;RULEID:;SRVR:BY2PR15MB0262; x-forefront-prvs: 08331F819E x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(376002)(396003)(136003)(366004)(346002)(199004)(189003)(46003)(76176011)(5024004)(4326008)(11346002)(2900100001)(7736002)(386003)(256004)(486006)(25786009)(39060400002)(1076002)(446003)(33656002)(476003)(6116002)(71190400001)(81156014)(71200400001)(8676002)(9686003)(14454004)(2906002)(81166006)(6512007)(6436002)(97736004)(53936002)(478600001)(6486002)(186003)(5250100002)(6246003)(105586002)(86362001)(229853002)(106356001)(33896004)(68736007)(8936002)(305945005)(5660300001)(52116002)(6916009)(7416002)(99286004)(102836004)(6506007)(54906003)(316002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0262;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: 1XEZFkTzSf5herXtsPYet3qievwCdapSds/xSF4EZf38/Pb03H0lQ6Dlrl9NfSVf0PuFvxZyiMrFrq9qAETF1HBrLNjYxe0hnqCdsKfo6ZW0bOKQldcxIuuSaceZd7DbIAHQuvcEwJPWAujtYUFRFwx4GE9ezEJDRTkJm2bPCcB0M229eVXUHrl1C/KCGy6boI7rQSQ6rmtdFYfQ6Ms+oZ1pP6GfmxS/ljZxbW05rTYcN9Gy05ClnLeH+ulKszvbx0CkmjDu1K95qQjIN3LUlrNapQDEoP1nxSSTm1QpnFfFS0Up/1q4639TzQbLEsJjX/Au1MTqGbn+w2U1XhBIWCmlNlcL9mi8Z7llScbWb38= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e0e8f5cb-70c8-46c3-7018-08d63844d309 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 17:35:57.4828 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0262 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 Mon, Oct 22, 2018 at 10:33:22AM +0200, Michal Hocko wrote: > Cc som more people. >=20 > I am wondering why 172b06c32b94 ("mm: slowly shrink slabs with a > relatively small number of objects") has been backported to the stable > tree when not marked that way. Put that aside it seems likely that the > upstream kernel will have the same issue I suspect. Roman, could you > have a look please? So, the problem is probably caused by the unused inode eviction code: inode_lru_isolate() invalidates all pages belonging to an unreferenced clean inode at once, even if the goal was to scan (and potentially free) just one inode (or any other slab object). Spock's workload, as described, has few large files in the pagecache, so it becomes noticeable. A small pressure applied on inode cache surprisingly results in cleaning up significant percentage of the memory. It happened before my change too, but was probably less noticeable, because usually required higher memory pressure to happen. So, too aggressive recla= im was less unexpected. How to fix this? It seems to me, that we shouldn't try invalidating pagecache pages from the inode reclaim path at all (maybe except inodes with only few pages). If an inode has a lot of attached pagecache, let it be evicted "naturally", through file LRU lists. But I need to perform some real-life testing on how this will work. Thanks!