Bug 13537 - Using sendfile = yes with SMB2 can cause CPU spin.
Summary: Using sendfile = yes with SMB2 can cause CPU spin.
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-18 23:13 UTC by Jeremy Allison
Modified: 2018-08-14 11:11 UTC (History)
4 users (show)

See Also:


Attachments
git-am fix for master. (13.52 KB, patch)
2018-07-18 23:14 UTC, Jeremy Allison
no flags Details
git-am fix proposed for master. (14.73 KB, patch)
2018-07-19 17:48 UTC, Jeremy Allison
no flags Details
git-am fix for 4.9.rcNext, 4.8.next, 4.7.next. (15.41 KB, patch)
2018-07-20 18:44 UTC, Jeremy Allison
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2018-07-18 23:13:03 UTC
For SMB2 we set the socket to non-blocking, the low-level sendfile code doesn't cope well with this (it just loops on EAGAIN).

Reported on samba-technical by Vadim Lazovskiy <vadim.lazovskiy@gmail.com>.
Comment 1 Jeremy Allison 2018-07-18 23:14:59 UTC
Created attachment 14327 [details]
git-am fix for master.

Possible patch for master. Needs confirmation from reporter.
Comment 2 Jeremy Allison 2018-07-19 17:48:28 UTC
Created attachment 14329 [details]
git-am fix proposed for master.

Updated with code to only change/restore socket state on EAGAIN/EWOULDBLOCK returns.
Comment 3 Jeremy Allison 2018-07-19 17:50:02 UTC
Reporter confirmed fix addresses his problem.
Comment 4 Jeremy Allison 2018-07-20 18:44:30 UTC
Created attachment 14330 [details]
git-am fix for 4.9.rcNext, 4.8.next, 4.7.next.

Cherry-picked from master. Applies cleanly to 4.7.next, 4.8.next, 4.9.rcNext.
Comment 5 Jeremy Allison 2018-07-23 18:18:20 UTC
Karolin please apply to the relevant branches. Thanks !
Comment 6 Karolin Seeger 2018-07-28 04:15:56 UTC
(In reply to Jeremy Allison from comment #5)
Pushed to autobuild-v4-{9,8,7}-test.
Comment 7 Karolin Seeger 2018-08-14 11:11:22 UTC
(In reply to Karolin Seeger from comment #6)
Pushed to all branches.
Closing out bug report.

Thanks!