From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
To: vgoyal@redhat.com
Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
lisa.mitchell@hp.com, kumagai-atsushi@mxc.nes.nec.co.jp,
ebiederm@xmission.com, cpw@sgi.com
Subject: Re: [RFC PATCH v1 0/3] kdump, vmcore: Map vmcore memory in direct mapping region
Date: Fri, 18 Jan 2013 23:06:59 +0900 (JST) [thread overview]
Message-ID: <20130118.230659.282304499.d.hatayama@jp.fujitsu.com> (raw)
In-Reply-To: <20130117221348.GJ2237@redhat.com>
From: Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [RFC PATCH v1 0/3] kdump, vmcore: Map vmcore memory in direct mapping region
Date: Thu, 17 Jan 2013 17:13:48 -0500
> On Thu, Jan 10, 2013 at 08:59:34PM +0900, HATAYAMA Daisuke wrote:
>> Currently, kdump reads the 1st kernel's memory, called old memory in
>> the source code, using ioremap per a single page. This causes big
>> performance degradation since page tables modification and tlb flush
>> happen each time the single page is read.
>>
>> This issue turned out from Cliff's kernel-space filtering work.
>>
>> To avoid calling ioremap, we map a whole 1st kernel's memory targeted
>> as vmcore regions in direct mapping table. By this we got big
>> performance improvement. See the following simple benchmark.
>>
>> Machine spec:
>>
>> | CPU | Intel(R) Xeon(R) CPU E7- 4820 @ 2.00GHz (4 sockets, 8 cores) (*) |
>> | Memory | 32 GB |
>> | Kernel | 3.7 vanilla and with this patch set |
>>
>> (*) only 1 cpu is used in the 2nd kenrel now.
>>
>> Benchmark:
>>
>> I executed the following commands on the 2nd kernel and recorded real
>> time.
>>
>> $ time dd bs=$((4096 * n)) if=/proc/vmcore of=/dev/null
>>
>> [3.7 vanilla]
>>
>> | block size | time | performance |
>> | [KB] | | [MB/sec] |
>> |------------+-----------+-------------|
>> | 4 | 5m 46.97s | 93.56 |
>> | 8 | 4m 20.68s | 124.52 |
>> | 16 | 3m 37.85s | 149.01 |
>>
>> [3.7 with this patch]
>>
>> | block size | time | performance |
>> | [KB] | | [GB/sec] |
>> |------------+--------+-------------|
>> | 4 | 17.59s | 1.85 |
>> | 8 | 14.73s | 2.20 |
>> | 16 | 14.26s | 2.28 |
>> | 32 | 13.38s | 2.43 |
>> | 64 | 12.77s | 2.54 |
>> | 128 | 12.41s | 2.62 |
>> | 256 | 12.50s | 2.60 |
>> | 512 | 12.37s | 2.62 |
>> | 1024 | 12.30s | 2.65 |
>> | 2048 | 12.29s | 2.64 |
>> | 4096 | 12.32s | 2.63 |
>>
>
> These are impressive improvements. I missed the discussion on mmap().
> So why couldn't we provide mmap() interface for /proc/vmcore. If that
> works then application can select to mmap/unmap bigger chunks of file
> (instead ioremap mapping/remapping a page at a time).
>
> And if application controls the size of mapping, then it can vary the
> size of mapping based on available amount of free memory. That way if
> somebody reserves less amount of memory, we could still dump but with
> some time penalty.
>
mmap() needs user-space page table in addition to kernel-space's, and
it looks that remap_pfn_range() that creates the user-space page
table, doesn't support large pages, only 4KB pages. If mmaping small
chunks only for small memory programming, then we would again face the
same issue as with ioremap. I don't know whether hugetlbfs supports
mmap and 1GB page now.
Another idea to reduce size of page table is to extend mapping ranges
to cover a whole memory as many 1GB pages as possible. For example,
supporse M is size of system memory, then total size of PGD and PUD
pages to cover M is:
( 1 + roundup(M, 512GB) / 512GB ) * PAGE_SIZE
~ ~~~~~~~~~~~~~~~~~~~~~~~~~
^ ^
| |
PGD page PUD pages
Ideally, 2TB system can be covered with 20KB and 16TB with 132KB only.
So I first want to evaluate this logic. Although I've not seen
actually yet, I expect most of memory maps on tera-byte memory
machines consists of 1GB-aligned huge chunks.
Thanks.
HATAYAMA, Daisuke
next prev parent reply other threads:[~2013-01-18 14:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-10 11:59 HATAYAMA Daisuke
2013-01-10 11:59 ` [RFC PATCH v1 1/3] vmcore: Add function to merge memory mapping of vmcore HATAYAMA Daisuke
2013-01-10 11:59 ` [RFC PATCH v1 2/3] vmcore: map vmcore memory in direct mapping region HATAYAMA Daisuke
2013-01-10 11:59 ` [RFC PATCH v1 3/3] vmcore: read vmcore through " HATAYAMA Daisuke
2013-01-17 22:13 ` [RFC PATCH v1 0/3] kdump, vmcore: Map vmcore memory in " Vivek Goyal
2013-01-18 14:06 ` HATAYAMA Daisuke [this message]
2013-01-18 20:54 ` Vivek Goyal
2013-01-21 6:56 ` HATAYAMA Daisuke
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=20130118.230659.282304499.d.hatayama@jp.fujitsu.com \
--to=d.hatayama@jp.fujitsu.com \
--cc=cpw@sgi.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=lisa.mitchell@hp.com \
--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
all inboxes | Powered by JetHome®