From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45E22C433DB for ; Fri, 5 Feb 2021 20:25:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C0BA864FD5 for ; Fri, 5 Feb 2021 20:25:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0BA864FD5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 277A56B0006; Fri, 5 Feb 2021 15:25:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 229076B006C; Fri, 5 Feb 2021 15:25:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1171C6B006E; Fri, 5 Feb 2021 15:25:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0207.hostedemail.com [216.40.44.207]) by kanga.kvack.org (Postfix) with ESMTP id ECF2B6B0006 for ; Fri, 5 Feb 2021 15:25:55 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A86191F1A for ; Fri, 5 Feb 2021 20:25:55 +0000 (UTC) X-FDA: 77785345470.24.pies73_1b06974275e7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 8AE701A4A0 for ; Fri, 5 Feb 2021 20:25:55 +0000 (UTC) X-HE-Tag: pies73_1b06974275e7 X-Filterd-Recvd-Size: 5749 Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 20:25:54 +0000 (UTC) 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== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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