aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/af_bluetooth.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-28 12:43:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-28 13:40:47 -0400
commita11e1d432b51f63ba698d044441284a661f01144 (patch)
tree9f3c5a10bf0d7f9a342d5fb39c0c35ea14170124 /net/bluetooth/af_bluetooth.c
parentf57494321cbf5b1e7769b6135407d2995a369e28 (diff)
Revert changes to convert to ->poll_mask() and aio IOCB_CMD_POLL
The poll() changes were not well thought out, and completely unexplained. They also caused a huge performance regression, because "->poll()" was no longer a trivial file operation that just called down to the underlying file operations, but instead did at least two indirect calls. Indirect calls are sadly slow now with the Spectre mitigation, but the performance problem could at least be largely mitigated by changing the "->get_poll_head()" operation to just have a per-file-descriptor pointer to the poll head instead. That gets rid of one of the new indirections. But that doesn't fix the new complexity that is completely unwarranted for the regular case. The (undocumented) reason for the poll() changes was some alleged AIO poll race fixing, but we don't make the common case slower and more complex for some uncommon special case, so this all really needs way more explanations and most likely a fundamental redesign. [ This revert is a revert of about 30 different commits, not reverted individually because that would just be unnecessarily messy - Linus ] Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/bluetooth/af_bluetooth.c')
-rw-r--r--net/bluetooth/af_bluetooth.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index 510ab4f55df5..3264e1873219 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -437,13 +437,16 @@ static inline __poll_t bt_accept_poll(struct sock *parent)
437 return 0; 437 return 0;
438} 438}
439 439
440__poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events) 440__poll_t bt_sock_poll(struct file *file, struct socket *sock,
441 poll_table *wait)
441{ 442{
442 struct sock *sk = sock->sk; 443 struct sock *sk = sock->sk;
443 __poll_t mask = 0; 444 __poll_t mask = 0;
444 445
445 BT_DBG("sock %p, sk %p", sock, sk); 446 BT_DBG("sock %p, sk %p", sock, sk);
446 447
448 poll_wait(file, sk_sleep(sk), wait);
449
447 if (sk->sk_state == BT_LISTEN) 450 if (sk->sk_state == BT_LISTEN)
448 return bt_accept_poll(sk); 451 return bt_accept_poll(sk);
449 452
@@ -475,7 +478,7 @@ __poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events)
475 478
476 return mask; 479 return mask;
477} 480}
478EXPORT_SYMBOL(bt_sock_poll_mask); 481EXPORT_SYMBOL(bt_sock_poll);
479 482
480int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) 483int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
481{ 484{