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
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Russell King
Re: ARM defconfig files
Jesse Barnes
Re: PCI MSI breaks when booting with nosmp
James Morris
Re: [AppArmor 01/41] Pass struct vfsmount to the inode_create LSM hook
Philip Langdale
[PATCH 2.6.19] mmc: Add support for SDHC cards (Take 4)
Oren Laadan
[PATCH v21 073/100] c/r: Add AF_UNIX support (v12)
git
:
Felipe Contreras
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
Paolo Ciarrocchi
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
Johannes Schindelin
[PATCH] fetch: refuse to fetch into the current branch in a non-bare repository
Johannes Schindelin
Re: [PATCH] Fix install-doc-quick target
Peter Oberndorfer
Subject: [PATCH] fix stg edit command
linux-netdev
:
Ursula Braun
[patch 2/8] [PATCH] af_iucv: sync sk shutdown flag if iucv path is quiesced
Andi Kleen
Re: RFC: Nagle latency tuning
David Miller
Re: [RFC 0/5] generic rx recycling
Gary Thomas
Re: Marvell 88E609x switch?
Chuck Lever
Re: [RFC] ipv6: Change %pI6 format to output compacted addresses?
git-commits-head
:
Linux Kernel Mailing List
New device ID for sc92031 [1088:2031]
Linux Kernel Mailing List
e1000e: Expose MDI-X status via ethtool change
Linux Kernel Mailing List
arm/imx/gpio: GPIO_INT_{HIGH,LOW}_LEV are not necessarily constant
Linux Kernel Mailing List
powerpc/kexec: Add support for FSL-BookE
Linux Kernel Mailing List
trivial: fix comment typo in fs/compat.c
openbsd-misc
:
Theo de Raadt
Re: RES: OpenBSD on IBM System X3550 7879
Bret S. Lambert
Re: any web management gui for pf ?
Rob Shepherd
x86 hardware for router system
Flickr Photo Map for iPad and iPhone
Thanks for the Great Launch of Flickr Photo Map for iPad + iPhone
Nick Holland
Re: Install OpenBSD from USB ?
Colocation donated by:
Syndicate