Received: by 10.223.185.116 with SMTP id b49csp2632339wrg; Mon, 5 Mar 2018 06:19:29 -0800 (PST) X-Google-Smtp-Source: AG47ELvFj/2T85ZxOYpvG9UQ4AjBv/scgYPn74Io/L+r0qUmt46BD8u716WP4MjfCg27Z1oNLxOh X-Received: by 2002:a17:902:407:: with SMTP id 7-v6mr13399404ple.9.1520259569873; 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=X/4vOEfDD7K0PpJwlot3CLzsBjCD88z/sI1hTddb5SmUrm+5Ku2f1V/IVjMVJxKJCO nwRmDasv7d+/0i2oda2loqK7AOXTWkyaM0zwbAwAuQDiH02CVBF2o0HyGaqDt1brZkC9 r0IlWNRqvdJkpd8O1YW3DK3v0xJi6tYLAAjnxqstsD4IvY/K7Wyq1P1V2zHWK7T3zok7 wtI23Rq2kSTQ7AVbHRjMc00KBvxivks4NhKYl8qnTrcdP7jqTl86GCo45jI89/lLHJlb W1S1EqrtFhuRhSCMBO0pigZdKkW0qUtkNXpNRbdu06oRYcUu2Si29pVz1uFgucKA5FqE Xlfw== 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=bEPJJWAfjCINQZrNS28Dd6+OnvG31+yI3+poaHL4Yqg=; b=jkuuqioMwYr8TgGrZ7tcdcXIbqT4jk7W5sVBM8dOuDp3y9zmz9MCNL0XuDBPMIREle xwucFeLknRIiJ3H46o2oq+mGy/dgQtOEHgjRPrfd3DKPkD30AuZfFnhjNeGFV7onW8x1 oA4g2kWbWGUzuRarXKrv3kVicziHWQZo6GEzQcH5Zvvd3dBUvtsrbYI2Owjh4FUEyUVC XuR6TTF3wCwJKfZ0VwKouAnQyOdY21uehmNkbg1sZMjcIeY3M8NF8LRWGxs3/uoCSW5/ u5IQhhrre+QfFTm4UyaxyjFLcBOyLPszS7i8kr8T3VzuwOmg3zuE9M6cfVZTw1hhYw+7 g8PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=TViGXVS1; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=AfLDIkGW; 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 f18si1676777pgt.481.2018.03.05.06.19.15; 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=TViGXVS1; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=AfLDIkGW; 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 S935101AbeCENi2 (ORCPT + 99 others); Mon, 5 Mar 2018 08:38:28 -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 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: 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+lYY1njzn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39aovfnz19jOdlXLMbC07rQsS5aO5x0d6Ua72yd8L1MjAenReMROPek+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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EqCFM3ZF4bwZXXd+0229JjA8qC2lHs+BFlOtaVJ1pEfSQmnBWTFEI8XocFev039qH0tQ3NSs633Xv2+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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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", -- 2.14.3