Received: by 2002:a17:90a:9307:0:0:0:0 with SMTP id p7csp5095584pjo; Wed, 4 Mar 2020 08:49:56 -0800 (PST) X-Google-Smtp-Source: ADFU+vtVW1U0tT8lbhPFTpy3xHV/BA9k+aCkeMRdi+U8IBgvBPQpFI29jKQp3pxJM05+EOgiJhBI X-Received: by 2002:a05:6830:186:: with SMTP id q6mr3006265ota.10.1583340595199; Wed, 04 Mar 2020 08:49:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583340595; cv=none; d=google.com; s=arc-20160816; b=OBceqtXjfZZv10cqOhKEoqwtBBe7lSm2qtmMtqFttZfryQBWLVLWFfv9414GH/q8iM FqYoMDYClxsmrsvYID4ZDPJP2dYvIZ6P+tkqlJTOmU9MlYM0aa2d74NCaHi8u9QCEF9/ 9rWDL5zQA4PlaoGUZFLpUbCPnrXLRTgNljODgv9hhmKUacNEmQjdQIY8j75WWU2GqI58 q52GKkkDXSEOvj9fxNPSQ8B/flyHx5STXdfONd9pgmjNHdTWNCDGb2NqIQW2VYl8KboR Pne1zLluP5ygjlh0PVV10V7lQlP1NNVRJSOrb6DCzy7ZeQWTyhEuT9pogQhenQtBh64b rzoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Ez1EamV2S3zPZKkRBdJ8rLHOwEy0QnJF3pyDJeQGsNg=; b=YxL4VBpNt5CseySl563gX0taEo/IgTk9h66tHghXqzviPKIqFqEBgFzhlMradcOcIx 74IN2xm+yCJPW23f4saqJiRIqIiZJiDx3XfK3FQ0T9RfkcQGCYU93ZWZDQ74RyUc0aAA caK3YApeK7rqOKxNZcXz7DR0hGmPYKQey27+oFymUSpxgMLM2vVuA3fNwV6mjhNXbPEp Ov4ouiUA4l67xrKtB8bPCH61KJuHzbDDb2A9k25d847FM6wXHRjFMWx4SGMhyZF54C8N s6P9iQpKSBizb4Zd4T11mkygx2xgKMFMgZUASey4TdaXA0oqn8WVado/6sA4Or598xW7 NtzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="QFw/Q1NY"; 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 g35si1604497otg.32.2020.03.04.08.49.43; Wed, 04 Mar 2020 08:49:55 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b="QFw/Q1NY"; 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 S2388275AbgCDQtV (ORCPT + 99 others); Wed, 4 Mar 2020 11:49:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:35754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388063AbgCDQtV (ORCPT ); Wed, 4 Mar 2020 11:49:21 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D2C2922B48; Wed, 4 Mar 2020 16:49:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583340556; bh=htZq3MKYG3/FJ8bILu0qqA54TuTZg4n2O0B4bA60sUA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QFw/Q1NY4B+y7WTrekje+ZpgNyFzrIcZ7UTABnDsnjgXf0am4nQsbW5ZVxTNNjWld 6g3+cMHNGJFGxmjYQ7wuvpNbSuU4C8wJW0QIQn6siOMOjhXevPQyX+4tWUsOTV/oDy NWsKv9WocDxBZSqHQrN8bsD7sTiXcsBN4pte4wXQ= Date: Wed, 4 Mar 2020 17:49:13 +0100 From: Greg Kroah-Hartman To: Karel Zak Cc: Ian Kent , Miklos Szeredi , David Howells , Christian Brauner , James Bottomley , Steven Whitehouse , Miklos Szeredi , viro , Christian Brauner , Jann Horn , "Darrick J. Wong" , Linux API , linux-fsdevel , lkml Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] Message-ID: <20200304164913.GB1763256@kroah.com> References: <107666.1582907766@warthog.procyon.org.uk> <0403cda7345e34c800eec8e2870a1917a8c07e5c.camel@themaw.net> <1509948.1583226773@warthog.procyon.org.uk> <20200303113814.rsqhljkch6tgorpu@ws.net.home> <20200303130347.GA2302029@kroah.com> <33d900c8061c40f70ba2b9d1855fd6bd1c2b68bb.camel@themaw.net> <20200304152241.iaiulvl5xisnuxp6@ws.net.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200304152241.iaiulvl5xisnuxp6@ws.net.home> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 04, 2020 at 04:22:41PM +0100, Karel Zak wrote: > On Wed, Mar 04, 2020 at 10:01:33AM +0800, Ian Kent wrote: > > On Tue, 2020-03-03 at 14:03 +0100, Greg Kroah-Hartman wrote: > > > Actually, I like this idea (the syscall, not just the unlimited > > > beers). > > > Maybe this could make a lot of sense, I'll write some actual tests > > > for > > > it now that syscalls are getting "heavy" again due to CPU vendors > > > finally paying the price for their madness... > > > > The problem isn't with open->read->close but with the mount info. > > changing between reads (ie. seq file read takes and drops the > > needed lock between reads at least once). > > readfile() is not reaction to mountinfo. > > The motivation is that we have many places with trivial > open->read->close for very small text files due to /sys and /proc. The > current way how kernel delivers these small strings to userspace seems > pretty inefficient if we can do the same by one syscall. > > Karel > > $ strace -e openat,read,close -c ps aux > ... > % time seconds usecs/call calls errors syscall > ------ ----------- ----------- --------- --------- ---------------- > 43.32 0.004190 4 987 read > 31.42 0.003039 3 844 4 openat > 25.26 0.002443 2 842 close > ------ ----------- ----------- --------- --------- ---------------- > 100.00 0.009672 2673 4 total > > $ strace -e openat,read,close -c lsns > ... > % time seconds usecs/call calls errors syscall > ------ ----------- ----------- --------- --------- ---------------- > 39.95 0.001567 2 593 openat > 30.93 0.001213 2 597 close > 29.12 0.001142 3 365 read > ------ ----------- ----------- --------- --------- ---------------- > 100.00 0.003922 1555 total > > > $ strace -e openat,read,close -c lscpu > ... > % time seconds usecs/call calls errors syscall > ------ ----------- ----------- --------- --------- ---------------- > 44.67 0.001480 7 189 52 openat > 34.77 0.001152 6 180 read > 20.56 0.000681 4 140 close > ------ ----------- ----------- --------- --------- ---------------- > 100.00 0.003313 509 52 total As a "real-world" test, would you recommend me converting one of the above tools to my implementation of readfile to see how/if it actually makes sense, or do you have some other tool you would rather see me try? thanks, greg k-h