All of lore.kernel.org
 help / color / mirror / Atom feed
From: majianpeng <majianpeng@gmail.com>
To: "Gu Zheng" <guz.fnst@cn.fujitsu.com>
Cc: "Al Viro" <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Re: question about splice
Date: Fri, 26 Jul 2013 15:53:54 +0800	[thread overview]
Message-ID: <201307261553424020855@gmail.com> (raw)
In-Reply-To: 51F22287.8050204@cn.fujitsu.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 2006 bytes --]

>Hi Jianpeng,
>
>On 07/26/2013 03:08 PM, majianpeng wrote:
>
>> Hi all,
>> 	I used splice and found a prolem(at least i call).
>> The demo is:
>> A:splice(regularfileA--->pipe);
>> B:splice(pipe--->regularfileB)
>> Before do B, we modify the data of regA which now in pipe. The data to regularfileB willbe change.
>> If we used the buff
>> A:read(regA, buff);
>> B: write(buff, regB);
>> After A, the contend of regA can't effect the buff.
>> Review the code of splice,I know the pipe share the pagecache of regA.
>
>Right. And also this is the splice's original design intention, using share mmap rather
>than copy_to_user/copy_from_user in order to achieve zero-copy.
>
If it use some method like COW, i think it can avoid this problem.
>Thanks,
>Gu
>
>> Maybe this is not a problem or am i missing something?
>
>> 
>> Thanks!
>> Jianpeng MaN‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^?)Þº{.n?+‰·¥Š{±‘êçzX§¶\x17›¡Ü¨}©ž²Æ z?&j:+v‰¨?\a«‘êçzZ+€?+zf£¢·hšˆ§~†­†Ûi?ûàz?\x1e®w¥¢??™¨è­?&?)ߢ^[f”ù^jÇ«y§m…á@A«a¶Ú\x7f?
>0¶ìh?\x0få’i\x7f
>
>
Thanks!
Jianpeng Ma
>Hi Jianpeng,
>
>On 07/26/2013 03:08 PM, majianpeng wrote:
>
>> Hi all,
>> 	I used splice and found a prolem(at least i call).
>> The demo is:
>> A:splice(regularfileA--->pipe);
>> B:splice(pipe--->regularfileB)
>> Before do B, we modify the data of regA which now in pipe. The data to regularfileB willbe change.
>> If we used the buff
>> A:read(regA, buff);
>> B: write(buff, regB);
>> After A, the contend of regA can't effect the buff.
>> Review the code of splice,I know the pipe share the pagecache of regA.
>
>Right. And also this is the splice's original design intention, using share mmap rather
>than copy_to_user/copy_from_user in order to achieve zero-copy.
>
>Thanks,
>Gu
>
>> Maybe this is not a problem or am i missing something?
>
>> 
>> Thanks!
>> Jianpeng MaN‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^?)Þº{.n?+‰·¥Š{±‘êçzX§¶\x17›¡Ü¨}©ž²Æ z?&j:+v‰¨?\a«‘êçzZ+€?+zf£¢·hšˆ§~†­†Ûi?ûàz?\x1e®w¥¢??™¨è­?&?)ߢ^[f”ù^jÇ«y§m…á@A«a¶Ú\x7f?
>0¶ìh?\x0få’i\x7f
>
>

WARNING: multiple messages have this Message-ID (diff)
From: majianpeng <majianpeng@gmail.com>
To: "Gu Zheng" <guz.fnst@cn.fujitsu.com>
Cc: "Al Viro" <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Re: question about splice
Date: Fri, 26 Jul 2013 15:53:54 +0800	[thread overview]
Message-ID: <201307261553424020855@gmail.com> (raw)
In-Reply-To: 51F22287.8050204@cn.fujitsu.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 2104 bytes --]

>Hi Jianpeng,
>
>On 07/26/2013 03:08 PM, majianpeng wrote:
>
>> Hi all,
>> 	I used splice and found a prolem(at least i call).
>> The demo is:
>> A:splice(regularfileA--->pipe);
>> B:splice(pipe--->regularfileB)
>> Before do B, we modify the data of regA which now in pipe. The data to regularfileB willbe change.
>> If we used the buff
>> A:read(regA, buff);
>> B: write(buff, regB);
>> After A, the contend of regA can't effect the buff.
>> Review the code of splice,I know the pipe share the pagecache of regA.
>
>Right. And also this is the splice's original design intention, using share mmap rather
>than copy_to_user/copy_from_user in order to achieve zero-copy.
>
If it use some method like COW, i think it can avoid this problem.
>Thanks,
>Gu
>
>> Maybe this is not a problem or am i missing something?
>
>> 
>> Thanks!
>> Jianpeng MaN‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^?)Þº{.n?+‰·¥Š{±‘êçzX§¶\x17›¡Ü¨}©ž²Æ z?&j:+v‰¨?\a«‘êçzZ+€?+zf£¢·hšˆ§~†­†Ûi?ûàz?\x1e®w¥¢??™¨è­?&?)ߢ^[f”ù^jÇ«y§m…á@A«a¶Ú\x7f?
>0¶ìh?\x0få’i\x7f
>
>
Thanks!
Jianpeng Ma
>Hi Jianpeng,
>
>On 07/26/2013 03:08 PM, majianpeng wrote:
>
>> Hi all,
>> 	I used splice and found a prolem(at least i call).
>> The demo is:
>> A:splice(regularfileA--->pipe);
>> B:splice(pipe--->regularfileB)
>> Before do B, we modify the data of regA which now in pipe. The data to regularfileB willbe change.
>> If we used the buff
>> A:read(regA, buff);
>> B: write(buff, regB);
>> After A, the contend of regA can't effect the buff.
>> Review the code of splice,I know the pipe share the pagecache of regA.
>
>Right. And also this is the splice's original design intention, using share mmap rather
>than copy_to_user/copy_from_user in order to achieve zero-copy.
>
>Thanks,
>Gu
>
>> Maybe this is not a problem or am i missing something?
>
>> 
>> Thanks!
>> Jianpeng MaN‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^?)Þº{.n?+‰·¥Š{±‘êçzX§¶\x17›¡Ü¨}©ž²Æ z?&j:+v‰¨?\a«‘êçzZ+€?+zf£¢·hšˆ§~†­†Ûi?ûàz?\x1e®w¥¢??™¨è­?&?)ߢ^[f”ù^jÇ«y§m…á@A«a¶Ú\x7f?
>0¶ìh?\x0få’i\x7f
>
>ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2013-07-26  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26  7:08 question about splice majianpeng
2013-07-26  7:08 ` majianpeng
2013-07-26  7:17 ` Gu Zheng
2013-07-26  7:17   ` Gu Zheng
2013-07-26  7:53   ` majianpeng [this message]
2013-07-26  7:53     ` majianpeng

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=201307261553424020855@gmail.com \
    --to=majianpeng@gmail.com \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.