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: Re: [criu] 1M guard page ruined restore
Date: Tue, 20 Jun 2017 13:41:38 +0300 [thread overview]
Message-ID: <20170620104138.GC1909@uranus.lan> (raw)
In-Reply-To: <alpine.LSU.2.11.1706200259080.11599@eggly.anvils>
On Tue, Jun 20, 2017 at 03:23:20AM -0700, Hugh Dickins wrote:
>
> Sorry for breaking you: we realized there was some risk of that.
>
> Would it be acceptable to you, to judge which kind of a kernel it is,
> by whether it has a global variable stack_guard_gap? I don't know
> if that would be a horrible hack, or the kind of thing that you're
> used to doing all over the place. Judging by kernel version will
> be awkward, since the patch is being backported to stable kernels.
Wait, maybe we could use VmFlags from /proc/$pid/smaps for that?
I mean we show "gd/gu" flag there is it's stack area. Say we can
add additional flag which would point that we should not delete
guard page from the output. Currently we've in criu
/* Add a guard page only if here is enough space for it */
if ((vma_area->e->flags & MAP_GROWSDOWN) &&
*prev_end < vma_area->e->start)
vma_area->e->start -= PAGE_SIZE; /* Guard page */
So that on the restore we use mmap with MAP_FIXED. Hugh, I'm still
analyzing the problem in criu, maybe this code snippet the only
problem and just lifting up smaps flags will be enough. Just
gimme some more time.
> But I'm surprised by your explanation above: maybe I'm confused,
> or maybe the explanation is different. Because as I see it, the
> change I made in that patch *maintained* consistency for CRIU:
>
> It used to be the case that there was a gap page included in the
> extent of the stack vma, but it didn't really belong in there,
> therefore show_map_vma() massaged the addresses shown to conceal it.
>
> Whereas now with the 1be7107fbe18 commit, the gap (page or more)
> is not included in the extent of the stack vma, so there's no
> longer any need to massage the addresses shown to conceal it.
>
> We do need to understand this fairly quickly, since those stable
> backports will pose more of a problem for you than the v4.12
> release itself.
Seems patches already are in fly for most of distros. So yes,
I'm trying my best right now.
Cyrill
next prev parent reply other threads:[~2017-06-20 10:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-20 7:52 [criu] 1M guard page ruined restore Cyrill Gorcunov
2017-06-20 10:23 ` Hugh Dickins
2017-06-20 10:41 ` Cyrill Gorcunov [this message]
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=20170620104138.GC1909@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.