From patchwork Thu Jun 28 14:20:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10494057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3D167603EE for ; Thu, 28 Jun 2018 14:21:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2962C2A517 for ; Thu, 28 Jun 2018 14:21:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26FB92A53E; Thu, 28 Jun 2018 14:21:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B968E2A53B for ; Thu, 28 Jun 2018 14:21:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966512AbeF1OVP (ORCPT ); Thu, 28 Jun 2018 10:21:15 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46008 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966511AbeF1OVN (ORCPT ); Thu, 28 Jun 2018 10:21:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=67EvGMGYcwumscjQw7SrjhNr9/LVcDZCvubSWsIxV30=; b=FtgAdpCXA4JSDUURjGhGmLgcy Odaojk3va4kz6yWgD7etjW7r4PQ5cmE2fDLISXHxQTaKEIf1yZ2LAEPBGhjAxndHNfqdQf4mo51vK nihDCaztO8WzDywM6twgqlLdcC5efnhbrPfCP/lQOCN/fd2Cg5g/7EGxpiZTehX21rh4w+JW0cqWS OXq6fz+7ArYOWWgT484Mm1ERfv8WxV9+ZMfKEvBbtA/afQ0gtpNK2AQChjG5iimJcKBaGpjwm5vIR 3U+zNv3O9rbv8lFJvkvfDp6M8UXgJG0TrjczansNMN3hzXjPtnhtq6Zsja8/AvUs3oXTYi2U28ma2 TV32Qnb8g==; Received: from 213-225-7-116.nat.highway.a1.net ([213.225.7.116] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYXnK-0000XH-6B; Thu, 28 Jun 2018 14:21:12 +0000 From: Christoph Hellwig To: Alexander Viro Cc: Linus Torvalds , linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, lkp@01.org Subject: [PATCH 1/6] net: remove sock_poll_busy_flag Date: Thu, 28 Jun 2018 16:20:54 +0200 Message-Id: <20180628142059.10017-2-hch@lst.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628142059.10017-1-hch@lst.de> References: <20180628142059.10017-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Can simplify be inlined into the only caller. Signed-off-by: Christoph Hellwig --- include/net/busy_poll.h | 6 ------ net/socket.c | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h index c5187438af38..4a459a0d70d1 100644 --- a/include/net/busy_poll.h +++ b/include/net/busy_poll.h @@ -130,12 +130,6 @@ static inline void sock_poll_busy_loop(struct socket *sock, __poll_t events) } } -/* if this socket can poll_ll, tell the system call */ -static inline __poll_t sock_poll_busy_flag(struct socket *sock) -{ - return sk_can_busy_loop(sock->sk) ? POLL_BUSY_LOOP : 0; -} - /* used in the NIC receive handler to mark the skb */ static inline void skb_mark_napi_id(struct sk_buff *skb, struct napi_struct *napi) diff --git a/net/socket.c b/net/socket.c index 8a109012608a..0f397fa33614 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1171,7 +1171,10 @@ static __poll_t sock_poll(struct file *file, poll_table *wait) mask = sock->ops->poll_mask(sock, events); } - return mask | sock_poll_busy_flag(sock); + /* this socket can poll_ll so tell the system call */ + if (sk_can_busy_loop(sock->sk)) + mask |= POLL_BUSY_LOOP; + return mask; } static int sock_mmap(struct file *file, struct vm_area_struct *vma)