[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABeXuvrdz2UwGBj1+gNhnwcy-uG_dKezM_fPqU99rKuQFsyHJw@mail.gmail.com>
Date: Sat, 22 Dec 2018 08:34:55 -0800
From: Deepa Dinamani <deepa.kernel@...il.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: "David S. Miller" <davem@...emloft.net>,
Linux Network Devel Mailing List <netdev@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
y2038 Mailman List <y2038@...ts.linaro.org>
Subject: Re: [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
socket.
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
-Deepa
Powered by blists - more mailing lists