All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Hugh Dickins <hughd@google.com>
Cc: Andrey Vagin <avagin@openvz.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Pavel Emelyanov <xemul@virtuozzo.com>,
	Dmitry Safonov <dsafonov@virtuozzo.com>,
	Andrew Morton <akpm@linuxfoundation.org>,
	Oleg Nesterov <oleg@redhat.com>
Subject: [criu] 1M guard page ruined restore
Date: Tue, 20 Jun 2017 10:52:06 +0300	[thread overview]
Message-ID: <20170620075206.GB1909@uranus.lan> (raw)

Hi Hugh! We're running our tests on latest vanilla kernel all the time,
and recently we've got an issue on restore:

https://github.com/xemul/criu/issues/322

 | (00.410614)      4: cg: Cgroups 1 inherited from parent
 | (00.410858)      4: Opened local page read 3 (parent 0)
 | (00.410961)      4:     premap 0x00000000400000-0x00000000406000 -> 00007fe65badf000
 | (00.410981)      4:     premap 0x00000000605000-0x00000000606000 -> 00007fe65bae5000
 | (00.410997)      4:     premap 0x00000000606000-0x00000000607000 -> 00007fe65bae6000
 | (00.411013)      4:     premap 0x000000025a0000-0x000000025c1000 -> 00007fe65bae7000
 | (00.411036)      4: Error (criu/mem.c:726): Unable to remap a private vma: Invalid argument
 | (00.412779)      1: Error (criu/cr-restore.c:1465): 4 exited, status=1

Andrew has narrowed it down to the commit

 | commit 1be7107fbe18eed3e319a6c3e83c78254b693acb
 | Author: Hugh Dickins <hughd@google.com>
 | Date:   Mon Jun 19 04:03:24 2017 -0700
 | 
 |     mm: larger stack guard gap, between vmas

and looking into the patch I see the procfs output has been changed

 | diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
 | index f0c8b33..520802d 100644
 | --- a/fs/proc/task_mmu.c
 | +++ b/fs/proc/task_mmu.c
 | @@ -300,11 +300,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
 |  
 |         /* We don't show the stack guard page in /proc/maps */
 |         start = vma->vm_start;
 | -       if (stack_guard_page_start(vma, start))
 | -               start += PAGE_SIZE;
 |         end = vma->vm_end;
 | -       if (stack_guard_page_end(vma, end))
 | -               end -= PAGE_SIZE;
 |  
 |         seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
 |         seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",

For which we of course are not ready because we've been implying the
guard page is returned here so we adjust addresses locally when saving
them into images.

So now we need to figure out somehow if show_map_vma accounts [PAGE_SIZE|guard_area] or not,
I guess we might use kernel version here but it won't be working fine on custom kernels,
or kernels with the patch backported.

Second I guess we might need to detect @stack_guard_gap runtime as
well but not yet sure because we only have found this problem and
hasn't been investigating it deeply yet. Hopefully will do in a
day or couple (I guess we still have some time before the final
kernel release).

	Cyrill

             reply	other threads:[~2017-06-20  7:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20  7:52 Cyrill Gorcunov [this message]
2017-06-20 10:23 ` [criu] 1M guard page ruined restore Hugh Dickins
2017-06-20 10:41   ` Cyrill Gorcunov
2017-06-21 15:22   ` Cyrill Gorcunov
2017-06-21 15:48     ` Cyrill Gorcunov
2017-06-21 15:57     ` Oleg Nesterov
2017-06-21 16:04       ` Cyrill Gorcunov
2017-06-21 17:01         ` Oleg Nesterov
2017-06-21 17:15           ` Dmitry Safonov
2017-06-21 17:19             ` Dmitry Safonov
2017-06-21 17:31               ` Oleg Nesterov
2017-06-21 17:37                 ` Dmitry Safonov
2017-06-21 17:52                 ` Dmitry Safonov
2017-06-22  1:24                   ` Hugh Dickins
2017-06-22  8:06                     ` Cyrill Gorcunov
2017-06-21 17:15           ` Oleg Nesterov
2017-06-21 17:53             ` Cyrill Gorcunov
2017-06-21 17:16           ` Willy Tarreau
2017-06-22 14:23           ` Oleg Nesterov
2017-06-22 15:05             ` Cyrill Gorcunov
2017-06-20 10:51 ` Oleg Nesterov
2017-06-20 11:10   ` Cyrill Gorcunov
2017-06-20 11:55   ` Cyrill Gorcunov

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=20170620075206.GB1909@uranus.lan \
    --to=gorcunov@gmail.com \
    --cc=akpm@linuxfoundation.org \
    --cc=avagin@openvz.org \
    --cc=dsafonov@virtuozzo.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=xemul@virtuozzo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.