Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp705474imm; Fri, 22 Jun 2018 04:02:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLOynNqq+zNwotmIDbPLIOJcS0+pP8OL9yq2LE9ldo4Vbt3KU4ydLYbGIE9TBpdFSS0IpFo X-Received: by 2002:a63:383:: with SMTP id 125-v6mr966338pgd.421.1529665341688; Fri, 22 Jun 2018 04:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529665341; cv=none; d=google.com; s=arc-20160816; b=OPDftZl/eSSDhu5m1hIN62sB1SeA5Vnr9bwQtfHT+LJQ7blnQ+5AYkuu7WWYcPWmse DfsAJQALiW72rvl5gArDf2szUwk2Dugkzk4IvTkHWrxBhLHxzN8NQ6I0mTihdTHhoV11 PIQFajFPcQVVRc5nGw6a0Ysyg5EsePvcNms++4BY+LCnlcyXx5EIosSs6JrmO77kYO4q TK2e15e9IFw+93z1+kLk3OtVnwxFQeKliVMFasPo90AggKv4xaw304Zvsm18Fbe7TMrv W2K2beUbECGpfVVz29Ju480fVtnDbxk78CU/7EZUqtLrqyX93nJ8a+4LJWbV0sS+WMCR JzYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=3YJjfHsC7PMQ9LLMxhFN1Wo+o9Sa5YeSl9anVzMtf7U=; b=FepGRirajgs3byKVc3qM2j5OJBVWK4rqlEN7Mr2zuAzyIYqeDsmZYwcaNmyremr0UI g8M6BqkgtX/04+zJlCtDtggYhpRt79BmAXcCZnctiMh+7vORWnK92wlE1J7qOy9U0B3P 4kmtR9OM1s2KHPK6ot/wT14PjFg3PmVrBu20lHzhocimc5lBz1oO+bshd8saxdRh2apl LYYFgZ64+U3het+gux8aSFKT36FsvsLOY/h/SNG7mI8SoBGsKcsQgykMX31EXWpXErOD F2dCCN04zvGzeG7SI9+iqXzjSLN+EAcCWtRo+pAYoAPFrKyF4kMeqkmYgGW5mtX8OByR uMFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97-v6si7707243pld.345.2018.06.22.04.02.06; Fri, 22 Jun 2018 04:02:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753219AbeFVLBY (ORCPT + 99 others); Fri, 22 Jun 2018 07:01:24 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:58880 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbeFVLBX (ORCPT ); Fri, 22 Jun 2018 07:01:23 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fWJob-0006SF-5C; Fri, 22 Jun 2018 11:01:17 +0000 Date: Fri, 22 Jun 2018 12:01:17 +0100 From: Al Viro To: Christoph Hellwig Cc: Linus Torvalds , kernel test robot , Greg Kroah-Hartman , "Darrick J. Wong" , Linux Kernel Mailing List , LKP Subject: Re: [lkp-robot] [fs] 3deb642f0d: will-it-scale.per_process_ops -8.8% regression Message-ID: <20180622110117.GU30522@ZenIV.linux.org.uk> References: <20180622082752.GX11011@yexl-desktop> <20180622095608.GA12263@lst.de> <20180622100014.GA12425@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180622100014.GA12425@lst.de> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 22, 2018 at 12:00:14PM +0200, Christoph Hellwig wrote: > And a version with select() also covered: For fuck sake, if you want vfs_poll() inlined, *make* *it* *inlined*. Is there any reason for not doing that other than EXPORT_SYMBOL_GPL fetish? Because if there isn't, I would like to draw your attention to the fact that _this_ pwecious inchewlekshul pwopewty can be trivially open-coded by out-of-tree shite even if it happens to be non-GPL one. > mask = vfs_poll(f.file, wait); > + if (f.file->f_op->poll) { ... not to mention that here you forgot to remove the call itself while expanding it. Said that, you are not attacking the worst part of it - it's a static branch, not the considerably more costly indirect ones. Remember when I asked you about the price of those? Method calls are costly. Another problem with with ->get_poll_head() calling conventions is that originally you wanted to return ERR_PTR(-mask) as a way to report not needing to call ->poll_mask(); that got shot down since quite a few of those don't fit into 12 bits that ERR_PTR() gives us. IIRC, the real reason for non-constant ->get_poll_head() was the sockets, with static struct wait_queue_head *sock_get_poll_head(struct file *file, __poll_t events) { struct socket *sock = file->private_data; if (!sock->ops->poll_mask) return NULL; sock_poll_busy_loop(sock, events); return sk_sleep(sock->sk); } The first part isn't a problem (it is constant). The second is static inline void sock_poll_busy_loop(struct socket *sock, __poll_t events) { if (sk_can_busy_loop(sock->sk) && events && (events & POLL_BUSY_LOOP)) { /* once, only if requested by syscall */ sk_busy_loop(sock->sk, 1); } } and the third - static inline wait_queue_head_t *sk_sleep(struct sock *sk) { BUILD_BUG_ON(offsetof(struct socket_wq, wait) != 0); return &rcu_dereference_raw(sk->sk_wq)->wait; } Now, ->sk_wq is modified only in sock_init_data() and sock_graft(); the latter, IIRC, is ->accept() helper. Do we ever call either of those on a sock of already opened file? IOW, is there any real reason for socket ->get_poll_head() not to be constant, other than wanting to keep POLL_BUSY_LOOP handling out of ->poll_mask()? I agree that POLL_BUSY_LOOP is ugly as hell, but you *still* have sock_poll_mask() not free from it...