Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Tesarik <ptesarik@suse.cz>
To: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Cc: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>,
	kexec mailing list <kexec@lists.infradead.org>,
	Jan Willeke <willeke@de.ibm.com>
Subject: Re: [PATCH] makedumpfile: Use file offset in initialize_mmap()
Date: Thu, 5 Mar 2015 22:30:05 +0100	[thread overview]
Message-ID: <20150305223005.07c552d8@hananiah.suse.cz> (raw)
In-Reply-To: <20150304134418.4d1f0cbf@holzheu>

On Wed, 4 Mar 2015 13:44:18 +0100
Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:

> On Tue, 3 Mar 2015 11:07:50 +0100
> Petr Tesarik <ptesarik@suse.cz> wrote:
> 
> > On Tue, 3 Mar 2015 10:15:43 +0100
> > Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:
> 
> [snip]
> 
> > > I did a quick test with your patch and it looks like the mmap mode
> > > on my s390 system is slower than the read mode:
> > 
> > That's sad. OTOH I had similar results on a file mmap some time ago.
> > The cost of copying data was less than the cost of handling a series of
> > minor page faults.
> 
> I think we understood the problem: As for the read path, also for mmap
> the memory is copied into a temporary buffer:
> 
>  static int read_with_mmap(off_t offset, void *bufptr, ...)
>  {
> 
>  ...
>         memcpy(bufptr, info->mmap_buf +
>                (offset - info->mmap_start_offset), read_size);
> 
> 
> Because on s390 copy_to_user() is as fast as userspace memcpy() we
> don't have any benefit here. The only saving is due to less
> mmap()/munmap() than read() system calls because bigger chunks
> are mapped than read.
> 
> If you specify -d 31 the dump memory is fragmented and we have to
> issue more mmap()/munmap() calls and therefore also the system
> call overhead increases.
> 
> If we really want to speed up the mmap path on s390 we probably
> have to get rid of the temporary buffer.
> 
> What do you think?

I'm not sure. Clearly, we should get rid of the temporary buffer. OTOH
this slow-down should be observed on all architectures, not just s390.

Now, mmap should have been implemented in the cache code, not above it.
Since I wrote the cache, this task is probably up to me.

Stay tuned,
Petr T

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2015-03-05 21:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 12:14 [PATCH] makedumpfile: Use file offset in initialize_mmap() Petr Tesarik
2015-03-03  1:31 ` Atsushi Kumagai
2015-03-03  9:15 ` Michael Holzheu
2015-03-03 10:07   ` Petr Tesarik
2015-03-04 12:44     ` Michael Holzheu
2015-03-05 21:30       ` Petr Tesarik [this message]
2015-03-06  9:11         ` Michael Holzheu

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=20150305223005.07c552d8@hananiah.suse.cz \
    --to=ptesarik@suse.cz \
    --cc=holzheu@linux.vnet.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=kumagai-atsushi@mxc.nes.nec.co.jp \
    --cc=willeke@de.ibm.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