From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:46070 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966479AbeF1OVe (ORCPT ); Thu, 28 Jun 2018 10:21:34 -0400 From: Christoph Hellwig To: Alexander Viro Cc: Linus Torvalds , linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, lkp@01.org Subject: [PATCH 4/6] net: remove busy polling from sock_get_poll_head Date: Thu, 28 Jun 2018 16:20:57 +0200 Message-Id: <20180628142059.10017-5-hch@lst.de> In-Reply-To: <20180628142059.10017-1-hch@lst.de> References: <20180628142059.10017-1-hch@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Busy polling always comes from a synchronous poll context, so for now we can assume that it calls ->poll if present. Move the busy polling in sock_poll to the common block and remove it from sock_get_poll_head to prepare for the removal of the get_poll_head method. Signed-off-by: Christoph Hellwig --- net/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/socket.c b/net/socket.c index 7cf037d21805..ca300c97b7ba 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1135,7 +1135,6 @@ static struct wait_queue_head *sock_get_poll_head(struct file *file, if (!sock->ops->poll_mask) return NULL; - sock_poll_busy_loop(sock, events); return &sock->wq->wait; } @@ -1161,8 +1160,9 @@ static __poll_t sock_poll(struct file *file, poll_table *wait) struct socket *sock = file->private_data; __poll_t events = poll_requested_events(wait), mask = 0; + sock_poll_busy_loop(sock, events); + if (sock->ops->poll) { - sock_poll_busy_loop(sock, events); mask = sock->ops->poll(file, sock, wait); } else if (sock->ops->poll_mask) { sock_poll_wait(file, sock_get_poll_head(file, events), wait); -- 2.17.1