All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deepa Dinamani <deepa.kernel@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	Linux Network Devel Mailing List <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	y2038 Mailman List <y2038@lists.linaro.org>
Subject: Re: [PATCH] sock: Make sock->sk_tstamp thread-safe
Date: Sat, 22 Dec 2018 08:34:55 -0800	[thread overview]
Message-ID: <CABeXuvrdz2UwGBj1+gNhnwcy-uG_dKezM_fPqU99rKuQFsyHJw@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a3LivERgLTTmS0A35CoebS3n+cNWNXkoYKGam+fVR-Dxg@mail.gmail.com>

> 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

WARNING: multiple messages have this Message-ID (diff)
From: Deepa Dinamani <deepa.kernel@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: y2038 Mailman List <y2038@lists.linaro.org>,
	Linux Network Devel Mailing List <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sock: Make sock->sk_tstamp thread-safe
Date: Sat, 22 Dec 2018 08:34:55 -0800	[thread overview]
Message-ID: <CABeXuvrdz2UwGBj1+gNhnwcy-uG_dKezM_fPqU99rKuQFsyHJw@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a3LivERgLTTmS0A35CoebS3n+cNWNXkoYKGam+fVR-Dxg@mail.gmail.com>

> 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
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

  reply	other threads:[~2018-12-22 17:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 20:27 [PATCH] sock: Make sock->sk_tstamp thread-safe Deepa Dinamani
2018-12-22 13:29 ` Arnd Bergmann
2018-12-22 13:29   ` Arnd Bergmann
2018-12-22 16:34   ` Deepa Dinamani [this message]
2018-12-22 16:34     ` Deepa Dinamani
2018-12-22 23:03 ` David Miller
2018-12-23  7:31 ` Eric Dumazet
2018-12-23  7:31   ` Eric Dumazet
2018-12-23 18:50   ` Deepa Dinamani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABeXuvrdz2UwGBj1+gNhnwcy-uG_dKezM_fPqU99rKuQFsyHJw@mail.gmail.com \
    --to=deepa.kernel@gmail.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=y2038@lists.linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.