[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20130529222305.7D96681853@donbot.mtv.corp.google.com>
Date: Wed, 29 May 2013 15:23:05 -0700 (PDT)
From: David Majnemer <majnemer@...gle.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: therbert@...gle.com
Subject: Re: [PATCH] net: Update RPS target at poll for inet
That's a good point Eric, I've updated this patch to address your comment.
Thanks,
David
-----------------------------8<---------------------------
When poll(2) gets called with an ip socket, update the flow target to be the
poller. The data will be on the appropriate CPU when the poller later calls
recvmsg(2).
Signed-off-by: David Majnemer <majnemer@...gle.com>
---
net/ipv4/tcp.c | 2 ++
net/ipv4/udp.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index ba4186e..6aa930a 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -436,6 +436,8 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
struct sock *sk = sock->sk;
const struct tcp_sock *tp = tcp_sk(sk);
+ sock_rps_record_flow(sk);
+
sock_poll_wait(file, sk_sleep(sk), wait);
if (sk->sk_state == TCP_LISTEN)
return inet_csk_listen_poll(sk);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index aa5eff4..c7338ec 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1967,6 +1967,8 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
unsigned int mask = datagram_poll(file, sock, wait);
struct sock *sk = sock->sk;
+ sock_rps_record_flow(sk);
+
/* Check for false positives due to checksum errors */
if ((mask & POLLRDNORM) && !(file->f_flags & O_NONBLOCK) &&
!(sk->sk_shutdown & RCV_SHUTDOWN) && !first_packet_length(sk))
--
1.8.2.1
--
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