public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Hugh Dickins <hughd@google.com>, 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>,
	Adrian Reber <areber@redhat.com>
Subject: Re: [criu] 1M guard page ruined restore
Date: Thu, 22 Jun 2017 18:05:00 +0300	[thread overview]
Message-ID: <20170622150500.GA28378@uranus> (raw)
In-Reply-To: <20170622142300.GA762@redhat.com>

On Thu, Jun 22, 2017 at 04:23:00PM +0200, Oleg Nesterov wrote:
> Cyrill,
> 
> I am replying to my own email because I got lost in numerous threads/emails
> connected to stack guard/gap problems. IIRC you confirmed that the 1st load
> doesn't fail and the patch fixes the problem. So everything is clear, and we
> will discuss this change in another thread.

Yes.

> But let me add that (imo) you should not change this test-case. You simply
> should not run it if kerndat_mm_guard_page_maps() detects the new kernel at
> startup.
> 
> The new version makes no sense for criu, afaics. Yes, yes, thank you very
> much for this test-case, it found the kernel regression ;) But criu has
> nothing to do with this problem, and it is not clear right now if we are
> going to fix it or not.

To be fair the first reporter is Andrew Vagin :) He wrote the test and
poked me to look into. If we're not going to fix it in the kernel then
sure -- we won't run it on new kernels (hell knows though, what else
application may fail, as Linus pointed it's perfectly valid to map and
autogrow the vma).

> With the recent kernel changes criu should never look outside of start-end
> region reported by /proc/maps; and restore doesn't even need to know if a
> GROWSDOWN region will actually grow or not, because (iiuc) you do not need
> to auto-grow the stack vma during restore, criu re-creates the whole vma
> with the same length using MAP_FIXED and it should never write below the
> addr returned by mmap(MAP_FIXED).

Yes, and we already do, thanks.

> So (afaics) the only complication is that the process can be dumped on
> a system running with (say) stack_guard_gap=4K kernel parameter, and then
> restored on another system running with stack_guard_gap=1M. In this case
> the application may fail after restore if it tries to auto-grow the stack,
> but this is unlikely and this is another story.

Yes, it's different problem and it would be cool to be able to fetch this
value somehow (maybe via sysfs or something). Otherwise if such container
migration case happen we simply find error code in the restore log and
I fear it won't be clear that the error happened exactly because of
gap settings variation.

  reply	other threads:[~2017-06-22 15:05 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
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 [this message]
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=20170622150500.GA28378@uranus \
    --to=gorcunov@gmail.com \
    --cc=akpm@linuxfoundation.org \
    --cc=areber@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox