All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Tomasz Figa <tfiga@chromium.org>
Cc: Hsia-Jun Li <Randy.Li@synaptics.com>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	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>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	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 13:33:47 +0900	[thread overview]
Message-ID: <20230728043347.GM955071@google.com> (raw)
In-Reply-To: <CAAFQd5AFJwreERs2Hn_A+3g51OLF6F0eWjx2+rgiZV=FR_61fA@mail.gmail.com>

On (23/07/27 17:17), Tomasz Figa wrote:
> On Fri, Jun 30, 2023 at 7:47 PM Hsia-Jun Li <Randy.Li@synaptics.com> 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.

  parent reply	other threads:[~2023-07-28  4:33 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 [this message]
2023-07-28  8:18     ` Laurent Pinchart
2023-07-28  8:28       ` Tomasz Figa
2023-07-28  8:42         ` Laurent Pinchart
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=20230728043347.GM955071@google.com \
    --to=senozhatsky@chromium.org \
    --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=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nicolas@ndufresne.ca \
    --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.