Received: by 10.223.185.116 with SMTP id b49csp2632333wrg; Mon, 5 Mar 2018 06:19:29 -0800 (PST) X-Google-Smtp-Source: AG47ELtgt9WVYo9HSqq1BRCJArWSYUe9qVfuhVZDXeLu/othe+CIU4YOX9DkLjazrTf82ezEXb1t X-Received: by 10.99.122.71 with SMTP id j7mr12193825pgn.151.1520259569408; Mon, 05 Mar 2018 06:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520259569; cv=none; d=google.com; s=arc-20160816; b=EaTMEsFrGKoxSFVekvTmXgXGoCdzVdJIVH9CyyDJR0ctXimTrPmJUC7iPYaZh60dA2 1cer959kp559Ju4JlxMFLveafjNoi/SIHigPMErWbZhh/M/zXAPU8ppWFZxdmpfOJK0F FErU0ylzXh6RswI8qpse/05rBevOMjsXVd/xuVH90cXnCSVKN2FajBpALIo1+w7gkq4z FqherqKXKLAdK/2pSH0QL8kdck0fsBZV/e6HGXMXilMoraRex4oux88gOWPdy9pplVXw 1jn03CD0emUnXtMQP4UW7X8oAd6cB2+0dYouB9Ds7BDurn8YmzH54w/FsTe+Wxijp28I GiDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :arc-authentication-results; bh=B1HW+FKhTL7H4m+wJ5ooxeW3AoNnYy3YopsqumtO+fY=; b=Py/DSqcQs/2ZAFS0xO9pLdFPrDgqGPs0ozqpiNSZZi54T3yn1uo9E7iEDKZJPwXzOB 6Ple/yhULTcXJX61tJGLXPkgfOGMVZYRwQOtDUnlJWLGLA7LR/Kx81kYSoMtXxj7cprH MC2fcI66quNtAv7oEQCKAwCFR4s/Zb4KJ9h3feqezCWbpNL3W/pRtojC7fYu+cKKsk9v KE9OYUpozn/cyg6smcv4t9QDzY3y9rdzwMTb2GilTVA1tL54a18iD1iMWJRQBMOMLtRc PwJcyU35o0VIV71MTJ1I5TxOGA9KQ3+Vd9sRMYe+PbBMgA0G0s9rPiNwB98jG2LBVINU B6Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=dRVWnwYh; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=E77pEoPz; 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 s3si7884547pfi.32.2018.03.05.06.19.14; Mon, 05 Mar 2018 06:19:29 -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=dRVWnwYh; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=E77pEoPz; 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 S964922AbeCENig (ORCPT + 99 others); Mon, 5 Mar 2018 08:38:36 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:53834 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932954AbeCENi0 (ORCPT ); Mon, 5 Mar 2018 08:38:26 -0500 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w25DcKvq022741; Mon, 5 Mar 2018 05:38:20 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=B1HW+FKhTL7H4m+wJ5ooxeW3AoNnYy3YopsqumtO+fY=; b=dRVWnwYheqLFFos+nBsnCqdoj278MzoECv4bkLYoS93Bw/QkA6NXhup3ULM4xshf/r0p x4QMTX13NRzhMjC+HQFQR6IUeG1fVRGKzFQy/axNmGa22BDzEK4EpOBjzunTk1fCs6Ic dxDYHuRnH67fYexy0y34iz8G7q5cDYnVVKE= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2gh0gu0pq1-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 05 Mar 2018 05:38:19 -0800 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.18) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 5 Mar 2018 05:38:15 -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; bh=B1HW+FKhTL7H4m+wJ5ooxeW3AoNnYy3YopsqumtO+fY=; b=E77pEoPzQ4LahM1MC6iJga6nggfoDACPXLMSDGQH77iUnFY6oVVWuaNKY49BMmoiJ7R6INk5WKocWz2uuhfaLlFJQtCDbc/KCh60/rhZV1WX9o8GJgsp6TrTYmCsNEej5XYitF1gKLQRwyw+WRdoX+HckH+AJ7liq52kYL4OMLE= Received: from castle.thefacebook.com (2620:10d:c092:200::1:ec6d) by BL2PR15MB1076.namprd15.prod.outlook.com (2603:10b6:201:17::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Mon, 5 Mar 2018 13:38:10 +0000 From: Roman Gushchin To: CC: Roman Gushchin , Andrew Morton , Alexander Viro , Michal Hocko , Johannes Weiner , , , Subject: [PATCH 2/3] mm: treat indirectly reclaimable memory as available in MemAvailable Date: Mon, 5 Mar 2018 13:37:42 +0000 Message-ID: <20180305133743.12746-4-guro@fb.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180305133743.12746-1-guro@fb.com> References: <20180305133743.12746-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c092:200::1:ec6d] X-ClientProxiedBy: VI1PR02CA0076.eurprd02.prod.outlook.com (2603:10a6:802:14::47) To BL2PR15MB1076.namprd15.prod.outlook.com (2603:10b6:201:17::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0de66e3c-1f49-4d44-c301-08d5829e570f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:BL2PR15MB1076; X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1076;3:Pn6SVUG7H02kJd67+O6clksHoZkhSbGpvRzhGS7h/eKp//D4ZDFm00dZGP3xYz7Juy34xlHetQ9Z3qNeIqaKKst46wEFscjAZvsAlvCXCC1LLmD1ZbfVpKwOwwlNValRZ1cfZh/u+EO98xE5fladAMp8KcBi4Vo8+tV/kkZb8bxAyXXMlkNhM4JcMs7PctkVSYgNB59OYCnZl0zF445tdy+1o2bvZ0a0bXQejdZzcZVIYMv7OWGMAKKVNwkHffK2;25:Fiv1mr8H20FHG09DYY4WXqTPrpO5vo+mDyDukcEZIM6vWwdIsAMw8kKDmZxxUIlPEDhxI/dJ5lbGNXwQHK/LwHKelv6Ki7NKEkCMrKyBDqoIP5J4DQx1uCkvTJ5mUuZlzU2mYZ37edpd3jxFmdxjldSKepzyqX60+nPV/vQKxdlZBSp1N8sqxF8bZ3w6eLVvlVsl1r1mLnkO6mg85BieLqvmt+brg46ZbHpkcWsGkIRiElqglg6Yy5uwWchnxuhRld28ub6jiTcP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GgtKWCMZK3rwgKA9Q/54I01AhgcZl2mHrHlCW/kNW9veTpYJjQ8pDkrBPYo/QZpBMw/CY8HZybR9MwDd1iaMnRHzE5xdUExzWamWz3fSGDSyHSZRSTiPfpND8t29uZXu4pOhDmvR4UaNIuSmvc7td++HbBYUVQwzrc5z4xBPPDH9D1kKe3yJAAE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231220)(11241501184)(944501244)(52105095)(10201501046)(3002001)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:BL2PR15MB1076;BCL:0;PCL:0;RULEID:;SRVR:BL2PR15MB1076; X-Forefront-PRVS: 06022AA85F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(39380400002)(366004)(346002)(376002)(189003)(199004)(8936002)(47776003)(50466002)(1076002)(50226002)(48376002)(7736002)(16526019)(186003)(4326008)(305945005)(8676002)(81156014)(81166006)(2906002)(6506007)(386003)(2950100002)(5660300001)(2351001)(478600001)(36756003)(106356001)(2361001)(6666003)(6916009)(6116002)(6486002)(16586007)(316002)(97736004)(54906003)(52396003)(76176011)(52116002)(46003)(51416003)(53936002)(6512007)(69596002)(105586002)(25786009)(68736007)(86362001)(53416004)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR15MB1076;H:castle.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR15MB1076;23:7H0Ift8Y+MbDuCyepBRpQxubIRIJFkAtXxwyxgkdN?= =?us-ascii?Q?djt1mobvnD2G6KtNdB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Q?7KdV19xnxqeSzNUUyOjaUhKWcM6MQIkNlPuojVLfQOzmLRIpY1TaJjWbF1ge?= =?us-ascii?Q?n2uLy14E0mQOwHi+6b3N0CqYaTu6u+u/snvfT14HpRN3PlqBrB701PagnLoj?= =?us-ascii?Q?arxhHZC/iAkWf1NCbzP3hm/CFP7E6KmjJm6tid7H1mxXggFWi/kIDwtWdqOa?= =?us-ascii?Q?U3pjoyhV5W4Prg18rE7XMJ70X7WbVG7+CTInCyNqTdOCc0E5PKnw8gOIWKAH?= =?us-ascii?Q?XVdmQq8zFJK7GPkHlzVnmmIAIFrM4o/QIYCO2TWx8XlevP32T5dT4d1QQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Antispam-Message-Info: MrMptHuYtaGIh5e9N3ZfD6z3aNLQGH7xIaEcNhWEdy0yjC7Mg1ATZYzy1l2Klf81soc94L5VhVRMhZ3i82RIUwMZZiuEfPnEQ4w83NthisAlOhR8VLZD0IrdVFBasarSEJ1PmYtai7eogojzQSf8L5Ea6S7vbIfesGcFbHD+z5yaW70U4vq+kqO9EZHYNIf8 X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1076;6:PIl6s2cqh03DFAG0tis3jA0SVQfrx2kkVff328Tcn4NLA41szewGmJXaHODLduqFVEKMSdGH7pK2WphIUuUewrklXkyfVzATtBeJOGmSm3EX/WMg8zCyaEP1bevV9KMUswF7gZfFbt61suVxvwp0ntAGTMW2igtFwq6hxesOQivReG+A5A8lmwbQ0l8izSNYBbugAqYSaFWDHajZcc90zw18SGystoraCKgt/U4Eenm7KUeSoiSHtnLXVRL8yiXcWXDJfarAX9753JNiaddHPOaEj35gGIlO2eZxPJzHBx5UUUJqo6eY9AREvT37cm+9qKuynxX+AdzvWqeFdO7H9EcyWkmQiLVpfzg+9hUO23E=;5:/IBEFnOPep4WQnj0cmVSrvSz+9JN7vt7BkWtQQoeQQ8QqRbkUq23FysXgkYXX9UKiTDHesljawp+Djt80j3gYifNejtDR9uY1hj3w3C6SVgd/Ewgf264zpHpXigJtrSSEalLNh4Zp6qhe7Ja9ldqr+x6zaF13WwNNYLYGHiN11s=;24:4f54Mtw93BWBAqoclYSs9orlnYA4BqaUZhMWKu89FJWwOWox6wIM1o4REp/UKJN3c/pLQh8l8hrBUN3c4amXkoc3+BjXjk3iClK44v4fBiM=;7:7CUE6Jwo4BMrbgDA00dqczAzWaw/j9/yuKbmyIsm5HmLwgZ7mslFvk8KGIQyR/Huksa7HeKd+LhdhA9YNUOmEJr/ULoj74KoMEBnb6H3rY9gWK8xzTkdZU+Dtpj9x9SdF/bGR/J1QM0DnFCyzefqGfo0RmtTBv+LPFLDHU2EMKlTkFgQUMbndTy6b55dMhsmKk9aCtCIP+ECeh9pVsif4B5wlW4eXOmtdIse+dk9ALWhDVoRJhtKnOxy1cWgf5OH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1076;20:3tQvQJJXs5Fq7xEy5DLemXjGVAzfrnapz2KZ8XvoqNirqJKIgkjjJGFSPwpPj8B8DpCEBVFQN+ZJ4teEDV+97479a2hD9PnVUTciL1FAWIEg/JKiyRPXHFFug5YXc8J1pMBXjj1sfRwOuRMMdJTqMrDec0enIyMPkxYpOv2wo4U= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2018 13:38:10.5043 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0de66e3c-1f49-4d44-c301-08d5829e570f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR15MB1076 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-05_05:,, 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 This patch adjusts /proc/meminfo MemAvailable calculation by adding the amount of indirectly reclaimable memory (rounded to the PAGE_SIZE). Signed-off-by: Roman Gushchin Cc: Andrew Morton Cc: Alexander Viro Cc: Michal Hocko Cc: Johannes Weiner Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org Cc: kernel-team@fb.com --- mm/page_alloc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2836bc9e0999..2247cda9e94e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4695,6 +4695,13 @@ long si_mem_available(void) min(global_node_page_state(NR_SLAB_RECLAIMABLE) / 2, wmark_low); + /* + * Part of the kernel memory, which can be released under memory + * pressure. + */ + available += global_node_page_state(NR_INDIRECTLY_RECLAIMABLE_BYTES) >> + PAGE_SHIFT; + if (available < 0) available = 0; return available; -- 2.14.3