[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1267152253.16986.1655.camel@debian>
Date: Fri, 26 Feb 2010 10:44:13 +0800
From: Zhu Yi <yi.zhu@...el.com>
To: David Miller <davem@...emloft.net>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Shi, Alex" <alex.shi@...el.com>
Subject: Re: [RFC PATCH] accounting for socket backlog
On Thu, 2010-02-25 at 16:31 +0800, David Miller wrote:
> > @@ -1372,8 +1372,13 @@ int udp_queue_rcv_skb(struct sock *sk, struct
> sk_buff *skb)
> > bh_lock_sock(sk);
> > if (!sock_owned_by_user(sk))
> > rc = __udp_queue_rcv_skb(sk, skb);
> > - else
> > + else {
> > + if (atomic_read(&sk->sk_backlog.len) >= sk->sk_rcvbuf)
> {
> > + bh_unlock_sock(sk);
> > + goto drop;
> > + }
> > sk_add_backlog(sk, skb);
> > + }
>
> We have to address this issue, of course, but I bet this method of
> handling it negatively impacts performance in normal cases.
Eric mentioned atomic is not required here. I don't think performance
will be impacted any more with the above if clause. Right?
> Right now we can queue up a lot and still get it to the application
> if it is slow getting scheduled onto a cpu, but if you put this
> limit here it could result in lots of drops.
Or we can replace the sk->sk_rcvbuf limit with a backlog own limit. We
can queue "a lot", but not endless. We have to have a limit anyway.
Thanks,
-yi
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists