Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Tesarik <ptesarik@suse.cz>
To: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: wangnan0@huawei.com, kumagai-atsushi@mxc.nes.nec.co.jp,
	kexec@lists.infradead.org, sdu.liu@huawei.com,
	hui.geng@huawei.com
Subject: Re: [PATCH 0/4] Replace lseek..write/read to pwrite/pread
Date: Wed, 30 Apr 2014 13:53:04 +0200	[thread overview]
Message-ID: <20140430135304.3c7e7ed5@hananiah.suse.cz> (raw)
In-Reply-To: <20140430.204138.209328404.d.hatayama@jp.fujitsu.com>

On Wed, 30 Apr 2014 20:41:38 +0900 (JST)
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> wrote:

> From: Wang Nan <wangnan0@huawei.com>
> Subject: [PATCH 0/4] Replace lseek..write/read to pwrite/pread
> Date: Sat, 26 Apr 2014 12:07:05 +0800
> 
> > In original code there are many operations read from /write to specific
> > positions of a file. This series of patches replace such patterns to
> > pread/pwrite calls, reduces more than 100 lines of code.
> > 
> 
> I'm now writing pthread support patch set and it will naturally
> include pread/pwrite like this patch set.
> 
> It sounds to me that using pread/pwrite only to reduce lseek code is
> weak in motivation. Is there another visible merit? For example, any
> kind of performance improvement. I guess it's small even if exists
> compared to I/O.

There is no user-visible benefit just from applying the patch, that's
right.

The main benefit is that these pread/pwrite operations are atomic and do
not move the file offset, so all subprocesses (or threads) can share
the same file descriptor. This allows to remove reopen_dump_memory(),
for example.

Anyway, is improving code readability really so weak argument?

Petr T

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

  reply	other threads:[~2014-04-30 11:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-26  4:07 [PATCH 0/4] Replace lseek..write/read to pwrite/pread Wang Nan
2014-04-26  4:07 ` [PATCH 1/4] makedumpfile: redefine numerical limitaction macros Wang Nan
2014-04-28 14:23   ` Petr Tesarik
2014-04-28 22:21     ` Wang Nan
2014-04-26  4:07 ` [PATCH 2/4] makedumpfile: cleanup non-standard ULONGLONG_MAX macros Wang Nan
2014-04-26  4:07 ` [PATCH 3/4] makedumpfile: add -D_GNU_SOURCE to CFLAGS Wang Nan
2014-04-30 11:55   ` HATAYAMA Daisuke
2014-05-04  1:28     ` Wang Nan
2014-04-26  4:07 ` [PATCH 4/4] makedumpfile: use pread/pwrite to eliminate lseek Wang Nan
2014-04-30 11:41 ` [PATCH 0/4] Replace lseek..write/read to pwrite/pread HATAYAMA Daisuke
2014-04-30 11:53   ` Petr Tesarik [this message]
2014-04-30 12:19     ` HATAYAMA Daisuke
2014-04-30 13:21       ` Petr Tesarik

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=20140430135304.3c7e7ed5@hananiah.suse.cz \
    --to=ptesarik@suse.cz \
    --cc=d.hatayama@jp.fujitsu.com \
    --cc=hui.geng@huawei.com \
    --cc=kexec@lists.infradead.org \
    --cc=kumagai-atsushi@mxc.nes.nec.co.jp \
    --cc=sdu.liu@huawei.com \
    --cc=wangnan0@huawei.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