Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: Dave Hansen <dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	jeremy-TSDbQ3PG+2Y@public.gmane.org,
	arnd-r2nGTMty4D4@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC v4][PATCH 4/9] Memory management (dump)
Date: Wed, 10 Sep 2008 14:28:21 -0400	[thread overview]
Message-ID: <48C811C5.9000102@cs.columbia.edu> (raw)
In-Reply-To: <1221065728.6781.19.camel@nimitz>



Dave Hansen wrote:
> On Tue, 2008-09-09 at 03:42 -0400, Oren Laadan wrote:
>> +       while (addr < end) {
>> +               struct page *page;
>> +
>> +               /*
>> +                * simplified version of get_user_pages(): already have vma,
>> +                * only need FOLL_TOUCH, and (for now) ignore fault stats.
>> +                *
>> +                * FIXME: consolidate with get_user_pages()
>> +                */
>> +
>> +               cond_resched();
>> +               while (!(page = follow_page(vma, addr, FOLL_TOUCH))) {
>> +                       ret = handle_mm_fault(vma->vm_mm, vma, addr, 0);
>> +                       if (ret & VM_FAULT_ERROR) {
>> +                               if (ret & VM_FAULT_OOM)
>> +                                       ret = -ENOMEM;
>> +                               else if (ret & VM_FAULT_SIGBUS)
>> +                                       ret = -EFAULT;
>> +                               else
>> +                                       BUG();
>> +                               break;
>> +                       }
>> +                       cond_resched();
>> +                       ret = 0;
>> +               }
> 
> get_user_pages() is really the wrong thing to use here.  It makes pages
> *present* so that we can do things like hand them off to a driver.  For
> checkpointing, we really don't care about that.  It's a waste of time,
> for instance to perform faults to fill the mappings up with zero pages
> and page tables.  Just think of what will happen the first time we touch
> a very large, very sparse anonymous area.  We'll probably kill the
> system just allocating page tables.  Take a look at the comment in
> follow_page().  This is a similar operation to core dumping, and we need
> to be careful.
> 
> This might be fine for a proof of concept, but it needs to be thought
> out much more thoroughly before getting merged.  I guess I'm
> volunteering to go do that.

The intention is not to allocate unallocated pages, but to get the page
pointer and bring in swapped out pages if necessary. (Avoiding swap-in
is possible, but left for future optimization).

Indeed, follow_page() does the work just fine; Of course, it should be
called with FOLL_ANON instead of FOLL_TOUCH. Thanks for pointing out.

Oren.

  parent reply	other threads:[~2008-09-10 18:28 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1220946154-15174-1-git-send-email-orenl@cs.columbia.edu>
     [not found] ` <1220946154-15174-1-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-09  7:42   ` [RFC v4][PATCH 1/9] Create syscalls: sys_checkpoint, sys_restart Oren Laadan
2008-09-09  7:42   ` [RFC v4][PATCH 2/9] General infrastructure for checkpoint restart Oren Laadan
2008-09-09  7:42   ` [RFC v4][PATCH 3/9] x86 support for checkpoint/restart Oren Laadan
2008-09-09  7:42   ` [RFC v4][PATCH 4/9] Memory management (dump) Oren Laadan
2008-09-09  7:42   ` [RFC v4][PATCH 5/9] Memory managemnet (restore) Oren Laadan
2008-09-09  7:42   ` [RFC v4][PATCH 6/9] Checkpoint/restart: initial documentation Oren Laadan
2008-09-09  7:42   ` [RFC v4][PATCH 7/9] Infrastructure for shared objects Oren Laadan
2008-09-09  7:42   ` [RFC v4][PATCH 8/9] File descriprtors (dump) Oren Laadan
2008-09-09  7:42   ` [RFC v4][PATCH 9/9] File descriprtors (restore) Oren Laadan
2008-09-09 18:06   ` [RFC v4][PATCH 0/9] Kernel based checkpoint/restart` Dave Hansen
     [not found] ` <1220946154-15174-9-git-send-email-orenl@cs.columbia.edu>
     [not found]   ` <1220946154-15174-9-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-09  8:06     ` [RFC v4][PATCH 8/9] File descriprtors (dump) Vegard Nossum
2008-09-09  8:23     ` Vegard Nossum
2008-09-11  5:02     ` MinChan Kim
     [not found]   ` <19f34abd0809090123y36c51395pfa694799f7a2afb@mail.gmail.com>
     [not found]     ` <19f34abd0809090123y36c51395pfa694799f7a2afb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-10  2:01       ` Oren Laadan
     [not found]   ` <28c262360809102202t73c12a09uc6edd5ce93ce36d3@mail.gmail.com>
     [not found]     ` <28c262360809102202t73c12a09uc6edd5ce93ce36d3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-11  6:37       ` Oren Laadan
     [not found] ` <1220946154-15174-4-git-send-email-orenl@cs.columbia.edu>
     [not found]   ` <1220946154-15174-4-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-09  8:17     ` [RFC v4][PATCH 3/9] x86 support for checkpoint/restart Ingo Molnar
     [not found]   ` <20080909081713.GA18946@elte.hu>
     [not found]     ` <20080909081713.GA18946-X9Un+BFzKDI@public.gmane.org>
2008-09-09 23:23       ` Oren Laadan
     [not found] ` <1220946154-15174-10-git-send-email-orenl@cs.columbia.edu>
     [not found]   ` <1220946154-15174-10-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-09 16:26     ` [RFC v4][PATCH 9/9] File descriprtors (restore) Dave Hansen
     [not found]   ` <1220977581.23386.216.camel@nimitz>
2008-09-10  1:49     ` Oren Laadan
     [not found]     ` <48C727B6.9000700@cs.columbia.edu>
     [not found]       ` <48C727B6.9000700-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-10 16:09         ` Dave Hansen
     [not found]       ` <1221062969.6781.5.camel@nimitz>
2008-09-10 18:55         ` Oren Laadan
     [not found] ` <1220946154-15174-3-git-send-email-orenl@cs.columbia.edu>
     [not found]   ` <1220946154-15174-3-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-10  6:10     ` [RFC v4][PATCH 2/9] General infrastructure for checkpoint restart MinChan Kim
     [not found]   ` <28c262360809092310x244c0c8dvca8a6022c7d0d225@mail.gmail.com>
     [not found]     ` <28c262360809092310x244c0c8dvca8a6022c7d0d225-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-10 18:36       ` Oren Laadan
     [not found]     ` <48C813A0.2020404@cs.columbia.edu>
     [not found]       ` <48C813A0.2020404-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-10 22:54         ` MinChan Kim
     [not found]       ` <28c262360809101554l1faab2a9na6b9066a07747554@mail.gmail.com>
     [not found]         ` <28c262360809101554l1faab2a9na6b9066a07747554-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-11  6:44           ` Oren Laadan
     [not found] ` <1220946154-15174-7-git-send-email-orenl@cs.columbia.edu>
     [not found]   ` <1220946154-15174-7-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-10  7:13     ` [RFC v4][PATCH 6/9] Checkpoint/restart: initial documentation MinChan Kim
     [not found] ` <1220946154-15174-5-git-send-email-orenl@cs.columbia.edu>
     [not found]   ` <1220946154-15174-5-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-09  9:22     ` [RFC v4][PATCH 4/9] Memory management (dump) Vegard Nossum
2008-09-10  7:51     ` MinChan Kim
2008-09-10 16:55     ` Dave Hansen
2008-09-10 21:38     ` Dave Hansen
2008-09-12 16:57     ` Dave Hansen
     [not found]   ` <1221065728.6781.19.camel@nimitz>
2008-09-10 17:45     ` Dave Hansen
2008-09-10 18:28     ` Oren Laadan [this message]
     [not found]       ` <48C811C5.9000102-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-10 21:03         ` Cleanups for [PATCH " Dave Hansen
     [not found]   ` <28c262360809100051o24e69f1cp45b73201d9c748e9@mail.gmail.com>
     [not found]     ` <28c262360809100051o24e69f1cp45b73201d9c748e9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-10 23:49       ` [RFC v4][PATCH " MinChan Kim
     [not found] ` <1220946154-15174-6-git-send-email-orenl@cs.columbia.edu>
     [not found]   ` <20080909160724.GA23397@us.ibm.com>
     [not found]     ` <20080909160724.GA23397-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-09-09 23:35       ` [RFC v4][PATCH 5/9] Memory managemnet (restore) Oren Laadan
     [not found]     ` <48C7082A.1050608@cs.columbia.edu>
     [not found]       ` <48C7082A.1050608-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-10 15:00         ` Serge E. Hallyn
     [not found]   ` <1220946154-15174-6-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-09 16:07     ` Serge E. Hallyn
2008-09-10 19:31     ` Dave Hansen
     [not found]   ` <1221075083.6781.34.camel@nimitz>
2008-09-10 19:48     ` Oren Laadan
     [not found]     ` <48C824A2.8050708@cs.columbia.edu>
     [not found]       ` <48C824A2.8050708-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-09-10 20:49         ` Dave Hansen
     [not found]       ` <1221079757.6781.54.camel@nimitz>
2008-09-11  6:59         ` Oren Laadan

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=48C811C5.9000102@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=jeremy-TSDbQ3PG+2Y@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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