[lkml]   [2018]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] sock: Make sock->sk_tstamp thread-safe
> Are we actually worried about concurrent writers here? I thought the
> only problem was a race between writer and reader, which would mean
> that we could solve it using only a seqcount_t which is cheaper to
> update than a seqlock_t.

I considered using just the seqcount_t. But, I think we do care about
concurrent writers here.
A couple of scenarios I can think of:

1. When you have 2 concurrent recvmsg() calls on a socket, and they
both try to update sk_tstamp.
2. If a socket has don't have one of the SO_TIMESTAMP/NS options set
and you have a first recvmsg and a concurrent ioctl call on the

These are corner cases and if we don't care aout these then we can use
just the sequence counters.

I have missed out tstamp update in the sunrcpc code. If everyone is ok
with this approach, I will add it in when I post an update


 \ /
  Last update: 2018-12-22 18:03    [W:1.299 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site