All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Peter.Enderborg@sony.com
Cc: christian.koenig@amd.com, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, sumit.semwal@linaro.org,
	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 v4] dma-buf: Add DmaBufTotal counter in meminfo
Date: Tue, 20 Apr 2021 13:04:04 +0200	[thread overview]
Message-ID: <YH61JJOlLwBwHqVL@dhcp22.suse.cz> (raw)
In-Reply-To: <532d6d7e-372c-1524-d015-e15d79fcf11c@sony.com>

On Tue 20-04-21 09:25:51, Peter.Enderborg@sony.com wrote:
> On 4/20/21 11:12 AM, Michal Hocko wrote:
> > On Tue 20-04-21 09:02:57, Peter.Enderborg@sony.com wrote:
> >>>> But that isn't really system memory at all, it's just allocated device
> >>>> memory.
> >>> OK, that was not really clear to me. So this is not really accounted to
> >>> MemTotal? If that is really the case then reporting it into the oom
> >>> report is completely pointless and I am not even sure /proc/meminfo is
> >>> the right interface either. It would just add more confusion I am
> >>> afraid.
> >>>  
> >> Why is it confusing? Documentation is quite clear:
> > Because a single counter without a wider context cannot be put into any
> > reasonable context. There is no notion of the total amount of device
> > memory usable for dma-buf. As Christian explained some of it can be RAM
> > based. So a single number is rather pointless on its own in many cases.
> >
> > Or let me just ask. What can you tell from dma-bud: $FOO kB in its
> > current form?
> 
> It is better to be blind?

No it is better to have a sensible counter that can be reasoned about.
So far you are only claiming that having something is better than
nothing and I would agree with you if that was a debugging one off
interface. But /proc/meminfo and other proc files have to be maintained
with future portability in mind. This is not a dumping ground for _some_
counters that might be interesting at the _current_ moment. E.g. what
happens if somebody wants to have a per device resp. memory based
dma-buf data? Are you going to change the semantic or add another
2 counters?
-- 
Michal Hocko
SUSE Labs

WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko@suse.com>
To: Peter.Enderborg@sony.com
Cc: willy@infradead.org, christian.koenig@amd.com, neilb@suse.de,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, shakeelb@google.com,
	rppt@kernel.org, samitolvanen@google.com,
	songmuchun@bytedance.com, linux-fsdevel@vger.kernel.org,
	akpm@linux-foundation.org, adobriyan@gmail.com, guro@fb.com,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo
Date: Tue, 20 Apr 2021 13:04:04 +0200	[thread overview]
Message-ID: <YH61JJOlLwBwHqVL@dhcp22.suse.cz> (raw)
In-Reply-To: <532d6d7e-372c-1524-d015-e15d79fcf11c@sony.com>

On Tue 20-04-21 09:25:51, Peter.Enderborg@sony.com wrote:
> On 4/20/21 11:12 AM, Michal Hocko wrote:
> > On Tue 20-04-21 09:02:57, Peter.Enderborg@sony.com wrote:
> >>>> But that isn't really system memory at all, it's just allocated device
> >>>> memory.
> >>> OK, that was not really clear to me. So this is not really accounted to
> >>> MemTotal? If that is really the case then reporting it into the oom
> >>> report is completely pointless and I am not even sure /proc/meminfo is
> >>> the right interface either. It would just add more confusion I am
> >>> afraid.
> >>>  
> >> Why is it confusing? Documentation is quite clear:
> > Because a single counter without a wider context cannot be put into any
> > reasonable context. There is no notion of the total amount of device
> > memory usable for dma-buf. As Christian explained some of it can be RAM
> > based. So a single number is rather pointless on its own in many cases.
> >
> > Or let me just ask. What can you tell from dma-bud: $FOO kB in its
> > current form?
> 
> It is better to be blind?

No it is better to have a sensible counter that can be reasoned about.
So far you are only claiming that having something is better than
nothing and I would agree with you if that was a debugging one off
interface. But /proc/meminfo and other proc files have to be maintained
with future portability in mind. This is not a dumping ground for _some_
counters that might be interesting at the _current_ moment. E.g. what
happens if somebody wants to have a per device resp. memory based
dma-buf data? Are you going to change the semantic or add another
2 counters?
-- 
Michal Hocko
SUSE Labs
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-04-20 11:04 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-17 10:40 [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo Peter Enderborg
2021-04-17 10:40 ` Peter Enderborg
2021-04-17 10:59 ` Christian König
2021-04-17 10:59   ` Christian König
2021-04-17 11:20   ` Peter.Enderborg
2021-04-17 11:20     ` Peter.Enderborg
2021-04-17 11:54     ` Christian König
2021-04-17 11:54       ` Christian König
2021-04-17 12:13       ` Peter.Enderborg
2021-04-17 12:13         ` Peter.Enderborg
2021-04-20  8:39       ` Daniel Vetter
2021-04-20  8:39         ` Daniel Vetter
2021-04-17 13:07 ` [External] " Muchun Song
2021-04-17 13:07   ` Muchun Song
2021-04-17 13:43   ` Peter.Enderborg
2021-04-17 13:43     ` Peter.Enderborg
2021-04-17 14:21     ` Muchun Song
2021-04-17 14:21       ` Muchun Song
2021-04-17 15:03       ` Christian König
2021-04-17 15:03         ` Christian König
2021-04-19 12:16 ` Michal Hocko
2021-04-19 12:16   ` Michal Hocko
2021-04-19 12:41   ` Peter.Enderborg
2021-04-19 12:41     ` Peter.Enderborg
2021-04-19 15:00     ` Michal Hocko
2021-04-19 15:00       ` Michal Hocko
2021-04-19 15:19       ` Peter.Enderborg
2021-04-19 15:19         ` Peter.Enderborg
2021-04-19 15:44         ` Christian König
2021-04-19 15:44           ` Christian König
2021-04-19 16:11           ` Michal Hocko
2021-04-19 16:11             ` Michal Hocko
2021-04-19 16:37             ` Christian König
2021-04-19 16:37               ` Christian König
2021-04-20  7:04               ` Michal Hocko
2021-04-20  7:04                 ` Michal Hocko
2021-04-20  7:20                 ` Mike Rapoport
2021-04-20  7:20                   ` Mike Rapoport
2021-04-20  7:47                   ` Michal Hocko
2021-04-20  7:47                     ` Michal Hocko
2021-04-20  7:32                 ` Christian König
2021-04-20  7:32                   ` Christian König
2021-04-20  7:46                   ` Michal Hocko
2021-04-20  7:46                     ` Michal Hocko
2021-04-20  8:00                     ` Christian König
2021-04-20  8:00                       ` Christian König
2021-04-20  8:28                       ` Michal Hocko
2021-04-20  8:28                         ` Michal Hocko
2021-04-20  9:02                     ` Peter.Enderborg
2021-04-20  9:02                       ` Peter.Enderborg
2021-04-20  9:12                       ` Michal Hocko
2021-04-20  9:12                         ` Michal Hocko
2021-04-20  9:25                         ` Peter.Enderborg
2021-04-20  9:25                           ` Peter.Enderborg
2021-04-20 11:04                           ` Michal Hocko [this message]
2021-04-20 11:04                             ` Michal Hocko
2021-04-20 11:24                             ` Peter.Enderborg
2021-04-20 11:24                               ` Peter.Enderborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YH61JJOlLwBwHqVL@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=Peter.Enderborg@sony.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=guro@fb.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=rppt@kernel.org \
    --cc=samitolvanen@google.com \
    --cc=shakeelb@google.com \
    --cc=songmuchun@bytedance.com \
    --cc=sumit.semwal@linaro.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.