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 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 DAC8DC433DB for ; Fri, 5 Feb 2021 16:15:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5794F64E35 for ; Fri, 5 Feb 2021 16:15:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5794F64E35 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 D1FE16B0070; Fri, 5 Feb 2021 11:15:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CCFB16B0072; Fri, 5 Feb 2021 11:15:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B97DE6B0073; Fri, 5 Feb 2021 11:15:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id A68FB6B0070 for ; Fri, 5 Feb 2021 11:15:35 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 725B31EFF for ; Fri, 5 Feb 2021 16:15:35 +0000 (UTC) X-FDA: 77784714630.09.cork98_4406470275e6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 4182D180AD830 for ; Fri, 5 Feb 2021 16:15:35 +0000 (UTC) X-HE-Tag: cork98_4406470275e6 X-Filterd-Recvd-Size: 5898 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 16:15:34 +0000 (UTC) Received: by mail-pg1-f181.google.com with SMTP id o21so3458542pgn.12 for ; Fri, 05 Feb 2021 08:15:34 -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=FTPh7oL8EmAIBxBRU2UBLoT6Jy/Icksa/rE3mlaA1mM=; b=cLrjPxBpGlaQNbmOEsfdJJzZMIp5F/CeTpQFaq97QruHEFUQ5yarW4BHlIsFKSf469 QwxOtJtigpkm/z2uORLubYRRROLuy/Zi2Ue0q42XAWY/Dbi/PteR0YcsToI07JmBGV/Q eYHDpf+qwIS1PzsWiQVu0m+CdW6auQuQKrQzT+K7h6AZ0evOqL15+Hl9Ybc5UObkqN2r eYZqpjgUEMIlMtOyEQAkRzjmS6shAatT351egzzl+UHox5ifwQWdA59j13TLdgYmviMQ 7QGW9P7ozeYAuiObNywhHFGc/UEFxlNpQx/huM65SK5Sp0znmy7DbdaH4BGiFoUys4/w gvaw== 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=FTPh7oL8EmAIBxBRU2UBLoT6Jy/Icksa/rE3mlaA1mM=; b=ie+MbcjZHnOd/lSxEuSZvAkZcLefVhO0r/IGs22j/xpqVAJon28IPfXmobcyEcTDTC jDTL0c+oWnQuJAmL8pMMLni2AA1phcHQ7VjZgSlSQwCD7u8TJP2upaTMqZLEULXkd9LA jUtha2XPNO0VcqdJddiycOzRDsfdOXMjznsnb56LgkVO6vgPrlZTJAxYon7tpbZ4c3XQ V+sMckz06iNVM8yoX9YS+ILHLR/9+tzs75XlB50y0gOM480gq2yVM76YnwNSNk4B5NFx olCjA5PCWmr+kMFvLjYeaySCZxlWq4zIY+mRCup0tCufd1Af8LKirMY6VWiD0V/u8hwy nB5g== X-Gm-Message-State: AOAM531f0Gv5HXELbYNPhOWSeH5yGasg7lT0zBO+CZem/vQzleTwN95l ckOmkbuQli+tuwH+kuXJ8ZQ= X-Google-Smtp-Source: ABdhPJycEKcf89NcaDzn9SbFfxdRzh67XFybri5aMzom9GFAxSRMGwzh+T7VgSdwl0REkw1U1otOag== X-Received: by 2002:a65:4d4f:: with SMTP id j15mr5165087pgt.290.1612541733852; Fri, 05 Feb 2021 08:15:33 -0800 (PST) Received: from google.com ([2620:15c:211:201:708b:34cf:3e70:176d]) by smtp.gmail.com with ESMTPSA id r20sm10661949pgb.3.2021.02.05.08.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 08:15:32 -0800 (PST) Date: Fri, 5 Feb 2021 08:15:30 -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: <87d7ec1f-d892-0491-a2de-3d0feecca647@nvidia.com> <71c4ce84-8be7-49e2-90bd-348762b320b4@nvidia.com> <34110c61-9826-4cbe-8cd4-76f5e7612dbd@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 10:41:14PM -0800, John Hubbard wrote: > On 2/4/21 10:24 PM, Minchan Kim wrote: > > On Thu, Feb 04, 2021 at 09:49:54PM -0800, John Hubbard wrote: > > > On 2/4/21 9:17 PM, Minchan Kim wrote: > ... > > > # cat vmstat | grep -i cma > > > nr_free_cma 261718 > > > > > > # cat meminfo | grep -i cma > > > CmaTotal: 1048576 kB > > > CmaFree: 1046872 kB > > > > > > OK, given that CMA is already in those two locations, maybe we should put > > > this information in one or both of those, yes? > > > > Do you suggest something liks this, for example? > > > > > > cat vmstat | grep -i cma > > cma_a_success 125 > > cma_a_fail 25 > > cma_b_success 130 > > cma_b_fail 156 > > .. > > cma_f_fail xxx > > > > 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. Anyway, it's not enough for me and orthgonal with my goal. > > ...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. > > 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 I agree it would be also useful but I'd like to enable it under CONFIG_CMA_SYSFS_ALLOC_RANGE as separate patchset.