mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jack Miller <millerjo@us.ibm.com>
To: Davidlohr Bueso <davidlohr@hp.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	Milton Miller II <miltonm@us.ibm.com>,
	anton@au1.ibm.com
Subject: Re: [RESEND] shm: shm exit scalability fixes
Date: Tue, 17 Jun 2014 14:55:10 -0500	[thread overview]
Message-ID: <20140617195510.GA22266@toadite.austin.ibm.com> (raw)
In-Reply-To: <1403027312.2464.5.camel@buesod1.americas.hpqcorp.net>

On Tue, Jun 17, 2014 at 10:48:32AM -0700, Davidlohr Bueso wrote:
> On Tue, 2014-06-17 at 12:27 -0500, Jack Miller wrote:
> > [ RESEND note: Adding relevant CCs, fixed a couple of typos in commit message,
> > patches unchanged. Original intro follows. ]
> > 
> > All -
> > 
> > This is small set of patches our team has had kicking around for a few versions
> > internally that fixes tasks getting hung on shm_exit when there are many
> > threads hammering it at once.
> > 
> > Anton wrote a simple test to cause the issue:
> > 
> > http://ozlabs.org/~anton/junkcode/bust_shm_exit.c
> 
> I'm actually in the process of adding shm microbenchmarks to perf-bench
> so I might steal this :-)
>

Cool!

> > 
> > Before applying this patchset, this test code will cause either hanging
> > tracebacks or pthread out of memory errors.
> 
> Are you seeing this issue in any real world setups? While the program
> does stress the path you mention quite well, I fear it is very
> unrealistic... how many shared mem segments do real applications
> actually use/create for scaling issues to appear?

We've seen this while running multiple workloads on the same machine. One
workload that used shared memory extensively, and one that created many
shortlived threads. The testcase is just simulating these two workloads
running simultaneously, so I don't think it's too unreasonable to expect it
could happen in the wild.

Even if this is synthetic, the testcase could also be seen as proof of an
unprivileged denial of service as an arbitrary user could run bust_shm_exit
and subsequently start overloading the system.

> 
> I normally wouldn't mind optimizing synthetic cases like this, but a
> quick look at patch 1/3 shows that we're adding an extra overhead (16
> bytes) in the task_struct.

Yeah, that's definitely not to be done lightly, but I think it's worth it to
make the work on exit proportional to the actual task usage instead of the
number of segments in the namespace.

> 
> In any case, I will take a closer look at the set.

Thanks! I'd appreciate any feedback.

- Jack


  reply	other threads:[~2014-06-17 19:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 17:27 Jack Miller
2014-06-17 17:27 ` [PATCH 1/3] shm: Make exit_shm work proportional to task activity Jack Miller
2014-06-18 22:59   ` Andrew Morton
2014-06-17 17:27 ` [PATCH 2/3] shm: Allow exit_shm in parallel if only marking orphans Jack Miller
2014-06-17 17:27 ` [PATCH 3/3] shm: Remove unneeded extern for function Jack Miller
2014-06-17 17:48 ` [RESEND] shm: shm exit scalability fixes Davidlohr Bueso
2014-06-17 19:55   ` Jack Miller [this message]
2014-06-18  0:15     ` Davidlohr Bueso
2014-06-18  2:53   ` Anton Blanchard
2014-06-18  4:41     ` Michael Ellerman
2014-06-18 22:55 ` Andrew Morton

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=20140617195510.GA22266@toadite.austin.ibm.com \
    --to=millerjo@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=anton@au1.ibm.com \
    --cc=davidlohr@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miltonm@us.ibm.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

all inboxes | Powered by JetHome®