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 4E2F7C433DB for ; Fri, 5 Feb 2021 02:52:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BF56C64F3C for ; Fri, 5 Feb 2021 02:52:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF56C64F3C 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 0E9816B006C; Thu, 4 Feb 2021 21:52:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 074826B006E; Thu, 4 Feb 2021 21:52:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E58656B0070; Thu, 4 Feb 2021 21:52:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0022.hostedemail.com [216.40.44.22]) by kanga.kvack.org (Postfix) with ESMTP id CB99C6B006C for ; Thu, 4 Feb 2021 21:52:07 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9F4043636 for ; Fri, 5 Feb 2021 02:52:07 +0000 (UTC) X-FDA: 77782689894.02.noise88_1908ed6275e1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 80A4B10097AA2 for ; Fri, 5 Feb 2021 02:52:07 +0000 (UTC) X-HE-Tag: noise88_1908ed6275e1 X-Filterd-Recvd-Size: 4969 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 02:52:06 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 04 Feb 2021 18:52:05 -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 02:52:01 +0000 Subject: Re: [PATCH] mm: cma: support sysfs To: Minchan Kim CC: Andrew Morton , , , , LKML , linux-mm References: <20210203155001.4121868-1-minchan@kernel.org> <7e7c01a7-27fe-00a3-f67f-8bcf9ef3eae9@nvidia.com> <87d7ec1f-d892-0491-a2de-3d0feecca647@nvidia.com> From: John Hubbard Message-ID: <71c4ce84-8be7-49e2-90bd-348762b320b4@nvidia.com> Date: Thu, 4 Feb 2021 18:52:01 -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: 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=1612493525; bh=EFGmCq6+o/4jbrE2ZvC8hiPkxQbACUZQsML002ws050=; 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=g2QOHbQ0N890F6gbCZkj++EyGuTFxlzgBh1rLcjJsco77879cxG6Udm9zwd9mdlwE k8sCdOHbS1/2UBw3oEdjMRQYqZXn1LS2VbcthharGxaxdSmPU7vDwfpYQywvZZQoG9 yl2lrBQMoa5SH0BJX13ucA7wJZ83EWIdBil15SWpw4eTfJ2eA7qeRQJUFPv0+y+gQy pHGlYMD6Fk3aR2E5dMQSczZCS+qSJ6uO2L3IhTLic2AVb5RlSi9h8X3zFHQ6CsWeKL K+TAHyo7MVT1JI8b6azbaFFcaL7QsFffKnWNU2Jixzbx9yQoJ9PDAqVlM/OS9imYQ/ tLiEzQZgRYwMg== 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/4/21 5:44 PM, Minchan Kim wrote: > On Thu, Feb 04, 2021 at 04:24:20PM -0800, John Hubbard wrote: >> On 2/4/21 4:12 PM, Minchan Kim wrote: >> ... >>>>> 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. >>> >>> Let me give an example. >>> >>> Let' assume we use memory buffer allocation via CMA for bluetooth >>> enable of device. >>> If user clicks the bluetooth button in the phone but fail to allocate >>> the memory from CMA, user will still see bluetooth button gray. >>> User would think his touch was not enough powerful so he try clicking >>> again and fortunately CMA allocation was successful this time and >>> they will see bluetooh button enabled and could listen the music. >>> >>> Here, product team needs to monitor how often CMA alloc failed so >>> if the failure ratio is steadily increased than the bar, >>> it means engineers need to go investigation. >>> >>> Make sense? >>> >> >> Yes, except that it raises more questions: >> >> 1) Isn't this just standard allocation failure? Don't you already have a way >> to track that? >> >> Presumably, having the source code, you can easily deduce that a bluetooth >> allocation failure goes directly to a CMA allocation failure, right? Still wondering about this... >> >> Anyway, even though the above is still a little murky, I expect you're right >> that it's good to have *some* indication, somewhere about CMA behavior... >> >> Thinking about this some more, I wonder if this is really /proc/vmstat sort >> of data that we're talking about. It seems to fit right in there, yes? > > Thing is CMA instance are multiple, cma-A, cma-B, cma-C and each of CMA > heap has own specific scenario. /proc/vmstat could be bloated a lot > while CMA instance will be increased. > Yes, that would not fit in /proc/vmstat...assuming that you really require knowing--at this point--which CMA heap is involved. And that's worth poking at. If you get an overall indication in vmstat that CMA is having trouble, then maybe that's all you need to start digging further. It's actually easier to monitor one or two simpler items than it is to monitor a larger number of complicated items. And I get the impression that this is sort of a top-level, production software indicator. thanks, -- John Hubbard NVIDIA