Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3945340imu; Mon, 28 Jan 2019 13:53:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN6U2nROJ3xH6pCuNUV2INtutUFWw5g2Ndffw2p+nrgqC9+IrxPELmoO2nBdi5icE5Va68Vw X-Received: by 2002:a63:2ac9:: with SMTP id q192mr21411987pgq.58.1548712419918; Mon, 28 Jan 2019 13:53:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548712419; cv=none; d=google.com; s=arc-20160816; b=fYmrO4TnEhOfuiDrvwqIExikuPn/mqf1xgMqfm9gyxqh76D7V2aYPPPGRo32jo08lf gQKy7HcOL/ONO7LR/w3LIotRWysbmlzFpPRSgabsFkNP+pwK+oAz3iDy2B7A43R58MEp RdBI1sDG+f/Pwaby636skGqzp9zA6/emkLJ/1u+xSQfpyW27+He+aU/2bOyHmDBRzMlo 5MA4uHE64SDL+Kwshd6V0+TDHXxCVRYwke7oKbWKiXRSayy9t+XfjUB5RZRDQ4NW9v23 Kb7O2V1SB2s3IKev2LmZn4fJKNvAothk7RvFXqCSj4J2exMDVoyfFFNoKRhFzjfOHML0 gRGA== 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:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:dkim-signature; bh=LfhIbcF3M8aVM48F9+/YcRQvZsDVHnk6M8q59YUonQw=; b=q30PPtG/rncvrpEfOvEpciz2h6upQJ4Rej13cWDM7m4Oa4LBTi3ytuKFeMixXHasXE iUTwZhib3o5qG+/s34eAfZHdxY8yE+3HqQvV2mb0T3nnT9c+rSOK48/0w4ptPfRp2pVE jAFRp/T217KNdCrwMuu3YGQl2kafbOTnamewDucloL0Gqbr1oIzwqRqlAI8R3u+x6sPX 25MjSeiM/ccsKnxjGS27D6QMduR1U0nCVW0ynmBP4sJj4w7dQa6VvI/lcEgZF4jEzqV9 FijcOLumQaLt7w5889LANp6KAtw4fTxUJ84VO7UUK7ZBbuPEEGHS80lgL8TS2wKqZYvz ZCOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=JsV9D11I; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=K9ps7GQK; 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 f21si11631828pgb.371.2019.01.28.13.53.24; Mon, 28 Jan 2019 13:53:39 -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=@fb.com header.s=facebook header.b=JsV9D11I; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=K9ps7GQK; 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 S1727041AbfA1VxP (ORCPT + 99 others); Mon, 28 Jan 2019 16:53:15 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:49446 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbfA1VxP (ORCPT ); Mon, 28 Jan 2019 16:53:15 -0500 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0SLirqh020306; Mon, 28 Jan 2019 13:53:10 -0800 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=LfhIbcF3M8aVM48F9+/YcRQvZsDVHnk6M8q59YUonQw=; b=JsV9D11IV2vMLN9eMA5RW4i5XBGbxXM2QJmvzXQZ0djf9wD+glfmcQI1zeOa4PHh/LON sbun26Dp8vDVdx727ngAjV4CAqjWMQqQbzWO2oxT7fR8T6raQ7yKspmrOD+PJlB209o7 OAKio4KU00g+zxPa7QsdN2BKNDMjWVFgR0Y= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2qa71f0nfj-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 28 Jan 2019 13:53:10 -0800 Received: from frc-mbx06.TheFacebook.com (2620:10d:c0a1:f82::30) by frc-hub01.TheFacebook.com (2620:10d:c021:18::171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.1531.3; Mon, 28 Jan 2019 13:52:42 -0800 Received: from frc-hub06.TheFacebook.com (2620:10d:c021:18::176) by frc-mbx06.TheFacebook.com (2620:10d:c0a1:f82::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.1531.3; Mon, 28 Jan 2019 13:52:41 -0800 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.1531.3 via Frontend Transport; Mon, 28 Jan 2019 13:52:41 -0800 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=LfhIbcF3M8aVM48F9+/YcRQvZsDVHnk6M8q59YUonQw=; b=K9ps7GQKknaMfI4k9y3HvYVKGsO2j2vURVfdPcTruD7DuAOOnPMkdPbiGSg0Ie1EWYtj3NPsTDSjI1fCFoC0J+fKiuFjDoeHoZGrm58E6Or0ibOefYQQykmh3gE7pXo7wM1sMc23lsQwPpKZXSBwYLYDxLAwRZo3B1IU9RtWb/k= Received: from BYAPR15MB2631.namprd15.prod.outlook.com (20.179.156.24) by BYAPR15MB3496.namprd15.prod.outlook.com (20.179.60.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.16; Mon, 28 Jan 2019 21:52:40 +0000 Received: from BYAPR15MB2631.namprd15.prod.outlook.com ([fe80::7459:36fe:91f2:8b8a]) by BYAPR15MB2631.namprd15.prod.outlook.com ([fe80::7459:36fe:91f2:8b8a%6]) with mapi id 15.20.1558.023; Mon, 28 Jan 2019 21:52:40 +0000 From: Roman Gushchin To: Chris Down CC: Andrew Morton , Johannes Weiner , Michal Hocko , Tejun Heo , Dennis Zhou , "linux-kernel@vger.kernel.org" , "cgroups@vger.kernel.org" , "linux-mm@kvack.org" , Kernel Team Subject: Re: [PATCH] mm: Proportional memory.{low,min} reclaim Thread-Topic: [PATCH] mm: Proportional memory.{low,min} reclaim Thread-Index: AQHUs4Zt38UF96mTm0amM4LuPUpLpqXEq9uAgACRwICAAALjgA== Date: Mon, 28 Jan 2019 21:52:40 +0000 Message-ID: <20190128215230.GA32069@castle.DHCP.thefacebook.com> References: <20190124014455.GA6396@chrisdown.name> <20190128210031.GA31446@castle.DHCP.thefacebook.com> <20190128214213.GB15349@chrisdown.name> In-Reply-To: <20190128214213.GB15349@chrisdown.name> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MWHPR21CA0055.namprd21.prod.outlook.com (2603:10b6:300:db::17) To BYAPR15MB2631.namprd15.prod.outlook.com (2603:10b6:a03:152::24) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2620:10d:c090:180::1:3227] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR15MB3496;20:5iA5z/Qj4nXGrh8vODal1Zj8OQgU0oX45GR2IgILXxlyNqhOEx6GYKm6K6mWG6SA8hbkXOlCAiCj0RBsPrzCBjd5Ol8N6CTQ+uPC9o3SUacEOYW5lBZYtZK7c+URsw5rew/ek61IOYph3r06kQKDBrO8WEj19K4ZqNvb17B8v9o= x-ms-office365-filtering-correlation-id: 5ed55505-12ca-48f2-805e-08d6856aec55 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR15MB3496; x-ms-traffictypediagnostic: BYAPR15MB3496: x-microsoft-antispam-prvs: x-forefront-prvs: 0931CB1479 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(376002)(366004)(396003)(136003)(39860400002)(199004)(189003)(51914003)(68736007)(6512007)(54906003)(9686003)(99286004)(186003)(33656002)(25786009)(478600001)(14454004)(53936002)(6246003)(97736004)(6116002)(6916009)(316002)(4326008)(106356001)(105586002)(11346002)(476003)(14444005)(256004)(86362001)(33896004)(6486002)(229853002)(446003)(71190400001)(71200400001)(46003)(102836004)(2906002)(8936002)(81166006)(7736002)(81156014)(1076003)(305945005)(486006)(8676002)(6436002)(6506007)(386003)(76176011)(52116002)(142933001);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR15MB3496;H:BYAPR15MB2631.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: LXMXN4eV1jOswqrPSESsADce4138v6jrblUcKdTNCllQCn32SRz7KZ66ppeBNVJHPdrP5pL8Sx1nZXw3mA8tPRieJRsvciXmcBAU31y/pNmB+ghIKDr9t3rpffdCghT4mrd0MH2Qc54ANWDavt2FVUUNEiMhxOUoyefsheN3iKqOVV3qhTu/a4OWZGqkaj+jY8B7z5WOgnDHqFpL9GnXxGKyEUqURUMTNgWXY9HOMbhnl4Mf1HUAKkJRBki3x2CG+EmugPhmLLPlhVQZFwyl9bfrrflc8T2NXBJURBJNy/5l7bUYBe+0TfQYMq6aLQkUZFHXQX6JYU/j7kcDjJQAB8Dp+kXtUiWNl8lypOac5K0FNt1PYbWZwz/uWDJTk1ymGoU7jlGB0ogrI6nE7me7tgyO8ReIBQ4bi7GYqBEW+74= Content-Type: text/plain; charset="us-ascii" Content-ID: <6FEBCAB4621E644BA86E11E1DCC17B38@namprd15.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 5ed55505-12ca-48f2-805e-08d6856aec55 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jan 2019 21:52:38.8621 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR15MB3496 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-28_12:,, 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, Jan 28, 2019 at 04:42:13PM -0500, Chris Down wrote: > Roman Gushchin writes: > > Hm, it looks a bit suspicious to me. > >=20 > > Let's say memory.low =3D 3G, memory.min =3D 1G and memory.current =3D 2= G. > > cgroup_size / protection =3D=3D 1, so scan doesn't depend on memory.min= at all. > >=20 > > So, we need to look directly at memory.emin in memcg_low_reclaim case, = and > > ignore memory.(e)low. >=20 > Hmm, this isn't really a common situation that I'd thought about, but it > seems reasonable to make the boundaries when in low reclaim to be between > min and low, rather than 0 and low. I'll add another patch with that. Tha= nks It's not a stopper, so I'm perfectly fine with a follow-up patch. >=20 > > > + scan =3D clamp(scan, SWAP_CLUSTER_MAX, lruvec_size); > >=20 > > Idk, how much sense does it have to make it larger than SWAP_CLUSTER_MA= X, > > given that it will become 0 on default (and almost any other) priority. >=20 > In my testing, setting the scan target to 0 and thus reducing scope for > reclaim can result in increasing the scan priority more than is desirable= , > and since we base some vm heuristics based on that, that seemed concernin= g. >=20 > I'd rather start being a bit more cautious, erring on the side of scannin= g > at least some pages from this memcg when priority gets elevated. >=20 > Thanks for the review! For the rest of the patch: Reviewed-by: Roman Gushchin Thanks!