Received: by 10.192.165.156 with SMTP id m28csp2209855imm; Thu, 12 Apr 2018 10:21:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx49r2r49luACHQOs6Dls/K6/EzGFTv/KKzA34sTIfTPWtHDUFrqxPluO5jJbIzrbk1BCztnq X-Received: by 10.99.95.5 with SMTP id t5mr1343126pgb.295.1523553672741; Thu, 12 Apr 2018 10:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523553672; cv=none; d=google.com; s=arc-20160816; b=a5OjocQvTMjdMqTnE/XSz2U3ANSwYJn84owMDh8zR00bXKvq9E8oDmPyZjskkDJrw/ PSiM9X5fFYvsfdIguF8e0fkOdkMSL9Bj/Fm/jSVv96OZc+0zaNXdX4JHQb/kWsdE1vZv frTjQjTr5u4i0droQW2HvUSgesOFits2tsPNhcoI333IFAhKpPEytRfUt9tohkwbFJX0 wwyLvyUJo67qlXqqTTmKHDVe3x9iEbAMnlVWLUwxuYrp0nFip5IDsrMUyvU8v+hP3oUB 3CGajks348DmyYyU9OyZGuZg6u0MxLN+IvGJ8Nd3N92OphnBHOvljpA9UekkcOS507bZ qL+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature:arc-authentication-results; bh=nLQFBFTdtllZVAjehn2kcZdLjyWKh7Xyo6ZpSmTznPE=; b=zA45KYSbgol7XvCtVuVhF+ug0Om1zIZa+K4a9MnbTJZeWu2/Ry+7u6CdEqaQnZ2sz9 FcCjxZNzQtt5Z6st7LS7luPk1cWcvTTPZY/3oI8v2CiraQ8r7pMl0Mu0EcQocvWGb25j +r7wNNqMHy7+cFaibzoxuC65FiQDjBi+jW6hJ8y0c7wHkriPcL4ATXzkEKBhY0cOTm91 RYMgvjNOAIo/cdTp3/RGNWxIBQx65qjOJ1hDKuuuu3SrmVpW2F4VAwuBqKfR56nQkj1m lmp917e8i5q/J52CM8u/8Z0VyMcv5CPbO9XTgDCCOUz3rp6OqytLu8lfJU4rw2cYD+nt 7R6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=a+R+Ii98; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=KBHl6Yx6; 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 o1-v6si3701997plb.459.2018.04.12.10.20.58; Thu, 12 Apr 2018 10:21:12 -0700 (PDT) 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=a+R+Ii98; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=KBHl6Yx6; 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 S1753164AbeDLO5l (ORCPT + 99 others); Thu, 12 Apr 2018 10:57:41 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:35696 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752824AbeDLO5i (ORCPT ); Thu, 12 Apr 2018 10:57:38 -0400 Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3CEse0g031296; Thu, 12 Apr 2018 07:57:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=nLQFBFTdtllZVAjehn2kcZdLjyWKh7Xyo6ZpSmTznPE=; b=a+R+Ii98MLrQ2TifDcMF4ynjqDU+uWCJK9I/E+Ooef0g2oaaZCuWJqEBip8ZvIsOq6fm JiN0V9ew2lBNn76nXcAduDQ+hShKlMDXR3N0AzhuBDyUHD0SMKPDiAlrv0o3gMrtnd/0 KOHQphqS8ZMIaNfKo8D3PmPV2WqdpcFgwwg= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2h9jet01t5-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 12 Apr 2018 07:57:25 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.29) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 12 Apr 2018 10:57:22 -0400 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=nLQFBFTdtllZVAjehn2kcZdLjyWKh7Xyo6ZpSmTznPE=; b=KBHl6Yx6iRbzeaKAT2Iv2qP/zqE/kAJA6BNjGh4JFcjPr68r7wfnJz/CalUUpenWY56M4D9Sc4IGQSLe6ZSN/K3hiJ5j64kJ/mVAQ7kPhel4ImnODSbLAKn1apYNwvK40FyJuSI/WYH4zMInKAeKdiSu2eKEr/LIYq6FtIJ5QFo= Received: from castle.DHCP.thefacebook.com (2620:10d:c092:200::1:978a) by CO1PR15MB1077.namprd15.prod.outlook.com (2a01:111:e400:7b66::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.11; Thu, 12 Apr 2018 14:57:15 +0000 Date: Thu, 12 Apr 2018 15:57:03 +0100 From: Roman Gushchin To: Vlastimil Babka CC: , Andrew Morton , Alexander Viro , Michal Hocko , Johannes Weiner , , , , Linux API Subject: Re: [PATCH 1/3] mm: introduce NR_INDIRECTLY_RECLAIMABLE_BYTES Message-ID: <20180412145702.GB30714@castle.DHCP.thefacebook.com> References: <20180305133743.12746-1-guro@fb.com> <20180305133743.12746-2-guro@fb.com> <08524819-14ef-81d0-fa90-d7af13c6b9d5@suse.cz> <20180411135624.GA24260@castle.DHCP.thefacebook.com> <46dbe2a5-e65f-8b72-f835-0210bc445e52@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <46dbe2a5-e65f-8b72-f835-0210bc445e52@suse.cz> User-Agent: Mutt/1.9.2 (2017-12-15) X-Originating-IP: [2620:10d:c092:200::1:978a] X-ClientProxiedBy: DB6PR04CA0019.eurprd04.prod.outlook.com (2603:10a6:6::32) To CO1PR15MB1077.namprd15.prod.outlook.com (2a01:111:e400:7b66::7) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:CO1PR15MB1077; X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB1077;3:ImpfKmDQt/2WhCnPYUDUXbsfZe7hn1OdOEIc0bfLsDNFUglnxRBxks/fD34piW7nnQppzQQ53YkT54Ut/PyxldOFb6I4xHpC+Wsz77Yy2VzJVmUX3fu2+t9vOIjgRb/YEhKlPmGxNMig5WC/Ox274F6wy1RtOlR29MtDfeiWr+6k7hcEso+TEKIB1+XdOBVhlAALNDT+F8s0O6ABkndQ4rsy+GExXZIrf705Lt1Uy0117IdYQn6qCCf+8nVQb0OQ;25:UR8G4ewYxm+CriIXpahocO1Q2E5chTzfySM67G7wSgTYYjh6wwRzl0gN7dIkQdQggAtj1oLRofq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muHtgme7WhtJid1sAkGPfg56GhKz48x91QV5holW2ipWpAf1jbGeaXkjGFuh74Dlb5RKZlUPLhnF6of1kISmLLZntX9ZzZEgD01TcKIF1duDILPkf8R+rrK3aZXKrFKx+V8NabKkNsi4Rv9IYmDBa7nRmFViqksX1a8X6LmFZhmLyXmnyDX8dSVjyPkBIbijMfXEw9Cj0uc/oZwflkVus8LI8n6bCPylYx4tQ87kwAAjzeECjnVBHprzSZVUmpHkLdsawGHw/xsF+brUyz9qbhVkj4PM19Qfmue1STvGWEyOTWvEUgzcMnMZ8YnEG5RSQh5J0diIGlbVH4yWdmGz3BYr3TxqyvZqW2T29gU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(11241501184)(944501327)(52105095)(93006095)(93001095)(3002001)(10201501046)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:CO1PR15MB1077;BCL:0;PCL:0;RULEID:;SRVR:CO1PR15MB1077; X-Forefront-PRVS: 06400060E1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(376002)(346002)(39860400002)(366004)(39380400002)(396003)(51444003)(199004)(189003)(316002)(59450400001)(97736004)(186003)(16526019)(478600001)(81156014)(81166006)(93886005)(52116002)(386003)(52396003)(86362001)(7696005)(25786009)(8936002)(6506007)(6666003)(6916009)(8676002)(23726003)(1076002)(229853002)(16586007)(476003)(7736002)(6116002)(58126008)(4326008)(76176011)(47776003)(53546011)(2906002)(11346002)(68736007)(106356001)(105586002)(446003)(6246003)(5660300001)(33656002)(55016002)(9686003)(305945005)(53936002)(54906003)(46003)(486006)(50466002)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO1PR15MB1077;H:castle.DHCP.thefacebook.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-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO1PR15MB1077;23:NnRCmiQC3eHcjNZI7f7MlTyG6o3/NuHXUDTx6c5Uv?= =?us-ascii?Q?r6Ig0RnQ11VxLmDP5VSX1GdMF0vL78xCx0aQKdbM0Ctyc3ph76OFoEpOCfWh?= =?us-ascii?Q?it32fyMjH4GTNKI0VDuOyvF2zuxllPrSd+Q6x1pYYVIlGNMmUk57NSwhr8Yy?= =?us-ascii?Q?yJA8R4zlnUe/l3RYn22ftwpRxmiywp6kn2ZOp3Ea3jWNMi2eDNaRlzGhKpYN?= =?us-ascii?Q?UZFpAqA+uFetqnv/ilpJ4HdK0tSE0F8Y2dtbgiif/HK6orLQ4fH1VMXlOZxG?= =?us-ascii?Q?LgWMHbfTMPaQjWMBXMM2YGb3LjjWKuwSsO8BHcgFlyFh5OXXno/58ThcoW7R?= =?us-ascii?Q?r4ENbl1Ba1QJV2zxJYEl/Ok1RfU7LbPMd3Xsi0+aQbdvj6vG55yqzqWC/2HR?= =?us-ascii?Q?U+uEx2Kjw9ICszOq94GJAWJbM8N87haoDEoB+LS0+14vPllBkotIXtkFbh6Q?= =?us-ascii?Q?xUAlwnqK8fCd07la6jc9ZUo4HyxDYaTPqp3/pzljccRWc5boj3Yoo/tT4H6O?= =?us-ascii?Q?fbx3RtDfwQe9ffOhVgFtQCgGFuS+UcljsEBsMJaY6tBbCornS1p6mB0xQAWY?= =?us-ascii?Q?xLfv3sqWHK/DfgDS6Wr/nNF0rFy6V8FBCOeF9kqP806CNLNxDcSlxfV36xvD?= =?us-ascii?Q?w8LFTFCJOcbpvf+Gxl/n4PMw3HBneAxUza3k+oV8cmEPdWjV+bP3ExZydDa3?= =?us-ascii?Q?KD/kDpS2xQoFPGXEsXXN8D27hgT2Lc3MnktWrwT70Rl+DDCkIWsKQeM/+es/?=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bAJHXEY9bFNnwyZeSjiBL5yOxPxyiaCP+p5V9twCbINRCfUfqzgThxFXq16LyY2okuRZ2TbPrr9JeY= X-MS-Office365-Filtering-Correlation-Id: 020f1d60-3c7c-4e17-afe8-08d5a085af1b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2018 14:57:15.2183 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 020f1d60-3c7c-4e17-afe8-08d5a085af1b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR15MB1077 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-12_08:,, 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 Thu, Apr 12, 2018 at 08:52:52AM +0200, Vlastimil Babka wrote: > On 04/11/2018 03:56 PM, Roman Gushchin wrote: > > On Wed, Apr 11, 2018 at 03:16:08PM +0200, Vlastimil Babka wrote: > >> [+CC linux-api] > >> > >> On 03/05/2018 02:37 PM, Roman Gushchin wrote: > >>> 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 > >> > >> Hmm, looks like I'm late and this user-visible API change was just > >> merged. But it's for rc1, so we can still change it, hopefully? > >> > >> One problem I see with the counter is that it's in bytes, but among > >> counters that use pages, and the name doesn't indicate it. > > > > Here I just followed "nr_kernel_stack" path, which is measured in kB, > > but this is not mentioned in the field name. > > Oh, didn't know. Bad example to follow :P > > >> Then, I don't > >> see why users should care about the "indirectly" part, as that's just an > >> implementation detail. It is reclaimable and that's what matters, right? > >> (I also wanted to complain about lack of Documentation/... update, but > >> looks like there's no general file about vmstat, ugh) > > > > I agree, that it's a bit weird, and it's probably better to not expose > > it at all; but this is how all vm counters work. We do expose them all > > in /proc/vmstat. A good number of them is useless until you are not a > > mm developer, so it's arguable more "debug info" rather than "api". > > Yeah the problem is that once tools start rely on them, they fall under > the "do not break userspace" rule, however we call them. So being > cautious and conservative can't hurt. > > > It's definitely not a reason to make them messy. > > Does "nr_indirectly_reclaimable_bytes" look better to you? > > It still has has the "indirecly" part and feels arbitrary :/ > > >> > >> I also kind of liked the idea from v1 rfc posting that there would be a > >> separate set of reclaimable kmalloc-X caches for these kind of > >> allocations. Besides accounting, it should also help reduce memory > >> fragmentation. The right variant of cache would be detected via > >> __GFP_RECLAIMABLE. > > > > Well, the downside is that we have to introduce X new caches > > just for this particular problem. I'm not strictly against the idea, > > but not convinced that it's much better. > > Maybe we can find more cases that would benefit from it. Heck, even slab > itself allocates some management structures from the generic kmalloc > caches, and if they are used for reclaimable caches, they could be > tracked as reclaimable as well. This is a good catch! > > >> > >> With that in mind, can we at least for now put the (manually maintained) > >> byte counter in a variable that's not directly exposed via /proc/vmstat, > >> and then when printing nr_slab_reclaimable, simply add the value > >> (divided by PAGE_SIZE), and when printing nr_slab_unreclaimable, > >> subtract the same value. This way we would be simply making the existing > >> counters more precise, in line with their semantics. > > > > Idk, I don't like the idea of adding a counter outside of the vm counters > > infrastructure, and I definitely wouldn't touch the exposed > > nr_slab_reclaimable and nr_slab_unreclaimable fields. > > We would be just making the reported values more precise wrt reality. It depends on if we believe that only slab memory can be reclaimable or not. If yes, this is true, otherwise not. My guess is that some drivers (e.g. networking) might have buffers, which are reclaimable under mempressure, and are allocated using the page allocator. But I have to look closer... > > We do have some stats in /proc/slabinfo, /proc/meminfo and /sys/kernel/slab > > and I think that we should keep it consistent. > > Right, meminfo would be adjusted the same. slabinfo doesn't indicate > which caches are reclaimable, so there will be no change. > /sys/kernel/slab/cache/reclaim_account does, but I doubt anything will > break. It also can be found out of the corresponding directory name in sysfs: $ ls -la /sys/kernel/slab/dentr* lrwxrwxrwx. 1 root root 0 Apr 11 14:45 /sys/kernel/slab/dentry -> :aA-0000192 ^ this is the "reclaimable" flag Not saying that something will break. Thanks!