Received: by 10.223.185.116 with SMTP id b49csp2632538wrg; Mon, 5 Mar 2018 06:19:43 -0800 (PST) X-Google-Smtp-Source: AG47ELtK0IkRU3zI7aKx+aV+iGd2mm4+Ncx0Bk1cJNBhKxsUjaU4w8c/IbVNXR09JvUf3aEFDifd X-Received: by 10.99.186.73 with SMTP id l9mr12099453pgu.83.1520259583171; Mon, 05 Mar 2018 06:19:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520259583; cv=none; d=google.com; s=arc-20160816; b=PMO4lGxzIbKaRpSuYQKruSzlbWP3gwb3tNDtFvfhnFOO3tSF3gQ3QgO2jt6XXZzZv5 RATH0QQHK4mfFJDnOLACIOVuwxKfWlOlVl9fp+GMaNejd2fitfyf3pc3nP1BTsncHI4Q bB7biMVaxdm7nS2Th/lIsxgue43d/Rl8o3R7U03S9Zho+sBmqfoLtV9QOwd8x+HQfu5M deQVGnBkBQ4GqWJA89tNBbSBaqpZmF4dDWk3INUVGytQHtKk8DKe98gsb7SMxBWUykxk X7DKfQbwP1xCZ0GrXDaZIqfRWadc5D0JZKA8X/B6uXY37hsrwIv3AorI+mZpjQcL1Wyd bpNA== 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=JlbBq7oqh2YEWB2ZieD9MubO2SNHuqoDTAD9EbQckipus+FAtS8kt2LtxPeUohKPhm cCUjZRMjpk+lBbHBz55jgaqTMsrb7a/TQhWySokx0J+7ytIJWeLv8ksAPUbbD5MpAM6q ZaYA8w7c24DGkw3oM+kVYtZumTUVZ9wTTGI8X2tIKkuaZ9WRjMN9EmX/hpYWLoHDYpqd AOdh7dLhOmEc3EHvA22xmAifKwvadcESR26XRgpJhUGQy9X3pPHEMdRu2GLBcbVRpYbA QIUj/8HHhTPu9AZ9CIs4Md0Tw68KZqSo1t5EMPJsqmB+/o+qFINrS3WN8FCZX4HcrpET y3CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=EnOEYrcO; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=V6/jvf1A; 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 b12-v6si9279620plx.355.2018.03.05.06.19.28; Mon, 05 Mar 2018 06:19:43 -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=EnOEYrcO; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=V6/jvf1A; 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 S934349AbeCENkh (ORCPT + 99 others); Mon, 5 Mar 2018 08:40:37 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:52584 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933100AbeCENiW (ORCPT ); Mon, 5 Mar 2018 08:38:22 -0500 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.16.0.22/8.16.0.22) with SMTP id w25DbO7E028261; Mon, 5 Mar 2018 05:38:16 -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=EnOEYrcOPWjc3kgJhs2fpD9UDt/u1VY96tKiDNX2z1r7HfCEIgfPrFf9ocUjqjzNcE2n /KnE9wwai8XDjARW2ijUexTHPFy+T7uYczpyEr6nBqoRg+eLeAytZ6Uzs6ep9WojxEeo CQ+yj5/EoOfmnoahQ+GAOnWj73pdj4Ryzqk= Received: from maileast.thefacebook.com ([199.201.65.23]) by m0001303.ppops.net with ESMTP id 2ggkrjhwtv-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 05 Mar 2018 05:38:16 -0800 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.24) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 5 Mar 2018 08:38:14 -0500 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=V6/jvf1A0byBgfaNz8yzVEMomCEjJwqpT4N9MINMee63g9w6Bgz/yn+LBi5/E1LfklmxDa771kgFQ+Fj7nf5QgrEhn/c/TcS/RynJBXmR8jHorcPqcHpHK/2lC0pG3YjXfiBj/6LbKWMV8NODs8adRA7OcSiDWL+8FpA7Xhi8Co= 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:08 +0000 From: Roman Gushchin To: CC: Roman Gushchin , Andrew Morton , Alexander Viro , Michal Hocko , Johannes Weiner , , , Subject: [PATCH 2/3] mm: add indirectly reclaimable memory to MemAvailable Date: Mon, 5 Mar 2018 13:37:41 +0000 Message-ID: <20180305133743.12746-3-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: 53a82108-a68b-46dd-f605-08d5829e55e0 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:/GGbY5ncdamxxYUV+rNg1grn3tvQvg04vU3bRc8QlFLEv5PJYv/qR5sFlOCDLRgN6tnOn2pofs81tcNX0NQq0HvLQyXY4w0NQ+wF+O+zodKS7qk1e+ynEGVxwJ1H8LrlxWSCQYb93l6bcPl0IIT9rGzn3YjhIRdjXvjv1KkmGZ7A3ICkB6ieQX8TOfjvVoc7yEzbxnXDX0adFEhWCiIDNUX2MKkJb47SDIjZSlF6POdy2UnuvxJaqRb2JJknBagV;25:92sfIn3fPEFxMHI2Bd6JZTXtDcJ5663RtyB8/8ge2tN6wEEZmIwqGLNFMcj4tTSfbxBhfU9JAV0ecdLRaAkblc3Mu1FiwCglLHKm16vWOgDJd0zWaopy4neKxrfCEa1pt89FWeRr596djCw2OYEOk8Kzl4VonL/CKsiy0YcVv4IuOGfG4bgEd05a8jSMpJI6sK6T4N2y7fAOn82iVtiH1J3UVDX1lfgCmOXgFC3qGFl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mpXKW7JdA/e51Vw1BymNLYWmj6yibhmjXykMoscPbW7bGbYN0gdYWaqr5g2R0V8JfpgsoMy31GAapQyHoQrjHmZRpFjoiNL2cAbtr/H0EpwtyZ+4w5KIwZaSsQUgSY3CXW9aGT6VFCaYSi2COVyVBy3DpOmlvlzN4uDjen4s8/xyAPL0kGFi08y5g2eBYaQf81RKju1M1qFE= 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:L33LeEpP/oT1SWApvrc1P5wkprSxUl3oG2my9s5ey?= =?us-ascii?Q?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hWQdkywm6zJS4ndZqyVY55JsfxxqGxbBLpTG5HryixjZXjUqGnJgJywU4lBFPJTSkhRAurqJnVLNxSygzNQuaWjpERSg2FADmMQPS4t7KI3aEGagX7a3iTTMlVR5icrz5Yn6LGGkWs8=;24:UgqpnnRV1B1bj1aM85uMCO82mWBS6PisR4YRPqGCMwz6ExnVb4+cLcCw0oaGd+rgAgNo9Lg71MXuT59qOZegWz9UJ04/3aQMsFM6iNIhHFg=;7:5Z1XWj7WLmJkbSBRAdNFhpMJviWFJSYKAtnf95KMvy6raiJVVzsjcOrpbHQhIgIVZ/uDmiBtKREab3BO2b25Dh6MYmqo+YHABoBV989nwYF24pTVEmsbvoi16ZCCoYN6A88V9pIYUAbPBFWfOiG1YZCj2ySqVCxVIemVjcakVLzc8A6LPOrSg1Hv3ZBJPOJCdMs5EIvWdonisUSim0Yn2OvyfiRJiusiXUxDzTCctlZlpXMONtXaWvcerT4rxk9b SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1076;20:a5xHMUWA7GX2Kiu2MX5U5DfRhV/W6j1Kd5+cZZR1LiUexQe0RArP6a6ya5wrkguU/S4WJ6SwgIo+qwpIAkP8QLWwPbN6vLr/lfR7ydaCUMNrSMF1I9GHGE0UAdxqglkmiwui6iKhnQcozA4N6wJRwGdouCKOCYOi12BX081bvcw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2018 13:38:08.5199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53a82108-a68b-46dd-f605-08d5829e55e0 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