Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6788387pxb; Wed, 17 Feb 2021 13:31:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJx83kEUyIS4TFcV+V23efjVhCN7aPRHKdjXQL6HyrCp6/bFLE2VoxJIt/suZIWI28O3529G X-Received: by 2002:a17:906:fcb9:: with SMTP id qw25mr900861ejb.11.1613597507047; Wed, 17 Feb 2021 13:31:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613597507; cv=none; d=google.com; s=arc-20160816; b=UtglJnxhdnHwC8aKVEt73uuAw+wCuRrgwR2uQYhsLWvYZGFc+q5SRQfC+xRRlJu1rt HzOi2T6GeAS+nK1ktsvmUNvg+27CizaKoK1qXrTVV1bMxEo9jHJJwESYRhd2Zp3CSIo3 QxhacMDyZd07Vwah2bP1Rnl1pBiFnfkRblrWonUqKzG1/K4BwMmKHOXjkglGEYpo7jbF HTBauN4RJzg9nTMND+yxqdb0pRg3tAl7qNHBQJiuFefcKdVTtacGxvy5iyz45RGzViNB BlvceR5f+x8CcpagLRjOQx1b35b3A8d2NBXHkT8YdLepp1867MT0d7EnbDSGIyD4E+CO 40Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=Hdfte6859K4H28Potw2xMsDUKaSnL8kHSeZpJtB9aBQ=; b=R+13t7dgSCHh2GGtaO5gLwZnVUQTDZEbCT3grbdq44s9++72sJDuT4OMRGeGV/5MwI z5VdTt1Jb1ud+95yHzr3+VoCwT3DrgmCs/Njd3OvRGfhPQ9mb6S5zvTzQ3b2msOgckVI znkPGs+Xc4+M4XKXGyI4Yjzihtf16Zem//kUjzoUZk4UGzvzM6r6SvnW8elK3LXz3muh AP9Qu4AZqKWcgGrMuWwUCsHyvqcoR4lIJm6W5KX/GI/FS4ajzYsMnhpViGa/PITWHeu+ z7YCpDtOoD8wkuUJG2MO734ucuBBMZ8S2K2gAwBEIuLIkUPxLU90cDxF3pHxOnJclD7Y dNrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VTJrGc+I; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cc7si2246365edb.420.2021.02.17.13.31.23; Wed, 17 Feb 2021 13:31:47 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=VTJrGc+I; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233921AbhBQVUl (ORCPT + 99 others); Wed, 17 Feb 2021 16:20:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233463AbhBQVUH (ORCPT ); Wed, 17 Feb 2021 16:20:07 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1120C061574 for ; Wed, 17 Feb 2021 13:19:26 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id n10so9286151pgl.10 for ; Wed, 17 Feb 2021 13:19:26 -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=Hdfte6859K4H28Potw2xMsDUKaSnL8kHSeZpJtB9aBQ=; b=VTJrGc+I2OYjOLy0h17IahPi6ZQYjBp0LBYRgedbumbhvM4iNM5QE6qr65jyyCAo8y 1dla0zVEm68iki5zLY3D232Ln0WqlObkpcBLTm3bIP+GrE+eblDozC/jtwaLrCqf8dpi WHrVR5/6bo81yZ6bS4FSe2yA8cB+8vQz9WsgkMTcWBvMrj+9Jz98cZvHsc12pDFRoySP /6Fh46S5rfaqgsHouUjn3rcv8UWPhLo72XjBnW0chq6Ee0ZrXlHi4GswyKsw1C4pXoxx +uxQGKzcWI8GbXc7ZLwxJCMrSNAthsavJu9b+ALyATxin6rLPyYoWAYHKQkO2NrRnZQe QTxA== 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=Hdfte6859K4H28Potw2xMsDUKaSnL8kHSeZpJtB9aBQ=; b=RdFnRK6sDN6B75NauMOZ1YvnlXfcpsFhi8lC+9Kan2SVyj4hvX0y6Q1KawdY9Skqvw Fp0ulb1g5qheLEAqFtM61o0kn3O6SXBL/4nNJcjinlSGrdNha64hGujhQPGppsn7QWni WUzJxBOmXyPsgdrJkEaunWJzTcS58NR4izei5TOy76IhZ7Ph2XIMo9HR+xUwy0f6XyVF BJ2vCYhm/BxLRC1gQSSugklWLkEcc/UPyRq5qH46Gp6nDtom6zUfFwObkJicpmm7B8CW wD1QJ6l73omgPiKNN2r5j8F0S1o9egzFQ79YTcrs1yuqAtA4KdjVTzf9zrMxv11WeLuN RMJQ== X-Gm-Message-State: AOAM5311vVkCNpAv49KIKRxgR/3jQCuz7WqICKeN0aeog9tScApTwiOe c9/IH2IGy769qxoFpmyCihM= X-Received: by 2002:a63:4e08:: with SMTP id c8mr1080362pgb.87.1613596766489; Wed, 17 Feb 2021 13:19:26 -0800 (PST) Received: from google.com ([2620:15c:211:201:157d:8a19:5427:ea9e]) by smtp.gmail.com with ESMTPSA id b10sm1736339pgm.76.2021.02.17.13.19.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 13:19:25 -0800 (PST) Sender: Minchan Kim Date: Wed, 17 Feb 2021 13:19:23 -0800 From: Minchan Kim To: John Hubbard Cc: Andrew Morton , linux-mm , LKML , surenb@google.com, joaodias@google.com Subject: Re: [PATCH] mm: vmstat: add cma statistics Message-ID: References: <20210217170025.512704-1-minchan@kernel.org> <8036d8e6-8e96-7b4e-91c0-e1ae91b637e1@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8036d8e6-8e96-7b4e-91c0-e1ae91b637e1@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 17, 2021 at 12:57:25PM -0800, John Hubbard wrote: > On 2/17/21 9:00 AM, Minchan Kim wrote: > > Since CMA is used more widely, it's worth to have CMA > > allocation statistics into vmstat. With it, we could > > know how agressively system uses cma allocation and > > how often it fails. > > > > Signed-off-by: Minchan Kim > > --- > > include/linux/vm_event_item.h | 3 +++ > > mm/cma.c | 12 +++++++++--- > > mm/vmstat.c | 4 ++++ > > 3 files changed, 16 insertions(+), 3 deletions(-) > > > > diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h > > index 18e75974d4e3..0c567014ce82 100644 > > --- a/include/linux/vm_event_item.h > > +++ b/include/linux/vm_event_item.h > > @@ -70,6 +70,9 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, > > #endif > > #ifdef CONFIG_HUGETLB_PAGE > > HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, > > +#endif > > +#ifdef CONFIG_CMA > > + CMA_ALLOC, CMA_ALLOC_FAIL, > > This seems wrong: here it's called "alloc", but in the output it's > called "alloc success", and in the implementation it's clearly > "alloc attempt" that is being counted. Argh, I wanted to introduce CMA_ALLOC, not ALLOC_ATTEMPTS. Let me fix. > > Once these are all made consistent, then the bug should naturally > go away as part of that. > > nit: I think the multiple items per line is a weak idea at best, even > though it's used here already. Each item is important and needs to be > visually compared to it's output item later. So one per line might > have helped avoid mismatches, and I think we should change to that to > encourage that trend. No problem. Thanks for the review, John.