public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Caz Yokoyama <Caz.Yokoyama@intel.com>
To: Ashutosh Dixit <ashutosh.dixit@intel.com>,
	Chris Wilson <chris@chris-wilson.co.uk>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] lib: Incrementally mlock()
Date: Wed, 20 Feb 2019 14:28:37 -0800	[thread overview]
Message-ID: <59c310ae5f80043c8f3fc70a2a25d0ac7de698e4.camel@intel.com> (raw)
In-Reply-To: <87lg2bauhg.fsf@intel.com>

Yes, it is a bug.

With the bug, mlocking is sparsely distributed, i.e. there are holes
between mlocked memories. Therefore, process is not killed.

By fixing the bug, continuously mlocked as planned and killed.

My test shows OOM kills a process when a process mlocks 128mb less than
pinnable memory while not when less than 256mb.

I'll send a patch where
- intel_get_total_pinnable_mem() reports pinnable memory
- test_shrink() mlocks X(>128, <256)mb
-caz

On Tue, 2019-02-19 at 21:39 -0800, Ashutosh Dixit wrote:
> On Tue, Feb 19 2019 at 09:26:56 PM, Ashutosh Dixit <
> ashutosh.dixit@intel.com> wrote:
> > On Tue, Feb 19 2019 at 03:21:10 PM, Chris Wilson <
> > chris@chris-wilson.co.uk> wrote:
> > > As we already have the previous portion of the mmap mlocked, we
> > > only
> > > need to mlock() the fresh portion for testing available memory.
> > 
> > Still looking at what is wrong with the patch but with the patch
> > the
> > test is unable to lock as much memory as before and invoke the
> > shrinker. Here are the outputs before and after the patch on a
> > system
> > with 16 GB:
> 
> OK, found the bug. The bug is that can_mlock is u64*. Therefore
> can_mlock must be cast to u8* on these two lines:
> 
> 
> > +     if (mlock(can_mlock + bytes, inc))
> 
> and 
> 
> > +	igt_assert(!mlock(can_mlock + locked, *can_mlock - locked));
> 
> However when we do this, the parent process invariably gets killed by
> the OOM killer, something which was not happening previously:
> 
> # ./i915_suspend --run-subtest shrink
> IGT-Version: 1.23-g9ef791ce (x86_64) (Linux: 5.0.0-rc5+ x86_64)
> Starting subtest: shrink
> child 0 died with signal 9, Killed
> child 0 died with signal 9, Killed
> child 0 died with signal 9, Killed
> child 0 died with signal 9, Killed
> child 0 died with signal 9, Killed
> child 0 died with signal 9, Killed
> Killed
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-02-20 22:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20  1:13 [igt-dev] [igt PATCH 0/1] lib: igt@i915_suspend@shrink faster Caz Yokoyama
2019-02-19 19:05 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-02-19 22:37 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-02-19 22:49 ` [igt-dev] ✓ Fi.CI.BAT: success for lib: igt@i915_suspend@shrink faster (rev2) Patchwork
2019-02-20  0:53 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-02-20  1:13 ` [igt-dev] [igt PATCH 1/1] igt@i915_suspend@shrink faster Caz Yokoyama
2019-02-19 22:21   ` [igt-dev] [PATCH i-g-t] lib: Incrementally mlock() Chris Wilson
2019-02-20  5:26     ` Ashutosh Dixit
2019-02-20  5:39     ` Ashutosh Dixit
2019-02-20 22:28       ` Caz Yokoyama [this message]
2019-02-26 17:42     ` [igt-dev] FW: " Yokoyama, Caz
2019-02-26 17:42       ` Chris Wilson
2019-02-26 20:34         ` Caz Yokoyama
2019-02-26 21:31           ` Chris Wilson
2019-02-27  0:40             ` Caz Yokoyama
2019-02-27  8:13               ` Chris Wilson
2019-02-20  3:14   ` [igt-dev] [igt PATCH 1/1] igt@i915_suspend@shrink faster Ashutosh Dixit
2019-02-26 17:56 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib: igt@i915_suspend@shrink faster (rev3) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-02-27 16:29 [igt-dev] [PATCH i-g-t] lib: Incrementally mlock() Chris Wilson
2019-02-27 17:34 ` Caz Yokoyama
2019-02-27 21:15   ` Chris Wilson
2019-02-28 18:56 ` Caz Yokoyama

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=59c310ae5f80043c8f3fc70a2a25d0ac7de698e4.camel@intel.com \
    --to=caz.yokoyama@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.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