[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51B943E1.9040101@jp.fujitsu.com>
Date: Thu, 13 Jun 2013 13:00:33 +0900
From: HATAYAMA Daisuke <d.hatayama@...fujitsu.com>
To: Michael Holzheu <holzheu@...ux.vnet.ibm.com>
CC: HATAYAMA Daisuke <d.hatayama@...il.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
kexec@...ts.infradead.org, Jan Willeke <willeke@...ibm.com>,
linux-kernel@...r.kernel.org,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Vivek Goyal <vgoyal@...hat.com>
Subject: Re: [PATCH v5 3/5] vmcore: Introduce remap_oldmem_pfn_range()
(2013/06/12 18:13), Michael Holzheu wrote:
> On Tue, 11 Jun 2013 21:42:15 +0900
> HATAYAMA Daisuke <d.hatayama@...il.com> wrote:
>
>> 2013/6/11 Michael Holzheu <holzheu@...ux.vnet.ibm.com>:
>>> On Mon, 10 Jun 2013 22:40:24 +0900
>>> HATAYAMA Daisuke <d.hatayama@...il.com> wrote:
>>>
>>>> 2013/6/8 Michael Holzheu <holzheu@...ux.vnet.ibm.com>:
<cut>
>
> Thanks for that hint! So together with your other comment regarding
> error checking for __read_vmcore() the function would look like the
> following:
>
> static int mmap_vmcore_fault(struct vm_area_struct *vma, struct'vm_fault *vmf)
> {
> struct address_space *mapping = vma->vm_private_data;
> pgoff_t index = vmf->pgoff;
> struct page *page;
> loff_t src;
> char *buf;
>
> page = find_or_create_page(mapping, index, GFP_KERNEL);
> if (!page)
> return VM_FAULT_OOM;
> if (!PageUptodate(page)) {
> src = index << PAGE_CACHE_SHIFT;
> buf = (void *) (page_to_pfn(page) << PAGE_SHIFT);
> if (__read_vmcore(buf, PAGE_SIZE, &src, 0) < 0) {
> unlock_page(page);
> return VM_FAULT_SIGBUS;
> }
> SetPageUptodate(page);
> }
> unlock_page(page);
> vmf->page = page;
> return 0;
> }
>
> Perhaps one open issue remains:
>
> Can we remove the page from the page cache if __read_vmcore() fails?
Sorry, I overlooked the case that __read_vmcore() returns ENOMEM since it uses ioremap() internally in which page table allocation happens. Fault handler should return VM_FAULT_OOM in that case.
--
Thanks.
HATAYAMA, Daisuke
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists