From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Network Development <netdev@vger.kernel.org>,
David Miller <davem@davemloft.net>,
rds-devel@oss.oracle.com,
Santosh Shilimkar <santosh.shilimkar@oracle.com>
Subject: Re: [PATCH net-next] RDS: deliver zerocopy completion notification with data as an optimization
Date: Wed, 21 Feb 2018 19:26:46 -0500 [thread overview]
Message-ID: <20180222002646.GI15244@oracle.com> (raw)
In-Reply-To: <CAF=yD-+oihB6Opusn1hBVsEvk654BEg2LN6vXUtwS4q+2gkivQ@mail.gmail.com>
On (02/21/18 18:45), Willem de Bruijn wrote:
>
> I do mean returning 0 instead of -EAGAIN if control data is ready.
> Something like
>
> @@ -611,7 +611,8 @@ int rds_recvmsg(struct socket *sock, struct msghdr
> *msg, size_t size,
>
> if (!rds_next_incoming(rs, &inc)) {
> if (nonblock) {
> - ret = -EAGAIN;
> + ncookies = rds_recvmsg_zcookie(rs, msg);
> + ret = ncookies ? 0 : -EAGAIN;
> break;
> }
Yes, but you now have an implicit branch based on ncookies, so I'm
not sure it saved all that much? like I said let me revisit this
> By the way, the put_cmsg is unconditional even if the caller did
> not supply msg_control. So it is basically no longer safe to ever
> call read, recv or recvfrom on a socket if zerocopy notifications
> are outstanding.
Wait, I thought put_cmsg already checks for these things.
> It is possible to check msg_controllen before even deciding whether
> to try to dequeue notifications (and take the lock). I see that this is
> not common. But RDS of all cases seems to do this, in
> rds_notify_queue_get:
yes the comment above that code suggests that this bit of code
was done to avoid calling put_cmsg while holding the rs_lock.
One bit of administrivia though- if I now drop sk_error_queue for
PF_RDS, I'll have to fix selftests in the same patch too, so the
patch will get a bit bulky (and thus a bit more difficult to review).
next prev parent reply other threads:[~2018-02-22 0:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-21 20:19 [PATCH net-next] RDS: deliver zerocopy completion notification with data as an optimization Sowmini Varadhan
2018-02-21 21:04 ` Santosh Shilimkar
2018-02-21 21:54 ` Willem de Bruijn
2018-02-21 22:14 ` Sowmini Varadhan
2018-02-21 22:50 ` Willem de Bruijn
2018-02-21 23:03 ` Sowmini Varadhan
2018-02-21 23:45 ` Willem de Bruijn
2018-02-22 0:26 ` Sowmini Varadhan [this message]
2018-02-22 0:39 ` Willem de Bruijn
2018-02-22 13:36 ` Sowmini Varadhan
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=20180222002646.GI15244@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=rds-devel@oss.oracle.com \
--cc=santosh.shilimkar@oracle.com \
--cc=willemdebruijn.kernel@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).