Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp434669pxy; Wed, 21 Apr 2021 06:36:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQslb6KZgp3gL3i2j83X7+6P3+g00r2gYuTh+Ig0CVYJLJ2UmC0bz0pFmI+3s9wPUMVzWh X-Received: by 2002:aa7:cd6e:: with SMTP id ca14mr22117341edb.111.1619012180919; Wed, 21 Apr 2021 06:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619012180; cv=none; d=google.com; s=arc-20160816; b=XWP987vtGP2+gHVUM9UTlmxfnBmwbQixrQFzfQyeq1aD1SPX2hgrtKANg2JMRu+/+8 FtRhRQOg89+QkHdg4okKWxLiWqnHPYh4Xy5aivjbSyFB5yufYfb9Ap+kUXnDnHUFR+Ju wWDTSLZZCRjNGeHZfbtOBgzRTteEXkHJY8x36T9xa7JFGOmdRb5439kGM5AelR2TBTtK 5F/V+FpcxY+sJ/G6hl2pWjBoN8FcxrNqwCs51zkEDLjGuOa0RnWeIiO1mfVdXZJdNV0c igJIVOcNG9cI4gKjWI8FU5+sA2wQN/j4KUK5mVP2vmxc4PymOmS8DyAliZEiL6Lwp6WN cOXQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rgVvXl99TxnibcW76eYvhg6wpPaOgg+p9bccUoVFxxs=; b=ZJ0h48jaf144ny29q8TmQDueRdDY6JaCD2S3CPTzbkZyfR0E74V9mzI0I2hg5L72S+ HCA1GobQw0Cja5J5CSAUV6zKTSzyGBgVAjBPU9iZFKJrN43GLB5SJrQVbX14RnLZtR5F GBErQwvq978AxPLLBxmBWqWRVHmMELlMRv13K0sk2hSvtSfNGxP3nQcXLmwql1y/sxzV bKdkNFj+RP2WITXIGE/5jNrxy6wziIVp1eDIXAl+n9T89nBwOPgCNLovsU9JXceUcS1p sEHBw41hHXS8kP13fH/p0YLZ5nc7zCySxOdLRTPROK+Xq2MyBIjGFlFOKJ4FThhT6Ofy eOSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=b6CyN9Sx; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j16si2446278edj.401.2021.04.21.06.35.56; Wed, 21 Apr 2021 06:36:20 -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=@suse.com header.s=susede1 header.b=b6CyN9Sx; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236304AbhDUK6F (ORCPT + 99 others); Wed, 21 Apr 2021 06:58:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:35492 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbhDUK6E (ORCPT ); Wed, 21 Apr 2021 06:58:04 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1619002649; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rgVvXl99TxnibcW76eYvhg6wpPaOgg+p9bccUoVFxxs=; b=b6CyN9SxhFfZjTTdYIQvTKNt4IfcXFXUGqZZgtYgycjhCjHVTyJO+Nm64qI+MUFZEN89qx 0/5HRjjPSgc/foprJoUiqhzBdLZ804nlBYre2Cj4o12VvXdtlo84o7vj4YaqOK/NMkvwKH sDC5MoXlQI3KrSGua6OjVjS8aBB6TAg= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4A8F7AEE7; Wed, 21 Apr 2021 10:57:29 +0000 (UTC) Date: Wed, 21 Apr 2021 12:57:28 +0200 From: Michal Hocko To: Peter.Enderborg@sony.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, sumit.semwal@linaro.org, christian.koenig@amd.com, adobriyan@gmail.com, akpm@linux-foundation.org, songmuchun@bytedance.com, guro@fb.com, shakeelb@google.com, neilb@suse.de, samitolvanen@google.com, rppt@kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, willy@infradead.org Subject: Re: [PATCH v5] dma-buf: Add DmaBufTotal counter in meminfo Message-ID: References: <20210417163835.25064-1-peter.enderborg@sony.com> <176e7e71-59b7-b288-9483-10e0f42a7a3f@sony.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 21-04-21 10:37:11, Peter.Enderborg@sony.com wrote: > On 4/21/21 11:15 AM, Daniel Vetter wrote: [...] > > We need to understand what the "correct" value is. Not in terms of kernel > > code, but in terms of semantics. Like if userspace allocates a GL texture, > > is this supposed to show up in your metric or not. Stuff like that. > That it like that would like to only one pointer type. You need to know what > > you pointing at to know what it is. it might be a hardware or a other pointer. > > If there is a limitation on your pointers it is a good metric to count them > even if you don't? know what they are. Same goes for dma-buf, they > are generic, but they consume some resources that are counted in pages. > > It would be very good if there a sub division where you could measure > all possible types separately.? We have the detailed in debugfs, but nothing > for the user. A summary in meminfo seems to be the best place for such > metric. I strongly suspect that the main problem of this patch (and its previous versions) is that you are failing to explain the purpose of the counter to others. From what you have said so far it sounds like this is a number which is nice to have because gives us more than nothing. And while this is not really hard to agree with it doesn't really meet the justification for exporting yet another counter to the userspace with all the headache of the future maintenance. I think it would hugely help to describe a typical scenario when the counter would be useful and the conclusion you can draw from the exported value or a set of values over time. And please note that a mixed bag of different memory resources in a single counter doesn't make this any easier because then it essentially makes it impossible to know whether an excessive usage contribues to RAM or device memory depletion - hence this is completely bogus for the OOM report. -- Michal Hocko SUSE Labs