linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Jaewon Kim <jaewon31.kim@samsung.com>
Cc: "jstultz@google.com" <jstultz@google.com>,
	"tjmercier@google.com" <tjmercier@google.com>,
	"sumit.semwal@linaro.org" <sumit.semwal@linaro.org>,
	"daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jaewon31.kim@gmail.com" <jaewon31.kim@gmail.com>
Subject: Re: [PATCH v3] dma-buf/heaps: system_heap: avoid too much allocation
Date: Wed, 12 Apr 2023 15:01:58 +0200	[thread overview]
Message-ID: <ZDarxo2Q4cgFHdbh@dhcp22.suse.cz> (raw)
In-Reply-To: <20230412123532epcms1p23092e51df04b3fb4e18e90b324ebcaa4@epcms1p2>

On Wed 12-04-23 21:35:32, Jaewon Kim wrote:
> >On Wed 12-04-23 20:37:59, Jaewon Kim wrote:
> >> Limiting dmabuf memory may be required. But I think there
> >> is no nice and reasonable way so far.
> >
> >If that is really the way then the patch doesn't really add a big
> >benefit. It doesn't really prevent OOMs (or panics due to OOM) as the
> >allocator still allows to consume arbitrary amount of memory. The
> >provided check is not able to tell between buggy and legit calls.
> >-- 
> >Michal Hocko
> >SUSE Labs
> 
> Yes it could be. Though the buggy call is blocked by totalram_pages check,

It seems our definitions of buggy differ here. I do not see much
difference between totalram_pages +- PAGE_SIZE (or any epsilon for that
matter). Both would put the system down to its knees without a way out
other than panic.

> mm may suffer memory shortage due to the huge memory consumption through
> dma-buf system heap. We just hope Android LMKD or oomk kills the memory
> hoggers prior to oom panic.

You seem to be missing an important point. If the global OOM killer is
not able to find a victim the LMKD or oomk are highly unlikely as well
(unless they ignore OOM_SCORE_ADJ_MIN).

> IMO if possible mm should be able to track the dma-buf size as stat in
> mm_rss_stat for each process.

I do remember some proposals from the past and IIRC the main problem was
how to attribute those buffers to the actual owner.

I believe I have give you some arguments to consider. The rest is up to
you. As I've said I do not have any stakes in dmabuf. The patch itself
is not actively harmful, it is just adding an illusion of a fix while it
doesn't give much.
-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2023-04-12 13:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230410073304epcas1p4cf3079b096994d69472b7801bd530bc7@epcas1p4.samsung.com>
2023-04-10  7:32 ` Jaewon Kim
2023-04-12  8:22   ` Michal Hocko
     [not found]   ` <CGME20230410073304epcas1p4cf3079b096994d69472b7801bd530bc7@epcms1p7>
2023-04-12  8:57     ` Jaewon Kim
2023-04-12  9:23       ` Michal Hocko
     [not found]       ` <CGME20230410073304epcas1p4cf3079b096994d69472b7801bd530bc7@epcms1p4>
2023-04-12  9:44         ` Jaewon Kim
2023-04-12 11:02           ` Michal Hocko
     [not found]           ` <CGME20230410073304epcas1p4cf3079b096994d69472b7801bd530bc7@epcms1p8>
2023-04-12 11:37             ` Jaewon Kim
2023-04-12 11:51               ` Michal Hocko
     [not found]               ` <CGME20230410073304epcas1p4cf3079b096994d69472b7801bd530bc7@epcms1p2>
2023-04-12 12:35                 ` Jaewon Kim
2023-04-12 13:01                   ` Michal Hocko [this message]
2023-04-12 16:49               ` T.J. Mercier
2023-04-12 22:10                 ` Jaewon Kim
     [not found]               ` <CGME20230410073304epcas1p4cf3079b096994d69472b7801bd530bc7@epcms1p6>
2023-04-13  0:16                 ` Jaewon Kim
2023-04-13  6:55                   ` Michal Hocko
     [not found]                   ` <CGME20230410073304epcas1p4cf3079b096994d69472b7801bd530bc7@epcms1p1>
2023-04-13  7:01                     ` Jaewon Kim

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=ZDarxo2Q4cgFHdbh@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=hannes@cmpxchg.org \
    --cc=jaewon31.kim@gmail.com \
    --cc=jaewon31.kim@samsung.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tjmercier@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox