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>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [igt PATCH v2 1/1] lib: Incrementally mlock()
Date: Fri, 22 Feb 2019 09:28:07 -0800	[thread overview]
Message-ID: <15b240d4e9a039b822f9769135459fa1a6aec6da.camel@intel.com> (raw)
In-Reply-To: <87bm33hkel.fsf@intel.com>

On Fri, 2019-02-22 at 08:12 -0800, Ashutosh Dixit wrote:
> On Thu, Feb 21 2019 at 07:03:57 PM, Caz Yokoyama <
> caz.yokoyama@intel.com> wrote:
> >  	__igt_waitchildren();
> > -	igt_assert(!mlock(can_mlock, *can_mlock));
> 
> This is also wrong. The parent process needs to lock the memory for
> the
> calculation of the amount of locked memory to be correct. Also 
I answered in my commit message as below.

When the parent process mlocks, i.e.,
  igt_assert(!mlock(can_mlock, *can_mlock));
most likely killed.

"most likely" is not correct". "100% of probability" is. 

With the bug, both parent and child mlock 8 times far beyond location.
mlock() may fail because it may beyond mmaped area.

With fixing the bug, the child updates (*can_mlock). Then the parent
mlocks(*can_mlock) and killed by OOM.

Only solution I found is 1) the parent does not mlock(*can_mlock),
2) mlock 252mb less memory.

BTW, dmesg has

[ 4605.251250]
[   8318]     0  8318   497037   315802  2768896      194          1000
i915_suspend
[ 4605.251252]
[   8320]     0  8320   497037   103550  1056768      194          1000
i915_suspend
[ 4605.251254] Out of memory: Kill process 8318 (i915_suspend) score
1317 or sacrifice child
[ 4605.251267] Killed process 8320 (i915_suspend) total-vm:1988148kB,
anon-rss:0kB, file-rss:0kB, shmem-rss:414200kB
[ 4605.251470] oom_reaper: reaped process 8320 (i915_suspend), now
anon-rss:0kB, file-rss:0kB, shmem-rss:414200kB
[ 4605.251560] Purging GPU memory, 0 pages freed, 2327 pages still
pinned.
[ 4605.251563] 1 and 0 pages still available in the bound and unbound
GPU page lists.
 
> explains
> why this tests runs for so long with this patch.
Correction. It runs 7-9 sec. I did not kill X server.

I'll do no further investigation for this test because this is
disabled.
-caz


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

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22  2:03 [igt-dev] [igt PATCH v2 1/1] lib: Incrementally mlock() Caz Yokoyama
2019-02-21 20:25 ` Chris Wilson
2019-02-22 16:12 ` Ashutosh Dixit
2019-02-22 17:28   ` Caz Yokoyama [this message]
2019-02-26 16:06 ` 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=15b240d4e9a039b822f9769135459fa1a6aec6da.camel@intel.com \
    --to=caz.yokoyama@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --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