lkml.org 
[lkml]   [2012]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFCv7 PATCH 3/4] net/sock.h: use poll_does_not_wait() in sock_poll_wait()
Date
From: Hans Verkuil <hans.verkuil@cisco.com>

In order to determine whether poll_wait() might actually wait the
poll_table pointer was tested in sock_poll_wait(). This is no longer
sufficient, instead poll_does_not_wait() should be called. That function
also tests whether pt->pq_proc is non-NULL.

Without this change smp_mb() could be called unnecessarily in some
circumstances, causing a performance hit.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
include/net/sock.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 91c1c8b..da7f2ec 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1824,7 +1824,7 @@ static inline bool wq_has_sleeper(struct socket_wq *wq)
static inline void sock_poll_wait(struct file *filp,
wait_queue_head_t *wait_address, poll_table *p)
{
- if (p && wait_address) {
+ if (!poll_does_not_wait(p) && wait_address) {
poll_wait(filp, wait_address, p);
/*
* We need to be sure we are in sync with the
--
1.7.8.3


\
 
 \ /
  Last update: 2012-02-02 11:37    [W:2.116 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site