Skip to content

Never drop socket syscalls to ensure we have fdinfo for subsequent binds. SMAGENT-1270#1312

Merged
thom-sd merged 1 commit intodevfrom
socket_never_drop
Feb 19, 2019
Merged

Never drop socket syscalls to ensure we have fdinfo for subsequent binds. SMAGENT-1270#1312
thom-sd merged 1 commit intodevfrom
socket_never_drop

Conversation

@thom-sd
Copy link
Contributor

@thom-sd thom-sd commented Feb 8, 2019

No description provided.

@thom-sd thom-sd requested a review from anoop-sysd February 8, 2019 07:23
@anoop-sysd anoop-sysd requested a review from adalton February 8, 2019 19:01
@thom-sd
Copy link
Contributor Author

thom-sd commented Feb 12, 2019

@gianlucaborello, we've encountered some situations where we're missing listening ports from bind() after the socket() calls are dropped. So, we're marking socket as NEVER_DROP here.

However, we're not quite sure what the performance implications would be of marking socket calls as NEVER_DROP.
Would it make more sense to have the driver pass the fdinfo with the bind instead?

@gianlucaborello
Copy link
Contributor

You could probably patch the bind code and return some information about the socket that you'd need in order to recreate it. My perspective about the dropping vs not dropping, completely ignorant to the specific details, is that you are already marking close as non-droppable, so at a minimum the driver is always hit by at least one single system call per connection.

So, if you also keep socket I don't expect you'll get hit with 10X the events, but more like 2X in the very worst case, and this is for a system call for which I'd be curious to see a workload that generates more than a few thousands per second, since these are network connections. If we were talking about an actual I/O event (e.g. write), then my feedback would be different, as in those cases it would be pretty easy to generate 1000X the amount of events necessary to create the socket.

Please also notice that I didn't initially write that code, so my opinion might not be too valuable here, and I might be missing something that you're already considering (e.g. actual cost of the userspace dragent process required to create and add the fd to the table, but it seems like you'll want that anyway).

@thom-sd thom-sd merged commit 4a8c708 into dev Feb 19, 2019
@thom-sd thom-sd deleted the socket_never_drop branch February 19, 2019 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants