login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
August
»
22
Re: [RFC v2][PATCH 4/9] Memory management - dump state
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Oren Laadan
Subject:
Re: [RFC v2][PATCH 4/9] Memory management - dump state
Date: Friday, August 22, 2008 - 2:21 pm
Thanks Louis for all the comments. Will fix in v3. Oren. Louis Rilling wrote:
quoted text
> On Wed, Aug 20, 2008 at 11:05:15PM -0400, Oren Laadan wrote: >> For each VMA, there is a 'struct cr_vma'; if the VMA is file-mapped, >> it will be followed by the file name. The cr_vma->npages will tell >> how many pages were dumped for this VMA. Then it will be followed >> by the actual data: first a dump of the addresses of all dumped >> pages (npages entries) followed by a dump of the contents of all >> dumped pages (npages pages). Then will come the next VMA and so on. > > [...] > >> diff --git a/checkpoint/ckpt_mem.c b/checkpoint/ckpt_mem.c >> new file mode 100644 >> index 0000000..a23aa29 >> --- /dev/null >> +++ b/checkpoint/ckpt_mem.c > > [...] > >> +/** >> + * cr_vma_fill_pgarr - fill a page-array with addr/page tuples for a vma >> + * @ctx - checkpoint context >> + * @pgarr - page-array to fill >> + * @vma - vma to scan >> + * @start - start address (updated) >> + */ >> +static int cr_vma_fill_pgarr(struct cr_ctx *ctx, struct cr_pgarr *pgarr, >> + struct vm_area_struct *vma, unsigned long *start) >> +{ >> + unsigned long end = vma->vm_end; >> + unsigned long addr = *start; >> + struct page **pagep; >> + unsigned long *addrp; >> + int cow, nr, ret = 0; >> + >> + nr = pgarr->nleft; >> + pagep = &pgarr->pages[pgarr->nused]; >> + addrp = &pgarr->addrs[pgarr->nused]; >> + cow = !!vma->vm_file; >> + >> + 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 */ >> + >> + 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; >> + } > > + ret = 0; > >> + cond_resched(); >> + } >> + >> + if (IS_ERR(page)) { >> + ret = PTR_ERR(page); >> + break; >> + } > > Need to check ret here: > > + if (ret) > break; > >> + >> + if (page == ZERO_PAGE(0)) >> + page = NULL; /* zero page: ignore */ >> + else if (cow && page_mapping(page) != NULL) >> + page = NULL; /* clean cow: ignore */ >> + else { >> + get_page(page); >> + *(addrp++) = addr; >> + *(pagep++) = page; >> + if (--nr == 0) { >> + addr += PAGE_SIZE; >> + break; >> + } >> + } >> + >> + addr += PAGE_SIZE; >> + } >> + >> + if (unlikely(ret < 0)) { >> + nr = pgarr->nleft - nr; >> + while (nr--) >> + page_cache_release(*(--pagep)); >> + return ret; >> + } >> + >> + *start = addr; >> + return (pgarr->nleft - nr); >> +} > > [...] > > Thanks, > > Louis >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[RFC v2][PATCH 1/9] kernel based checkpoint-restart
, Oren Laadan
, (Wed Aug 20, 7:58 pm)
[RFC v2][PATCH 1/9] Create trivial sys_checkpoint/sys_rest ...
, Oren Laadan
, (Wed Aug 20, 8:03 pm)
[RFC v2][PATCH 2/9] General infrastructure for checkpoint ...
, Oren Laadan
, (Wed Aug 20, 8:04 pm)
[RFC v2][PATCH 3/9] x86 support for checkpoint/restart
, Oren Laadan
, (Wed Aug 20, 8:04 pm)
[RFC v2][PATCH 4/9] Memory management - dump state
, Oren Laadan
, (Wed Aug 20, 8:05 pm)
[RFC v2][PATCH 5/9] Memory managemnet - restore state
, Oren Laadan
, (Wed Aug 20, 8:05 pm)
[RFC v2][PATCH 6/9] Checkpoint/restart: initial documentation
, Oren Laadan
, (Wed Aug 20, 8:06 pm)
[RFC v2][PATCH 7/9] Infrastructure for shared objects
, Oren Laadan
, (Wed Aug 20, 8:06 pm)
[RFC v2][PATCH 8/9] File descriprtors - dump state
, Oren Laadan
, (Wed Aug 20, 8:07 pm)
[RFC v2][PATCH 9/9] File descriprtors (restore)
, Oren Laadan
, (Wed Aug 20, 8:07 pm)
Re: [RFC v2][PATCH 1/9] kernel based checkpoint-restart
, Oren Laadan
, (Wed Aug 20, 10:15 pm)
Re: [RFC v2][PATCH 1/9] Create trivial sys_checkpoint/sys_ ...
, Oren Laadan
, (Wed Aug 20, 10:17 pm)
Re: [RFC v2][PATCH 9/9] File descriprtors (restore)
, Oren Laadan
, (Wed Aug 20, 10:26 pm)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Ingo Molnar
, (Thu Aug 21, 12:30 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Justin P. Mattock
, (Thu Aug 21, 1:01 am)
Re: [RFC v2][PATCH 2/9] General infrastructure for checkpo ...
, Louis Rilling
, (Thu Aug 21, 2:35 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Louis Rilling
, (Thu Aug 21, 2:53 am)
Re: [RFC v2][PATCH 5/9] Memory managemnet - restore state
, Louis Rilling
, (Thu Aug 21, 3:07 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Balbir Singh
, (Thu Aug 21, 3:28 am)
Re: [RFC v2][PATCH 7/9] Infrastructure for shared objects
, Louis Rilling
, (Thu Aug 21, 3:40 am)
Re: [RFC v2][PATCH 8/9] File descriprtors - dump state
, Louis Rilling
, (Thu Aug 21, 4:06 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Ingo Molnar
, (Thu Aug 21, 4:59 am)
Re: [RFC v2][PATCH 1/9] Create trivial sys_checkpoint/sys_ ...
, Dave Hansen
, (Fri Aug 22, 12:32 pm)
Re: [RFC v2][PATCH 2/9] General infrastructure for checkpo ...
, Dave Hansen
, (Fri Aug 22, 1:01 pm)
Re: [RFC v2][PATCH 1/9] Create trivial sys_checkpoint/sys_ ...
, Dave Hansen
, (Fri Aug 22, 1:11 pm)
Re: [RFC v2][PATCH 3/9] x86 support for checkpoint/restart
, Dave Hansen
, (Fri Aug 22, 1:17 pm)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Dave Hansen
, (Fri Aug 22, 1:37 pm)
Re: [RFC v2][PATCH 1/9] Create trivial sys_checkpoint/sys_ ...
, Oren Laadan
, (Fri Aug 22, 2:20 pm)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Oren Laadan
, (Fri Aug 22, 2:21 pm)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Oren Laadan
, (Sat Aug 23, 10:40 pm)
Re: [RFC v2][PATCH 2/9] General infrastructure for checkpo ...
, Oren Laadan
, (Sat Aug 23, 10:58 pm)
Re: [RFC v2][PATCH 2/9] General infrastructure for checkpo ...
, Oren Laadan
, (Sun Aug 24, 7:47 pm)
Re: [RFC v2][PATCH 8/9] File descriprtors - dump state
, Oren Laadan
, (Sun Aug 24, 8:28 pm)
Re: [RFC v2][PATCH 8/9] File descriprtors - dump state
, Louis Rilling
, (Mon Aug 25, 3:30 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Dave Hansen
, (Tue Aug 26, 9:33 am)
Re: [RFC v2][PATCH 2/9] General infrastructure for checkpo ...
, Dave Hansen
, (Tue Aug 26, 9:42 am)
Re: [RFC v2][PATCH 7/9] Infrastructure for shared objects
, Dave Hansen
, (Tue Aug 26, 10:01 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Oren Laadan
, (Tue Aug 26, 5:14 pm)
Re: [RFC v2][PATCH 2/9] General infrastructure for checkpo ...
, Oren Laadan
, (Tue Aug 26, 5:38 pm)
Re: [RFC v2][PATCH 7/9] Infrastructure for shared objects
, Louis Rilling
, (Wed Aug 27, 1:26 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Dave Hansen
, (Wed Aug 27, 8:41 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Louis Rilling
, (Wed Aug 27, 8:57 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Dave Hansen
, (Wed Aug 27, 9:12 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Jeremy Fitzhardinge
, (Wed Aug 27, 9:19 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Serge E. Hallyn
, (Wed Aug 27, 1:34 pm)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Dave Hansen
, (Wed Aug 27, 1:38 pm)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Serge E. Hallyn
, (Wed Aug 27, 1:48 pm)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Dave Hansen
, (Wed Aug 27, 1:56 pm)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Oren Laadan
, (Sun Aug 31, 12:16 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Cedric Le Goater
, (Sun Aug 31, 10:34 am)
Re: [RFC v2][PATCH 4/9] Memory management - dump state
, Serge E. Hallyn
, (Tue Sep 2, 8:32 am)
Re: [Devel] Re: [RFC v2][PATCH 4/9] Memory management - du ...
, Andrey Mirkin
, (Wed Sep 3, 4:43 am)
Re: [Devel] Re: [RFC v2][PATCH 4/9] Memory management - du ...
, Cedric Le Goater
, (Wed Sep 3, 5:15 am)
Re: [Devel] Re: [RFC v2][PATCH 4/9] Memory management - du ...
, Andrey Mirkin
, (Wed Sep 3, 6:29 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Christoph Lameter
[PATCH 1/2] Make page->private usable in compound pages V1
Luben Tuikov
Re: Integration of SCST in the mainstream Linux kernel
Alexey Dobriyan
Re: [2.6.22.2 review 09/84] Fix rfkill IRQ flags.
Michal Nazarewicz
Re: [PATCH] USB: Gadget: g_multi: added INF file for gadget with multiple configur...
Jesse Barnes
Re: PCI probing changes
git
:
Jakub Narebski
Re: GSoC 2008 - Mentors Wanted!
Jan Harkes
Re: git-svn and huge data and modifying the git-svn-HEAD branch directly
Andy Parkins
git-fetch fails with error code 128
Marcus Griep
Re: [PATCH 1/3] Git.pm: Add faculties to allow temp files to be cached
Junio C Hamano
Re: [JGIT PATCH 2/2] Decrease the fetch pack client buffer to the lower minimum
git-commits-head
:
Linux Kernel Mailing List
ARM: 5970/1: nomadik-gpio: fix spinlock usage
Linux Kernel Mailing List
sh-sci: update receive error handling for muxed irqs
Linux Kernel Mailing List
No need to do lock_super() for exclusion in generic_shutdown_super()
Linux Kernel Mailing List
x86, msr: Export the register-setting MSR functions via /dev/*/msr
Linux Kernel Mailing List
Input: gpio-keys - add support for disabling gpios through sysfs
linux-netdev
:
Eric Dumazet
[PATCH] net: ALIGN/PTR_ALIGN cleanup in alloc_netdev_mq()/netdev_priv()
Patrick McHardy
[NET_SCHED]: sch_ingress: remove netfilter support
Rose, Gregory V
RE: __bad_udelay in network driver breaks build
Patrick McHardy
Re: no reassembly for outgoing packets on RAW socket
Frans Pop
svc: failed to register lockdv1 RPC service (errno 97).
openbsd-misc
:
ropers
Re: Real men don't attack straw men
elitdostlar
Seks partneri arayan bayanlar bu adreste - 8878xs706x6438
Marcus Andree
Re: This is what Linus Torvalds calls openBSD crowd
Lars D. Noodén
Re: sshd.config and AllowUsers
Henning Brauer
Re: Sun Blade 1000?
Colocation donated by:
Syndicate