Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2243304pxb; Fri, 5 Feb 2021 12:32:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzV9EMjdhZqIn3leIidtKxhNS41r5CWmIRoDJ42ywceuM++yvtRvlsK+bv+Xe41f+T0xAtj X-Received: by 2002:a17:906:b0c2:: with SMTP id bk2mr5741081ejb.223.1612557173906; Fri, 05 Feb 2021 12:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612557173; cv=none; d=google.com; s=arc-20160816; b=flWLh21Ql7Ob9+sZUtzd3zJGTmKqt8kNYyHFFLwUF8CIS5QQTVJp9ttZg8Xp0Jx8li +Th5081cxOH6wnbFdiLpm3ksXGcZHZds02OpOAzcKIXfqr/oXCZoT99La/5MQQ//TJOt FsV9qvScIsbl9sO6JD2EElRnLmwWpEUutkItwAF2Ak4zb8LUIzqpkcFpQstHetgUfIQu +gI6MuAOxjQlCZIdEKFGsIQWdriw3yg1cGi1UYpZhMDX3jVN/GulQeJy4n2CnmDckWub 4zqsGfimOURMPmJhpxHdz20l5eWwtnk838abbDTBg/RqjgDdHRU8A6J9mGp1IFoUCdks q25w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=6fsyhZcd71U4H2BxWCOPPFCmqtBnPJFkdr9hQzt2OwU=; b=VGfVw/ePblY1aGJPPPVMuN21RqQk9kSWKVALSGqSuJ69ye5AhkHo4q05+sTnoRyc49 Vl4ddmxG2CBSHkm6CxDhPiz2i9WZKiIs7qLTqxqTpiTC3vjZz9WxBUIAVnLghSUQfaV0 H9C9+p4/rpPk5ohlYk2HO3Bd2FnolREqLOS2A0dGsk470HyML9NgsFIfOp2zv9ZuTQX9 BVcDgyBrQuiWIALwo+vf4rQqG4W7fYvq/ZNT0fj/dzGsxaiiXHA+vnpiRZ0uaYC3QE8M qjVAMO6gjoVn8+WUU9wHFmGobb028/VGrSLwlmjnvDQU4SpuKobbBAdJ7OscrK3HVrxq uKYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=OO+F2OK+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si5832642edp.96.2021.02.05.12.32.28; Fri, 05 Feb 2021 12:32:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=OO+F2OK+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233639AbhBESrI (ORCPT + 99 others); Fri, 5 Feb 2021 13:47:08 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:6680 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233360AbhBESoL (ORCPT ); Fri, 5 Feb 2021 13:44:11 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 05 Feb 2021 12:25:53 -0800 Received: from MacBook-Pro-10.local (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 5 Feb 2021 20:25:52 +0000 Subject: Re: [PATCH] mm: cma: support sysfs To: Minchan Kim CC: Andrew Morton , , , , LKML , linux-mm References: <87d7ec1f-d892-0491-a2de-3d0feecca647@nvidia.com> <71c4ce84-8be7-49e2-90bd-348762b320b4@nvidia.com> <34110c61-9826-4cbe-8cd4-76f5e7612dbd@nvidia.com> From: John Hubbard Message-ID: <269689b7-3b6d-55dc-9044-fbf2984089ab@nvidia.com> Date: Fri, 5 Feb 2021 12:25:52 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1612556753; bh=6fsyhZcd71U4H2BxWCOPPFCmqtBnPJFkdr9hQzt2OwU=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=OO+F2OK+tpmFx4B/VUsgnC0WloZgjySN7FUoVutQthptowUQSevdw8lGwmgTA68aw kWrFVSqyiDu2SA8bza6156pP7QEFYuo3EYf1CCrf2dawuMGo+m2rRl2ofvA7MfJhq5 7P5Ia7fpe93krO1EHPuqbkne0TZ5CpxVH4y/tyQIBlazynQpEPzWhPEoQv40Ff2f5Y q/4NRlUQoHv1E5pijY0WdHrSw349E8+BbXIccp19yXwmm4UVnIB8lV4i15QAb/EvVG lT+77f7URYq6SRqlot3r7MNMjnCkJW3TALXURELJPiDQoWH07/NKIhNb98q8gDF48X bUmsW9EOpPGsQ== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/5/21 8:15 AM, Minchan Kim wrote: ... >> Yes, approximately. I was wondering if this would suffice at least as a baseline: >> >> cma_alloc_success 125 >> cma_alloc_failure 25 > > IMO, regardless of the my patch, it would be good to have such statistics > in that CMA was born to replace carved out memory with dynamic allocation > ideally for memory efficiency ideally so failure should regard critical > so admin could notice it how the system is hurt. Right. So CMA failures are useful for the admin to see, understood. > > Anyway, it's not enough for me and orthgonal with my goal. > OK. But...what *is* your goal, and why is this useless (that's what orthogonal really means here) for your goal? Also, would you be willing to try out something simple first, such as providing indication that cma is active and it's overall success rate, like this: /proc/vmstat: cma_alloc_success 125 cma_alloc_failure 25 ...or is the only way to provide the more detailed items, complete with per-CMA details, in a non-debugfs location? >> >> ...and then, to see if more is needed, some questions: >> >> a) Do you know of an upper bound on how many cma areas there can be >> (I think Matthew also asked that)? > > There is no upper bound since it's configurable. > OK, thanks,so that pretty much rules out putting per-cma details into anything other than a directory or something like it. >> >> b) Is tracking the cma area really as valuable as other possibilities? We can put >> "a few" to "several" items here, so really want to get your very favorite bits of >> information in. If, for example, there can be *lots* of cma areas, then maybe tracking > > At this moment, allocation/failure for each CMA area since they have > particular own usecase, which makes me easy to keep which module will > be affected. I think it is very useful per-CMA statistics as minimum > code change so I want to enable it by default under CONFIG_CMA && CONFIG_SYSFS. > >> by a range of allocation sizes is better... > > I takes your suggestion something like this. > > [alloc_range] could be order or range by interval > > /sys/kernel/mm/cma/cma-A/[alloc_range]/success > /sys/kernel/mm/cma/cma-A/[alloc_range]/fail > .. > .. > /sys/kernel/mm/cma/cma-Z/[alloc_range]/success > /sys/kernel/mm/cma/cma-Z/[alloc_range]/fail Actually, I meant, "ranges instead of cma areas", like this: / > I agree it would be also useful but I'd like to enable it under > CONFIG_CMA_SYSFS_ALLOC_RANGE as separate patchset. > I will stop harassing you very soon, just want to bottom out on understanding the real goals first. :) thanks, -- John Hubbard NVIDIA