public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Michal Hocko <mhocko@suse.com>
Cc: Kalesh Singh <kaleshsingh@google.com>,
	surenb@google.com, minchan@kernel.org,
	gregkh@linuxfoundation.org, hridya@google.com, jannh@google.com,
	kernel-team@android.com, Alexey Dobriyan <adobriyan@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	Alexey Gladkov <gladkov.alexey@gmail.com>,
	Szabolcs Nagy <szabolcs.nagy@arm.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Daniel Jordan <daniel.m.jordan@oracle.com>,
	Michel Lespinasse <walken@google.com>,
	Bernd Edlinger <bernd.edlinger@hotmail.de>,
	Andrei Vagin <avagin@gmail.com>,
	Yafang Shao <laoar.shao@gmail.com>, Hui Su <sh_def@163.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	linux-api@vger.kernel.org
Subject: Re: [PATCH] procfs/dmabuf: Add /proc/<pid>/task/<tid>/dmabuf_fds
Date: Wed, 27 Jan 2021 12:08:50 +0100	[thread overview]
Message-ID: <7dd33165-4fb9-a424-9b5e-08c69583c979@amd.com> (raw)
In-Reply-To: <YBFIMIR2FXoYDd+0@dhcp22.suse.cz>

Am 27.01.21 um 12:02 schrieb Michal Hocko:
> On Wed 27-01-21 11:53:55, Christian König wrote:
> [...]
>> In general processes are currently not held accountable for memory they
>> reference through their file descriptors. DMA-buf is just one special case.
> True
>
>> In other words you can currently do something like this
>>
>> fd = memfd_create("test", 0);
>> while (1)
>>      write(fd, buf, 1024);
>>
>> and the OOM killer will terminate random processes, but never the one
>> holding the memfd reference.
> memfd is just shmem under cover, no? And that means that the memory gets
> accounted to MM_SHMEMPAGES. But you are right that this in its own
> doesn't help much if the fd is shared and the memory stays behind a
> killed victim.

I think so, yes. But I just tested this and it doesn't seem to work 
correctly.

When I run the few lines above the OOM killer starts to terminate 
processes, but since my small test program uses very very little memory 
basically everything else gets terminated (including X, desktop, sshd 
etc..) before it is terminated as well.

Regards,
Christian.

> But I do agree with you that there are resources which are bound to a
> process life time but the oom killer has no idea about those as they are
> not accounted on a per process level and/or oom_badness doesn't take
> them into consideration.


  reply	other threads:[~2021-01-27 11:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 22:51 [PATCH] procfs/dmabuf: Add /proc/<pid>/task/<tid>/dmabuf_fds Kalesh Singh
2021-01-27  9:05 ` Michal Hocko
2021-01-27 10:53   ` Christian König
2021-01-27 11:02     ` Michal Hocko
2021-01-27 11:08       ` Christian König [this message]
2021-01-27 11:23         ` Michal Hocko
2021-01-27 10:47 ` Jann Horn
2021-01-27 10:57   ` Michal Hocko
2021-01-27 11:01     ` Christian König
2021-01-27 11:27       ` Michal Hocko
2021-01-28 10:01       ` Pekka Paalanen
     [not found]         ` <c95af15d-8ff4-aea0-fa1b-3157845deae1@amd.com>
     [not found]           ` <20210129161334.788b8fd0@eldfell>
     [not found]             ` <wgUb8smQArgjbRFYMPYVDmukBT-_BrqG2M6XIOkWdBcW_x-m4ORnl3VOvH3J4wrsNGMoOXqMAro0UmkdVXFNso9PEiNCFGEeruibhWsmU34=@emersion.fr>
     [not found]               ` <f680ced7-3402-4a1e-4565-35ad7cd0c46d@amd.com>
2021-02-03 10:23                 ` Daniel Vetter
2021-01-27 17:16   ` Kalesh Singh

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=7dd33165-4fb9-a424-9b5e-08c69583c979@amd.com \
    --to=christian.koenig@amd.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@gmail.com \
    --cc=bernd.edlinger@hotmail.de \
    --cc=corbet@lwn.net \
    --cc=daniel.m.jordan@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ebiederm@xmission.com \
    --cc=gladkov.alexey@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hridya@google.com \
    --cc=jannh@google.com \
    --cc=kaleshsingh@google.com \
    --cc=keescook@chromium.org \
    --cc=kernel-team@android.com \
    --cc=laoar.shao@gmail.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=sh_def@163.com \
    --cc=sumit.semwal@linaro.org \
    --cc=surenb@google.com \
    --cc=szabolcs.nagy@arm.com \
    --cc=walken@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