From: Chas Williams <3chas3@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, David Miller <davem@davemloft.net>
Cc: Francois Romieu <romieu@fr.zoreil.com>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
Michal Hocko <mhocko@kernel.org>,
Andrey Konovalov <andreyknvl@google.com>
Subject: Re: [Patch net] atm: remove an unnecessary loop
Date: Fri, 13 Jan 2017 18:54:34 -0500 [thread overview]
Message-ID: <1484351674.1643.16.camel@gmail.com> (raw)
In-Reply-To: <CAM_iQpXd8qTTRT_+CkHnpMNC=CSS9vfB6zKtSjmLV_yya5BL8Q@mail.gmail.com>
On Fri, 2017-01-13 at 10:20 -0800, Cong Wang wrote:
> On Fri, Jan 13, 2017 at 9:10 AM, David Miller <davem@davemloft.net> wrote:
> > From: Francois Romieu <romieu@fr.zoreil.com>
> > Date: Fri, 13 Jan 2017 01:07:00 +0100
> >
> >> Were alloc_skb moved one level up in the call stack, there would be
> >> no need to use the new wait api in the subsequent page, thus easing
> >> pre 3.19 longterm kernel maintenance (at least those on korg page).
> >>
> >> But it tastes a tad bit too masochistic.
> >
> > Lack of error handling of allocation failure is always a huge red
> > flag. We even long ago tried to do something like this for TCP FIN
> > handling.
> >
> > It's dumb, it doesn't work.
> >
> > Therefore I agree that the correct fix is to move the SKB allocation
> > up one level to vcc_sendmsg() and make it handle errors properly.
>
> If you can justify API is not broken by doing that, I am more than happy
> to do it, as I already stated in the latter patch:
The man page for sendmsg() allows for ENOMEM. See below.
>
> "Of course, the logic itself is suspicious, other sendmsg()
> could handle skb allocation failure very well, not sure
> why ATM has to wait for a successful one here. But probably
> it is too late to change since the errno and behavior is
> visible to user-space. So just leave the logic as it is."
>
> For some reason, no one reads that patch. :-/
I read it and I agree. I think it should be moved up/conflated with
vcc_sendmsg(). vcc_sendmsg() can already return an errno for other
conditions so if so has written something where they are explicitly
not expecting a ENOMEM, we really can't help them.
I would certainly prefer to not have to resort to an atomic allocation.
That's just going to make matters worse as far as similarity to the
existing API.
So, as Francois has suggested, just wait for the atm socket to
drain, and then do the allocation after the wait is finished.
next prev parent reply other threads:[~2017-01-13 23:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 5:02 [Patch net] atm: remove an unnecessary loop Cong Wang
2017-01-12 5:02 ` [Patch net] atm: switch to the new wait API for vcc_sendmsg() Cong Wang
2017-01-12 8:43 ` [Patch net] atm: remove an unnecessary loop Michal Hocko
2017-01-13 0:07 ` Francois Romieu
2017-01-13 0:14 ` Cong Wang
2017-01-13 13:23 ` Francois Romieu
2017-01-13 18:18 ` Cong Wang
2017-01-14 0:15 ` Francois Romieu
2017-01-14 0:41 ` Cong Wang
2017-01-13 17:10 ` David Miller
2017-01-13 18:20 ` Cong Wang
2017-01-13 23:54 ` Chas Williams [this message]
2017-01-14 0:30 ` Cong Wang
2017-01-14 11:34 ` Chas Williams
2017-01-14 0:14 ` Francois Romieu
2017-01-14 0:24 ` Francois Romieu
2017-01-14 0:36 ` Cong Wang
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=1484351674.1643.16.camel@gmail.com \
--to=3chas3@gmail.com \
--cc=andreyknvl@google.com \
--cc=davem@davemloft.net \
--cc=mhocko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.com \
--cc=xiyou.wangcong@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).