Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1598462pxf; Fri, 26 Mar 2021 10:30:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwetHhN7WkyG4Ec8NAIyESe1a/on/pQn/qkikiNxEYIzuCB58L1U3Gj2My/R/RmVr1CNh75 X-Received: by 2002:a50:fd83:: with SMTP id o3mr16991479edt.90.1616779844752; Fri, 26 Mar 2021 10:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616779844; cv=none; d=google.com; s=arc-20160816; b=OVR96JPG0cFjJnIyzd6Rzam/UBTFmgnjaMvRYBX37O7qhyuZ4Oeoe+oLIiCZn/O8R5 03Vr0Ap+zKL/Eag6wS85x2mh90qSksMtIbDZkKIWVSuNQCTFnZ6RIyG6IdrWaOCZiy2O PrV5YskIZx6kLdyB6x1a9v/ArVW/JbJ8oj0pjXg+/2piyToum/Jm3SjXGjCjZSdKaJVu NYnnOk+RprP8+FrMlD235qK0DAU4byXw+pnP1ekIjuiRfwwOSV/ZUotP24IU4QHT8qMM OzlMNCRwh9xz9FjiHFIpFF08VPHAI7GtvAjwn6tLKexuhDBBlJpBkOzjjiiHnqeInWm4 MyWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=K+JfJ+IVghbbF73AG5/h/ydSFAqFzFdokpF/W0pgnvU=; b=Ff0A5c/SJtaszc7QQPeB6hiQ/dTQv2z++eDkEJxm0OAAGopj6vLHs/fHrBmxcpJ4Vm PBc2XG8/dLRDBcU0Xhat68bk5piNr9g3JrYK5cuNuBIFRfXLk+5ihqFHfnApniGx6TqV nzDKHBfEqfk/rBQB5+CeFvxcjaOoJMc7YUZaoJC7JSCmydEO7DfkIQMScDeLIA1zOo9N ZSONzoEUBPGKKHql/Wx4FJ1mNlYtVnPNUMqoMrcPyjaOeSbpCfN2U82penQoecRhu+RP F1NsHsSROOgYu6ptj7z8aDFHKYrvt6opQLsHRlJXLHwGrZaKFzYDPNs8HrHulinLZDJg bc4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DEyQzkgj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si7262183ejt.44.2021.03.26.10.30.21; Fri, 26 Mar 2021 10:30:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DEyQzkgj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbhCZR2z (ORCPT + 99 others); Fri, 26 Mar 2021 13:28:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230174AbhCZR2c (ORCPT ); Fri, 26 Mar 2021 13:28:32 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D3B8C0613AA for ; Fri, 26 Mar 2021 10:28:32 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id k10so9638634ejg.0 for ; Fri, 26 Mar 2021 10:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=K+JfJ+IVghbbF73AG5/h/ydSFAqFzFdokpF/W0pgnvU=; b=DEyQzkgjA8rbI3yPSNDKqVvKOp6l+aPvzG3TsEIH3Y7HtRIeABFnYJke+ss/1be+r7 39GAI8s6L1jFDJ07yzUc9g5Bs42j7D3zvq9v0+wpVNmUetnwBqonscXjaXB9wvj9+vO7 ssEy1XQ7JngdvrpeSLC4mkdJRWy88qydn9LhM8Nj93sSYTx6fUbdj5JNJAti2jZ7kzqc A13G4iISheGpeitlrqXbeai6Pe74T3x0Il4V+ywGrKT089fiB45UZn3MSJmtel9+RmGP +YcPh0R0HDxIInafjZ+P+mTN/B9maasp+gKWn0c88RO3NABG36iXIPiBp1J+Y44unDyO RHCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K+JfJ+IVghbbF73AG5/h/ydSFAqFzFdokpF/W0pgnvU=; b=nAuGf4P3QY3pe7aSBBz/mIZastaJj1Po0BRrXbszcb1CkAO/WmvD2H9wyHXehxhAnY q7FGsHV6OsK4o3taYro8los+R1P6xA6mkwsV4oy+SxyiIy5QfbTVZfw32wvWYOcTXO+L MtgVEIs9ykBnrCrvcuD+HkkMnMPdiIKCQ6+AHgdJnX5aNocZowiqu01UY5svEOvMrhln F862hlFEXVKc+gWSUIErknQOVmzZUAESRRJ2Tbcjt6N7qYleLQ7XTE7+MExkaFr+OTIc 75mEnAUQO0iXUvlgr4WH42TTVXVHikxs8gqErQc4K3bQQLbRGPZ55NB8NzjuvLfFgpiD TLwQ== X-Gm-Message-State: AOAM5338jSfscOqxWwH5Wx7itRzo4R9OeKbIJFJDdoT1qmsvussH0RfM xH0VzAgS75KOk8w1w8n0erNVyfma/QoQqpnWzFyibA== X-Received: by 2002:a17:906:3159:: with SMTP id e25mr16617617eje.303.1616779710741; Fri, 26 Mar 2021 10:28:30 -0700 (PDT) MIME-Version: 1.0 References: <20210324230759.2213957-1-minchan@kernel.org> In-Reply-To: <20210324230759.2213957-1-minchan@kernel.org> From: Anders Roxell Date: Fri, 26 Mar 2021 18:28:19 +0100 Message-ID: Subject: Re: [PATCH v8] mm: cma: support sysfs To: Minchan Kim Cc: Andrew Morton , linux-mm , LKML , Greg Kroah-Hartman , Suren Baghdasaryan , John Dias , jhubbard@nvidia.com, Matthew Wilcox , digetx@gmail.com, Colin Ian King Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Mar 2021 at 00:09, 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 statistics for CMA, in order to provide > some basic monitoring of the CMA allocator. > > * the number of CMA page successful allocations > * the number of CMA page allocation failures > > These two values allow the user to calcuate the allocation > failure rate for each CMA area. > > e.g.) > /sys/kernel/mm/cma/WIFI/alloc_pages_[success|fail] > /sys/kernel/mm/cma/SENSOR/alloc_pages_[success|fail] > /sys/kernel/mm/cma/BLUETOOTH/alloc_pages_[success|fail] > > The cma_stat was intentionally allocated by dynamic allocation > to harmonize with kobject lifetime management. > https://lore.kernel.org/linux-mm/YCOAmXqt6dZkCQYs@kroah.com/ > > Tested-by: Dmitry Osipenko > Reviewed-by: Dmitry Osipenko > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: John Hubbard > Link: https://lore.kernel.org/linux-mm/20210316100433.17665-1-colin.king@canonical.com/ > Addresses-Coverity: ("Dereference after null check") > Signed-off-by: Colin Ian King > Signed-off-by: Minchan Kim Tested-by: Anders Roxell