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=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 61F02C433DB for ; Fri, 5 Feb 2021 00:12:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0242A64F97 for ; Fri, 5 Feb 2021 00:12:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0242A64F97 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 861496B0006; Thu, 4 Feb 2021 19:12:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E5626B006C; Thu, 4 Feb 2021 19:12:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6ADAF6B006E; Thu, 4 Feb 2021 19:12:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0002.hostedemail.com [216.40.44.2]) by kanga.kvack.org (Postfix) with ESMTP id 508486B0006 for ; Thu, 4 Feb 2021 19:12:08 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 14518181AEF1D for ; Fri, 5 Feb 2021 00:12:08 +0000 (UTC) X-FDA: 77782286736.05.bean66_5f0386b275e0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id E19B7180357ED for ; Fri, 5 Feb 2021 00:12:07 +0000 (UTC) X-HE-Tag: bean66_5f0386b275e0 X-Filterd-Recvd-Size: 6841 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 00:12:07 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id j12so3139765pfj.12 for ; Thu, 04 Feb 2021 16:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=b4ycEO4evAawcZSSp5/4zazbkQfIzLENcMS782LOHnM=; b=AR3/UfbnaRS0WW5Opg+6Iwllpjmb39MMQyQmhd5xHbgW2wrZ46dXzoQo/EsX0tVb0p oUCElygVNIK6KK85kIX5apojC1S72j3L8d8/g2NmxIT7+WwuJqiXb9WtQiq5Ldb+j3Yo jkioddhYuta3LDBDuudquQOKGwlphK0AcnJmfD6JRb8roABp/7UIJ9TBE5SJAg4SWTpk KmCbp90fnZ6kENwSaPY6aeim8vpU6ejBKNADJ6SdJ9JHS3I6j65n1GBaeYtpLvvRYsU4 KEr2iNcqsNEkbQzLKFnCzpYed/+/gxxI0w43RisVlB2xgRQL/zIT1eGW6JUW8Db2k6oN wFVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=b4ycEO4evAawcZSSp5/4zazbkQfIzLENcMS782LOHnM=; b=JUll0wfaSU39Yr/8n6EptWa69+mWYZuTVL+kzcmjhO7Tb4EroYcJWyAPU+pj5leNzz j2uHDAwIMOBilD6twnhL+8cvF71HSVg85MRfzQaT1IslryyQ/ALJ//qXHUSwfe6/0WkE 4TF/6ICMAxbVI5r4wXROIdlkyuLem+yTU+/r9MaLKGDdL3c0osrNjKCupK+Y3u9jMwY6 SRJwabLwdjKf2KKo2pUEA6ObooUF6pLdatZmexE/oE8WxWkWnyqndA8ZuWlpTA6XqI03 Db3IiTv8BdhzHSMABg1ijO2AfI2icD8mDg79vLGYRKgiPe2zw/u2nKwpCzORroZJpHfO Ngcw== X-Gm-Message-State: AOAM532YrTYFL6ebz7hFZdTCAKnZmBUT4hiDRtB7gyVjmerUnp6RcWP1 grP4CQZZb4o1dd2qpAo07WI= X-Google-Smtp-Source: ABdhPJxE+lnwoYnBRrHGmeO0kssUBOMKGbyC0+XmDpwn+BygstIH/TX6KSbDEVGIPZaBnCEfsk//WQ== X-Received: by 2002:a63:3191:: with SMTP id x139mr1508555pgx.272.1612483926459; Thu, 04 Feb 2021 16:12:06 -0800 (PST) Received: from google.com ([2620:15c:211:201:598:57c0:5d30:3614]) by smtp.gmail.com with ESMTPSA id j65sm7153639pfb.23.2021.02.04.16.12.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 16:12:05 -0800 (PST) Date: Thu, 4 Feb 2021 16:12:03 -0800 From: Minchan Kim To: John Hubbard Cc: Andrew Morton , gregkh@linuxfoundation.org, surenb@google.com, joaodias@google.com, LKML , linux-mm Subject: Re: [PATCH] mm: cma: support sysfs Message-ID: References: <20210203155001.4121868-1-minchan@kernel.org> <7e7c01a7-27fe-00a3-f67f-8bcf9ef3eae9@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Feb 04, 2021 at 03:14:56PM -0800, John Hubbard wrote: > On 2/4/21 12:07 PM, Minchan Kim wrote: > > On Thu, Feb 04, 2021 at 12:50:58AM -0800, John Hubbard wrote: > > > On 2/3/21 7:50 AM, Minchan Kim wrote: > > > > Since CMA is getting used more widely, it's more important to > > > > keep monitoring CMA statistics for system health since it's > > > > directly related to user experience. > > > > > > > > This patch introduces sysfs for the CMA and exposes stats below > > > > to keep monitor for telemetric in the system. > > > > > > > > * the number of CMA allocation attempts > > > > * the number of CMA allocation failures > > > > * the number of CMA page allocation attempts > > > > * the number of CMA page allocation failures > > > > > > The desire to report CMA data is understandable, but there are a few > > > odd things here: > > > > > > 1) First of all, this has significant overlap with /sys/kernel/debug/cma > > > items. I suspect that all of these items could instead go into > > > > At this moment, I don't see any overlap with item from cma_debugfs. > > Could you specify what item you are mentioning? > > Just the fact that there would be two systems under /sys, both of which are > doing very very similar things: providing information that is intended to > help diagnose CMA. > > > > > > /sys/kernel/debug/cma, right? > > > > Anyway, thing is I need an stable interface for that and need to use > > it in Android production build, too(Unfortunately, Android deprecated > > the debugfs > > https://source.android.com/setup/start/android-11-release#debugfs > > ) > > That's the closest hint to a "why this is needed" that we've seen yet. > But it's only a hint. > > > > > What should be in debugfs and in sysfs? What's the criteria? > > Well, it's a gray area. "Debugging support" goes into debugfs, and > "production-level monitoring and control" goes into sysfs, roughly True. > speaking. And here you have items that could be classified as either. > > > > > Some statistic could be considered about debugging aid or telemetric > > depening on view point and usecase. And here, I want to use it for > > telemetric, get an stable interface and use it in production build > > of Android. In this chance, I'd like to get concrete guideline > > what should be in sysfs and debugfs so that pointing out this thread > > whenever folks dump their stat into sysfs to avoid waste of time > > for others in future. :) > > > > > > > > 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. 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?