public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>
Subject: Re: [PATCH] vmcore: call remap_pfn_range() separately for respective partial pages
Date: Tue, 03 Dec 2013 14:16:35 +0900	[thread overview]
Message-ID: <529D6933.9070609@jp.fujitsu.com> (raw)
In-Reply-To: <529D3158.2080603@jp.fujitsu.com>

(2013/12/03 10:18), HATAYAMA Daisuke wrote:
> (2013/12/03 0:27), Vivek Goyal wrote:
>> On Thu, Nov 28, 2013 at 05:48:02PM +0900, HATAYAMA Daisuke wrote:
>>> Hello Vivek,
>>>
>>> Here is a patch set for mmap failure for /proc/vmcore.
>>> Could you try to use this on the problematic system?
>>>
>>> This patch doesn't copy partial pages to the 2nd kernel, only prepares
>>> vmcore objects for respective partial pages to invoke remap_pfn_range()
>>> for individual partial pages.
>>
>> Hi Hatayama,
>>
>> Thanks for the patch. Ok, I see that partial pages will be put in a separate
>> call to remap_oldmem_pfn_range() and this time it should succeed.
>>
>> I am wondering what do you think about your old approach of copying
>> only relevant old memory to a new kernel page in new kernel. I kind
>> of feel little uncomfortable with the idea of rounding down start
>> and roudning up end to page size boundaries and then accessing the
>> full page using oldmem interface. A safer approach might be to allocate
>> page in new kernel, read *only* those bytes as reported by elf header
>> and fill rest of the page with zeros.
>>
>> Thanks
>> Vivek
>>
>
> Even if copying partial pages into the 2nd kernel, we need to use ioremap()
> once on them, and I think the ioremap() is exactly similar to
> remap_pfn_range() for a single page. There seems no difference on safeness
> between them.
>

I suspected some kind of pre-fetching could be performed when just page table
is created. But it's common thing between the two cases above. Then, as you say,
it would be safer to read less data from non-System-RAM area. Copying seems
better in our case.

Another concern to reading data from partial pages is a possibility of
undesirable hardware prefetch to non-System-RAM area. Is it better to disable this?

> Also, current /proc/vmcore shows user-land tools a shape with holes not
> filled with zeros both in case of read() and in case of mmap(). If we adapt
> copying one without reading data in holes, shape of /proc/vmcore gets
> changed again.
>

So, next patch will change data in holes by filling them with zeros.

BTW, we have now page cache interface implemented by Michael Holzheu, but
we have yet to use it on x86 because we've never wanted it so far. It's
natural to use it to read partial pages on-demand, but I also in part think
that it's not proper time to start using new mechanism that needs to be tested
more. How do you think?

-- 
Thanks.
HATAYAMA, Daisuke


  reply	other threads:[~2013-12-03  5:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28  8:48 [PATCH] vmcore: call remap_pfn_range() separately for respective partial pages HATAYAMA Daisuke
2013-12-02 15:27 ` Vivek Goyal
2013-12-03  1:18   ` HATAYAMA Daisuke
2013-12-03  5:16     ` HATAYAMA Daisuke [this message]
2013-12-03 15:12       ` Vivek Goyal
2013-12-04  9:05         ` HATAYAMA Daisuke
2013-12-03 15:03     ` Vivek Goyal

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=529D6933.9070609@jp.fujitsu.com \
    --to=d.hatayama@jp.fujitsu.com \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    --cc=kumagai-atsushi@mxc.nes.nec.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vgoyal@redhat.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