From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomasz Figa <tfiga@chromium.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Hsia-Jun Li <Randy.Li@synaptics.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
ayaka <ayaka@soulik.info>,
Nicolas Dufresne <nicolas@ndufresne.ca>,
Brian.Starkey@arm.com, boris.brezillon@collabora.com,
frkoenig@chromium.org, hans.verkuil@cisco.com,
hiroh@chromium.org, Hans Verkuil <hverkuil@xs4all.nl>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Helen Koike <helen.koike@collabora.com>
Subject: Re: [RFC]: m2m dec reports the graphics memory requirement
Date: Fri, 28 Jul 2023 11:42:05 +0300 [thread overview]
Message-ID: <20230728084205.GD28824@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CAAFQd5BqDo41U05pmQ+eQvWa0YpJj2OTyKXDAFPwX2S5s5sqBg@mail.gmail.com>
On Fri, Jul 28, 2023 at 05:28:56PM +0900, Tomasz Figa wrote:
> On Fri, Jul 28, 2023 at 5:18 PM Laurent Pinchart wrote:
> > On Fri, Jul 28, 2023 at 01:33:47PM +0900, Sergey Senozhatsky wrote:
> > > On (23/07/27 17:17), Tomasz Figa wrote:
> > > > On Fri, Jun 30, 2023 at 7:47 PM Hsia-Jun Li wrote:
> > > > >
> > > > > Hello All
> > > > >
> > > > > This RFC tries to address the following problems:
> > > > >
> > > > > 1. Application may request too many buffers, increasing pressure to
> > > > > system's memory allocator(Thinking about running Android with 8K UHD
> > > > > playback in a system with only 2 GiB memory available);
> > > >
> > > > Yeah, I think that's something that has to be addressed. It was also
> > > > mentioned recently in the review of the DELETE_BUF series. I think we
> > > > need some kind of accounting of the allocations to the processes, so
> > > > that the per-process limits of memory usage could apply. Let me add
> > > > +Sergey Senozhatsky who often crosses his path with kernel memory
> > > > management.
> > >
> > > That's an interesting topic. The usual approach would be memcg: we
> > > create a memory controller, set memory usage limit, then move tasks
> > > under that controller. The last part is problematic, as it implies
> > > a well-behaving user-space. I'm not aware of a simple way (or any
> > > way for that matter) to "automatically enforce" memcg on a process
> > > group.
> > >
> > > From what I can tell networking code attempts to "enforce" memcg on its
> > > allocations, and hence has to manually charge memcg. For instance, take
> > > a look at sock_reserve_memory() and corresponding mem_cgroup_charge_skmem()
> > > call.
> > >
> > > So I wonder if we can take a closer look at what networking does and
> > > do something similar in vb2.
> >
> > It's a long-standing issue that would be nice to solve indeed. I however
> > wonder if we should do so in vb2, or instead invest our time and efforts
> > in transitioning to DMA heaps and solving the memory accounting issue
> > there.
>
> Would we then provide some way to disable MMAP buffer support for
> applications? Or you're thinking more about backing MMAP allocations
> with DMA-buf heaps internally in the kernel?
Long term I'd like to see MMAP going away, replaced with DMA heaps.
That's veeeery long term though. In the meantime, maybe an option to
disable MMAP support (either a compilation option or a kernel command
line option) would be useful.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2023-07-28 8:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-30 10:47 [RFC]: m2m dec reports the graphics memory requirement Hsia-Jun Li
2023-07-27 8:17 ` Tomasz Figa
2023-07-27 9:30 ` Hsia-Jun Li
2023-07-28 4:33 ` Sergey Senozhatsky
2023-07-28 8:18 ` Laurent Pinchart
2023-07-28 8:28 ` Tomasz Figa
2023-07-28 8:42 ` Laurent Pinchart [this message]
2023-07-28 18:34 ` Randy Li
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=20230728084205.GD28824@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=Brian.Starkey@arm.com \
--cc=Randy.Li@synaptics.com \
--cc=ayaka@soulik.info \
--cc=boris.brezillon@collabora.com \
--cc=frkoenig@chromium.org \
--cc=hans.verkuil@cisco.com \
--cc=helen.koike@collabora.com \
--cc=hiroh@chromium.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=senozhatsky@chromium.org \
--cc=tfiga@chromium.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.