linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeelb@google.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: Dmitry Vyukov <dvyukov@google.com>,
	syzbot+1145ec2e23165570c3ac@syzkaller.appspotmail.com,
	Andrew Morton <akpm@linux-foundation.org>,
	David Howells <dhowells@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	ktsanaktsidis@zendesk.com, LKML <linux-kernel@vger.kernel.org>,
	Michal Hocko <mhocko@suse.com>,
	Mike Rapoport <rppt@linux.vnet.ibm.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
	Matthew Wilcox <willy@infradead.org>,
	Davidlohr Bueso <dave@stgolabs.net>
Subject: Re: general protection fault in put_pid
Date: Thu, 3 Jan 2019 14:18:57 -0800	[thread overview]
Message-ID: <CALvZod7RtD7zcN48S+duFtjLUsSJrmXUqQawh6=ziw62gvOQjg@mail.gmail.com> (raw)
In-Reply-To: <cc088b05-7bc9-778e-30b9-4b8720314001@colorfullife.com>

Hi Manfred,

On Sun, Dec 23, 2018 at 4:26 AM Manfred Spraul <manfred@colorfullife.com> wrote:
>
> Hello Dmitry,
>
> On 12/23/18 10:57 AM, Dmitry Vyukov wrote:
> >
> > I can reproduce this infinite memory consumption with the C program:
> > https://gist.githubusercontent.com/dvyukov/03ec54b3429ade16fa07bf8b2379aff3/raw/ae4f654e279810de2505e8fa41b73dc1d77778e6/gistfile1.txt
> >
> > But this is working as intended, right? It just creates infinite
> > number of large semaphore sets, which reasonably consumes infinite
> > amount of memory.
> > Except that it also violates the memcg bound and a process can have
> > effectively unlimited amount of such "drum memory" in semaphores.
>
> Yes, this is as intended:
>
> If you call semget(), then you can use memory, up to the limits in
> /proc/sys/kernel/sem.
>
> Memcg is not taken into account, an admin must set /proc/sys/kernel/sem.
>
> The default are "infinite amount of memory allowed", as this is the most
> sane default: We had a logic that tried to autotune (i.e.: a new
> namespace "inherits" a fraction of the parent namespaces memory limits),
> but this we more or less always wrong.
>
>

What's the disadvantage of setting the limits in /proc/sys/kernel/sem
high and let the task's memcg limits the number of semaphore a process
can create? Please note that the memory underlying shmget and msgget
is already accounted to memcg.

thanks,
Shakeel

  reply	other threads:[~2019-01-03 22:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 20:23 general protection fault in put_pid syzbot
2018-12-12 10:55 ` Dmitry Vyukov
2018-12-19  9:04   ` Manfred Spraul
2018-12-20 15:36     ` Dmitry Vyukov
2018-12-22 19:07       ` Manfred Spraul
2018-12-23  7:37         ` Dmitry Vyukov
2018-12-23  9:57           ` Dmitry Vyukov
2018-12-23 10:30             ` Dmitry Vyukov
2018-12-23 10:42               ` Dmitry Vyukov
2018-12-23 12:32                 ` Manfred Spraul
2018-12-25  9:35                   ` Dmitry Vyukov
2018-12-26  9:03                     ` Dmitry Vyukov
2018-12-30  9:31                       ` Dmitry Vyukov
2018-12-31  6:35                         ` Dmitry Vyukov
2018-12-25  9:41                   ` Dmitry Vyukov
2018-12-23 12:25             ` Manfred Spraul
2019-01-03 22:18               ` Shakeel Butt [this message]
2019-01-07 18:04                 ` Manfred Spraul
2019-01-07 18:22                   ` Shakeel Butt
2019-03-27 20:10 ` syzbot
2019-03-27 20:27   ` Matthew Wilcox
2019-03-27 22:51     ` David Sterba
2019-11-07 13:42 ` syzbot

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='CALvZod7RtD7zcN48S+duFtjLUsSJrmXUqQawh6=ziw62gvOQjg@mail.gmail.com' \
    --to=shakeelb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=dhowells@redhat.com \
    --cc=dvyukov@google.com \
    --cc=ebiederm@xmission.com \
    --cc=ktsanaktsidis@zendesk.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=mhocko@suse.com \
    --cc=rppt@linux.vnet.ibm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=syzbot+1145ec2e23165570c3ac@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).