亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1460 | 回復: 1
打印 上一主題 下一主題

[內(nèi)核入門] 請教零拷貝recvfile patch [復制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2014-09-05 14:41 |只看該作者 |倒序瀏覽
本人菜鳥,最近在看內(nèi)核sendfile的實現(xiàn),好奇有沒有“recvfile”實現(xiàn),
查資料發(fā)現(xiàn)可以通過pipe中轉(zhuǎn),用兩次splice實現(xiàn),
后來無意間發(fā)現(xiàn)這個帖子,給出了個實現(xiàn)recvfile的部分核心代碼,
不過三樓回帖說有這個實現(xiàn)很nasty(請忽略Camel case...)并且有風險

http://www.gossamer-threads.com/lists/linux/kernel/1751496

他說的問題主要是:

So, we are nesting up to 32 page locks here. That's bad. And we are
nesting kmap() calls for all the pages individually - is that even
safe to do?
   
So, what happens when we've got 16 pages in, and the filesystem has
allocated space for those 16 blocks, and we get ENOSPC on the 17th?
Sure, you undo the state here, but what about the 16 blocks that the
filesystem has allocated to this file? There's no notification to
the filesystem that they need to be truncated away because the write
failed....

想請教高手:
1,kmap多次使用會有什么問題?
2,同時寫多個page cache頁面,中途出錯會造成什么問題,況且這個實現(xiàn)有去做kunmap和write_end


論壇徽章:
0
2 [報告]
發(fā)表于 2014-09-06 14:18 |只看該作者
關于第二點個人猜測:
可能是基于這樣一個考慮,當文件傳輸接受方突然檢測到錯誤(例如connection fail)它可以確認自己到底flush多少offset到disk并返回,這樣就可以支持斷點續(xù)傳應用。
歡迎拍磚啊
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP