All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: linux-sctp@vger.kernel.org
Subject: RE: [PATCH net-next 2/5] net: sctp: implement rfc6458, 5.3.4. SCTP_SNDINFO cmsg support
Date: Tue, 08 Jul 2014 10:47:35 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1726E33B@AcuExch.aculab.com> (raw)
In-Reply-To: <1404507908-6949-3-git-send-email-dborkman@redhat.com>

From: Daniel Borkmann
> On 07/07/2014 10:46 AM, David Laight wrote:
> ...
> >> @@ -1858,8 +1870,8 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
> >>   	pr_debug("%s: we have a valid association\n", __func__);
> >>
> >>   	if (!sinfo) {
> >> -		/* If the user didn't specify SNDRCVINFO, make up one with
> >> -		 * some defaults.
> >> +		/* If the user didn't specify SNDINFO/SNDRCVINFO, make up
> >> +		 * one with some defaults.
> >>   		 */
> >>   		memset(&default_sinfo, 0, sizeof(default_sinfo));
> >
> > Is this memset() needed?
> 
> This patch is not changing it, so feel free to propose one. If you zero
> out the remaining fields only used for rx, you should be able to drop it,
> but I guess all these micro-optimizations won't be that visible when we
> have much more fundamental things to solve in SCTP stack's performance.

Yes, I'm not even sure the protocol itself was designed to be code or
network bandwidth efficient.
The Linux implementation certainly doesn't give the impression of being
written for code speed. Never mind worries about cache line occupancy.

I suspect the memset/memcpy cost more than the cache line alignment issues
and gains from annotating with un/likely.

The largest gain probably comes from killing the 'command queue'.
Some actions do need deferring - for instance sending SACK should be deferred
until all the data chunks have been processed.
Once that is gone, other things might be more obvious.

	David




  parent reply	other threads:[~2014-07-08 10:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04 21:05 [PATCH net-next 2/5] net: sctp: implement rfc6458, 5.3.4. SCTP_SNDINFO cmsg support Daniel Borkmann
2014-07-07  8:46 ` David Laight
2014-07-08  9:34 ` Daniel Borkmann
2014-07-08 10:47 ` David Laight [this message]
2014-07-08 13:30 ` David Laight
2014-07-09 13:59 ` Vlad Yasevich
2014-07-09 14:57 ` David Laight
2014-07-09 15:19 ` Vlad Yasevich
2014-07-09 15:44 ` Michael Tuexen

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=063D6719AE5E284EB5DD2968C1650D6D1726E33B@AcuExch.aculab.com \
    --to=david.laight@aculab.com \
    --cc=linux-sctp@vger.kernel.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.