From patchwork Mon Mar 5 13:37:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 10258937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 00A4A60134 for ; Mon, 5 Mar 2018 13:40:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5DB428A32 for ; Mon, 5 Mar 2018 13:40:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA44228A3A; Mon, 5 Mar 2018 13:40:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72D0528A32 for ; Mon, 5 Mar 2018 13:40:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934041AbeCENi1 (ORCPT ); Mon, 5 Mar 2018 08:38:27 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:39900 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933862AbeCENiV (ORCPT ); Mon, 5 Mar 2018 08:38:21 -0500 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.22/8.16.0.22) with SMTP id w25DY9EV015818; Mon, 5 Mar 2018 05:38:14 -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=bEPJJWAfjCINQZrNS28Dd6+OnvG31+yI3+poaHL4Yqg=; b=TViGXVS15yJVkVVqU9imRwfkuP6Kixrq+aA/1I7W2ecJiLgNTMr+7gnAHhmAbdmJ3AvI j1dqmrNLGw6Rduwcq21EZqXJDYogX+c++vCifM5UeQd5fhPMUp8iBA7mHVegPn7vtSKi Pz+X3DCVNtjt8C+qugab3f9gA/rjMWVA3vA= Received: from mail.thefacebook.com ([199.201.64.23]) by m0089730.ppops.net with ESMTP id 2gh1f58m47-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 05 Mar 2018 05:38:14 -0800 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.13) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 5 Mar 2018 05:38:12 -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=bEPJJWAfjCINQZrNS28Dd6+OnvG31+yI3+poaHL4Yqg=; b=AfLDIkGWGOzjBZK1T3yqASdPL3xlv09U0sA8uYYo786qYDjVX358hVxCyUNSo/ybhHmPfvQ7g0FszOyuSNkuWNf51iDn9zAX0qxLcHyOaoqc3FM7anX+anc3So4/4i5OAmdyrVCtapDWWKHC0b0yI9lduD9927z6WLwh4+4uE9Y= 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:06 +0000 From: Roman Gushchin To: CC: Roman Gushchin , Andrew Morton , Alexander Viro , Michal Hocko , Johannes Weiner , , , Subject: [PATCH 1/3] mm: introduce NR_INDIRECTLY_RECLAIMABLE_BYTES Date: Mon, 5 Mar 2018 13:37:40 +0000 Message-ID: <20180305133743.12746-2-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 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: 3af82e2d-badf-415f-14de-08d5829e54be 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:MWrHlS9zQ1pej2/1uWExDLZIPP6acmf3ntOcKV4wvK3y7rZisY3v7zhVADMBu1gvPsz8SDT24SJZ6I9ZHPZ2wmvK0Qi8yiLJ2cgw2aSGY2O6CEf403n6KchRM1hlBDDcoK7livWpi9VFunxDMWkiISnuPjeZGIT/92OI+Pielhkzt3EyZYm6cussQ5oNVY+BmV2i0gLDsqkx1lREop5L4PpzBfppI/9JFbSN3Jrr2g58eG8FfjexhX3tdJYtPQqq; 25:CL9jWHFF+WoxYx3zvPrSk6E+JeCHlVEVINTerYI2gKZkkouuvI4rfLrdShe0H8A2jcrkJbj4yhn6zdPDKc/kNRpRNN3x06ZmRzGqJq3rytYJwMm7y5hMiyEP//BZ0S8ZrwF+J1cf6RU7Jv0TLANT3zhMiysaRs6j/Mdh4AdZcqML6Ni8r7hi8VC50loEriWd+4piOBGMJPF4DTQFZbCG9LBMCpE47o5ENkz/rK+g8XjUC8+lYY1njznI84WiBl+1aqpr7iJxWVvossx/UXSnhwsXhXDsd88kgeS3sNXdcMmO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ek+r+oy9N/vTCzEXocKnFJ8ciYuY4lP+fHIq1ePusD83lmTZ/XvI09y+6b7lzs439fxCBehyHoZVjZDQpRlEfjwyfuwZmkTXHJUX/BqYd7d2lN+GcxAo3thRAkiEzeNJkyl1qvimLYs54tCJ11+spMqvMQLy5wuUg= 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:hM8CsiWjJ/S+rXPcXoTkDw5b8cHgGvv8LDTd7RlPq?= =?us-ascii?Q?l0u+TIcwXc09Hw4t1B31GeCxUU2AmhPVloYRR4t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SQmnBWTFEI8XocFev039qH0tQ3NSs633Xv2+nwbGOFCMrFmh8NI2FW7B7n7MDy3r3TemyQTF/ZziuEIwKi3XpfSK2DE=; 24:d6Kf2Wm2D5X6kdUk3Pbb8+cmZoassR7QsPfldqZWQ6KgRIbdRYYf+2tmJ1dIErR5zq8zhuryfTwrbx+Ge0PEbOCr9A6agLoYzVH186OplmM=; 7:MWb/4HDqh5KfYjZjJuvqx+QCZ9e/Qa3dTeNAYpR2fR26752tunbWXySn+gkgLtH0CngpWUFNZwhDtlE+Dcxm17vsE56eo9KaBq9WtV63Ku5f3ZDObRrxqsvI3xYFSjLJ4RqqfGcnSEBoXcT98MZcialK5OhYWP49kdRMCOKlOvy60Lx8ychAMdsuv39Akf4YpmVMKkC21i/ue4pBjdQNyvcF5Jb0YZAxhY/rhFDhhgDqOnBoKIv1FQDoCWOCkC/b SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR15MB1076; 20:3fEO9p+t1n70M+59vg3cvBswB6XIgg9q1iXk/okJsAmGWDp8rcUwd9AnDF05YccMIw1zVFuRXrZGBQfNlzkk4UaBa96bxLLKWZCQ16ONjio91k5Gq8vefrAIx/e8LqmOYhKAYRyVwzJ1NZ9n1TfBZ1FOw9dKr2xDzKJeEegulTY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2018 13:38:06.6135 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3af82e2d-badf-415f-14de-08d5829e54be 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces a concept of indirectly reclaimable memory and adds the corresponding memory counter and /proc/vmstat item. Indirectly reclaimable memory is any sort of memory, used by the kernel (except of reclaimable slabs), which is actually reclaimable, i.e. will be released under memory pressure. The counter is in bytes, as it's not always possible to count such objects in pages. The name contains BYTES by analogy to NR_KERNEL_STACK_KB. 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 Acked-by: Roman Gushchin --- include/linux/mmzone.h | 1 + mm/vmstat.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e09fe563d5dc..15e783f29e21 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -180,6 +180,7 @@ enum node_stat_item { NR_VMSCAN_IMMEDIATE, /* Prioritise for reclaim when writeback ends */ NR_DIRTIED, /* page dirtyings since bootup */ NR_WRITTEN, /* page writings since bootup */ + NR_INDIRECTLY_RECLAIMABLE_BYTES, /* measured in bytes */ NR_VM_NODE_STAT_ITEMS }; diff --git a/mm/vmstat.c b/mm/vmstat.c index 40b2db6db6b1..b6b5684f31fe 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1161,6 +1161,7 @@ const char * const vmstat_text[] = { "nr_vmscan_immediate_reclaim", "nr_dirtied", "nr_written", + "nr_indirectly_reclaimable", /* enum writeback_stat_item counters */ "nr_dirty_threshold",