From: "'Marcelo Ricardo Leitner'" <marcelo.leitner@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "'Xin Long'" <lucien.xin@gmail.com>,
David Miller <davem@davemloft.net>,
network dev <netdev@vger.kernel.org>,
"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>,
Vladislav Yasevich <vyasevich@gmail.com>,
"daniel@iogearbox.net" <daniel@iogearbox.net>
Subject: Re: [PATCH net] sctp: fix a success return may hide an error
Date: Thu, 18 Aug 2016 14:44:23 -0300 [thread overview]
Message-ID: <20160818174423.GG3110@localhost.localdomain> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DB00E0D2A@AcuExch.aculab.com>
On Wed, Aug 17, 2016 at 09:01:38AM +0000, David Laight wrote:
> From: Marcelo Ricardo Leitner
> > Sent: 16 August 2016 18:25
> ...
> > > That doesn't seem a good idea.
> > > You don't want to abort the association if there is a transient
> > > memory allocation failure.
> > > You also can't drop data chunks.
> >
> > From a system-wise POV, this behavior - to free the new asoc in case of
> > transient memory allocation failure - doesn't seem bad to me.
> > That's what will have to happen if any allocation before it failed and
> > also it helps the system to reduce the stress a little bit. I don't see
> > any inconsistency/problems here because we are not dropping a single
> > random chunk but instead we are actually refusing to initialize a new
> > asoc in such conditions.
>
> Failing a new association should be ok, whether purists will like
> connect() failing ENOMEM is another matter.
>
Good point.
> > Nevertheless, I agree that letting the application see ENOMEM errors when
> > the data actually got queued and is being fully handled, as in, it will
> > be retransmitted later, is not be wise, as the application probably
> > won't be able to distinguish from ENOMEMs that it should retry or not.
>
> I think an application would be justified in thinking that an ENOMEM return
> meant that the system call had no effect.
>
Yep
> For send() even ENOMEM is really wrong, it should be treated as 'flow control'
> and either block or return EAGAIN/EWOULDBLOCK.
Agreed.
> Getting POLLOUT set is left as an exercise to the reader :-)
>
:-)
> ...
> > Well, it may be, but we are trying to improve it. Please continue
> > discussing the fixes so we can keep improving it. :)
>
> Indeed, we have customers who use sctp (for M3UA).
> We don't do anything 'complicated', but do end up sending a lot of short
> data chunks.
>
> David
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2016-08-19 0:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-11 12:52 [PATCH net] sctp: fix a success return may hide an error Xin Long
2016-08-11 13:11 ` Marcelo Ricardo Leitner
2016-08-11 15:36 ` Neil Horman
2016-08-13 4:11 ` David Miller
2016-08-13 7:47 ` Xin Long
2016-08-16 9:16 ` David Laight
2016-08-16 11:34 ` Xin Long
2016-08-16 16:01 ` David Laight
2016-08-16 17:24 ` Marcelo Ricardo Leitner
2016-08-16 18:24 ` Xin Long
2016-08-16 18:33 ` Marcelo Ricardo Leitner
2016-08-16 18:45 ` Marcelo Ricardo Leitner
2016-08-17 11:42 ` Xin Long
2016-08-17 9:01 ` David Laight
2016-08-18 17:44 ` 'Marcelo Ricardo Leitner' [this message]
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=20160818174423.GG3110@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=David.Laight@ACULAB.COM \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=linux-sctp@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vyasevich@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).