[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1400508587.5367.37.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Mon, 19 May 2014 07:09:47 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jason Wang <jasowang@...hat.com>
Cc: Xi Wang <xii@...gle.com>, "David S. Miller" <davem@...emloft.net>,
netdev@...r.kernel.org, "Michael S. Tsirkin" <mst@...hat.com>,
Maxim Krasnyansky <maxk@....qualcomm.com>,
Neal Cardwell <ncardwell@...gle.com>,
Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH v2] net-tun: restructure tun_do_read for better
sleep/wakeup efficiency
On Mon, 2014-05-19 at 17:27 +0800, Jason Wang wrote:
> Still a little bit difference. We check the reg_state after we're sure
> there's nothing left in sk_receive_queue. But this patch returns -EIO
> before trying to dequeue skb.
Do you think its a problem, other than a simple difference of behavior ?
Is this -EIO thing a hard requirement, or a side effect ?
Either we try to converge things, or we keep this driver a pile of
copy/pasted stuff from other locations, missing improvements we did
in core networking stack, because of some supposed differences.
About the sk_data_ready() and wake_up_all(), you missed the whole part
of the patch I think.
Check how sock_def_readable() does everything properly and efficiently,
including the async part.
static void sock_def_readable(struct sock *sk)
{
struct socket_wq *wq;
rcu_read_lock();
wq = rcu_dereference(sk->sk_wq);
if (wq_has_sleeper(wq))
wake_up_interruptible_sync_poll(&wq->wait, POLLIN | POLLPRI |
POLLRDNORM | POLLRDBAND);
sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
rcu_read_unlock();
}
Using sk_data_ready() is the way to reach sock_def_readable()
as its not an EXPORT_SYMBOL.
If this driver was using the common interface, we would not have
these false sharing problems, that were solved a long time ago.
--
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