Re: Re: question about splice

majianpeng
2013-07-26T07:54:09Z

[-- 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¥