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.8 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 AEDB9C433E0 for ; Fri, 5 Feb 2021 00:34:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 501B864FB0 for ; Fri, 5 Feb 2021 00:34:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 501B864FB0 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 A6A976B0006; Thu, 4 Feb 2021 19:34:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A1C6D6B006C; Thu, 4 Feb 2021 19:34:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 931EF6B006E; Thu, 4 Feb 2021 19:34:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id 7E1146B0006 for ; Thu, 4 Feb 2021 19:34:20 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4904D181AEF1D for ; Fri, 5 Feb 2021 00:34:20 +0000 (UTC) X-FDA: 77782342680.15.hair70_1606ce3275e0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 2AEF41814B0C1 for ; Fri, 5 Feb 2021 00:34:20 +0000 (UTC) X-HE-Tag: hair70_1606ce3275e0 X-Filterd-Recvd-Size: 5014 Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 00:34:19 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 04 Feb 2021 16:34:18 -0800 Received: from [10.2.60.31] (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 00:34:18 +0000 Subject: Re: [PATCH] mm: cma: support sysfs From: John Hubbard To: Suren Baghdasaryan CC: Minchan Kim , Andrew Morton , Greg Kroah-Hartman , John Dias , LKML , linux-mm References: <20210203155001.4121868-1-minchan@kernel.org> <7e7c01a7-27fe-00a3-f67f-8bcf9ef3eae9@nvidia.com> <9900858e-4d9b-5111-e695-fd2bb7463af9@nvidia.com> Message-ID: <96bc11de-fe47-c7d3-6e61-5a5a5b6d2f4c@nvidia.com> Date: Thu, 4 Feb 2021 16:34:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Thunderbird/85.0 MIME-Version: 1.0 In-Reply-To: <9900858e-4d9b-5111-e695-fd2bb7463af9@nvidia.com> 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: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1612485258; bh=NTqy7B8P6hSTGH18361tq0v8m1sHBP+QMYN9FgAqBkg=; h=Subject:From:To:CC:References:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=KoHnZouStLSRj6n3WdCjFTPGAaGHoQ/9TazFgT3+17/wNco0bavtfsDy+pqQTzz14 ki1nfYyKD9XNO3ASPu8A/+4X+S7BpMbsGuIKzu02etqMQ38zgK3OzqoOyFJa77qtYy j4eM30a/YM0Avv0mGol1sd78NTxjjnDsWvLF8eLKJUUtRgG5EKfXVGvwklOnLj/kCW imZQkufYuOPOxagKlV4rS/++5XlQ29vyfsRN0y2yHorS0SYMNeCrdoLmB7Wjc2T7eb PDPVW1Q/bxKiig8f4607bAi5ACfOyarLhKGU8AHE/vyqZXQH1RWSKppWGDcBLAEa5H aHRJUArUec96w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000011, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2/4/21 4:25 PM, John Hubbard wrote: > On 2/4/21 3:45 PM, Suren Baghdasaryan wrote: > ... >>>>>> 2) The overall CMA allocation attempts/failures (first two items above) seem >>>>>> an odd pair of things to track. Maybe that is what was easy to track, but I'd >>>>>> vote for just omitting them. >>>>> >>>>> Then, how to know how often CMA API failed? >>>> >>>> Why would you even need to know that, *in addition* to knowing specific >>>> page allocation numbers that failed? Again, there is no real-world motivation >>>> cited yet, just "this is good data". Need more stories and support here. >>> >>> IMHO it would be very useful to see whether there are multiple >>> small-order allocation failures or a few large-order ones, especially >>> for CMA where large allocations are not unusual. For that I believe >>> both alloc_pages_attempt and alloc_pages_fail would be required. >> >> Sorry, I meant to say "both cma_alloc_fail and alloc_pages_fail would >> be required". > > So if you want to know that, the existing items are still a little too indirect > to really get it right. You can only know the average allocation size, by > dividing. Instead, we should provide the allocation size, for each count. > > The limited interface makes this a little awkward, but using zones/ranges could > work: "for this range of allocation sizes, there were the following stats". Or, > some other technique that I haven't thought of (maybe two items per file?) would > be better. > > On the other hand, there's an argument for keeping this minimal and simple. That > would probably lead us to putting in a couple of items into /proc/vmstat, as I > just mentioned in my other response, and calling it good. ...and remember: if we keep it nice and minimal and clean, we can put it into /proc/vmstat and monitor it. And then if a problem shows up, the more complex and advanced debugging data can go into debugfs's CMA area. And you're all set. If Android made up some policy not to use debugfs, then: a) that probably won't prevent engineers from using it anyway, for advanced debugging, and b) If (a) somehow falls short, then we need to talk about what Android's plans are to fill the need. And "fill up sysfs with debugfs items, possibly duplicating some of them, and generally making an unecessary mess, to compensate for not using debugfs" is not my first choice. :) thanks, -- John Hubbard NVIDIA