Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3327609ybt; Sat, 4 Jul 2020 13:17:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyarvggJp7i/UgsqL7zQ3p7bz0W5wPDwLLLxgn5g6B6pXSRO3qjvUbgnLuA6mgO4VmDkun7 X-Received: by 2002:a17:906:fac1:: with SMTP id lu1mr32808002ejb.427.1593893876473; Sat, 04 Jul 2020 13:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593893876; cv=none; d=google.com; s=arc-20160816; b=t0YDFQboN132hSL5ft/73Luwi2r0QeX5MAHALHjJvKE0/pzbdFX3WIXxwdPgB1T3Mi 5eXyYv8nMR2H2AmN9BrLFcAukp1KDHRyxoPXFhvu0dcc3gVGKPs2vgmg+Mj9HRQKYmnL JjFjxE3gDl2SkodnD0MLj5WFP5eY55n+r+qVNbcZqNuncaNm1+emOMh7Kz4CrF3QCDES 0ndO5zGGetCjG8bjUc5af+u7Rv5M+YV4VFRxReAg48eQ6l2hgw5XvGFTAboN2wa8n+aq YgD99nX/vA/MQNodhoBD2VRckMCa1ZX5s+Vyl+EoOiqc3iAP0O4tHkyw9AkJvnemEUb0 zZQA== 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; bh=9j8QNTZGlu2QTAQVxidUfb6CKtOKpWjDSx4OWBdCkP4=; b=wE6yrP0jQEFCxw5fu0xbsMLQxu6Sqx3nLWUDM1TxBUaAE21jKVMzTQJUS2QD//m4Wq dtFUk0CajUYwZiX0Hq+1bbpc9KEGdtS7wQmlSLTN7Fd/e9PcHnM+CLi9sYHwLl6PoUmQ cxAZWGHUcZ7wPP76oo9zW5yD/7idP6V487OWHPIoOtWuJ6kj/tNAeQJg8JxhqptwNR4r mHi9JF5bl1Bi5NV0V4NHnGBx6QPVvW7nFFN+aXSjkiE0dxExo/hV3EJYLLQTJ+G2Xni7 Z9SZJipcVVN5hsDv0ivRcmFiKTXZn9h9CqlFhogV45xbf5yejsYA6rGMnuRqeelL7SV7 I+PQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ni2si3982583ejb.19.2020.07.04.13.17.33; Sat, 04 Jul 2020 13:17:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728020AbgGDUQk (ORCPT + 99 others); Sat, 4 Jul 2020 16:16:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727897AbgGDUQj (ORCPT ); Sat, 4 Jul 2020 16:16:39 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66685C08C5DE; Sat, 4 Jul 2020 13:16:39 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jroaS-005Oey-SN; Sat, 04 Jul 2020 20:16:36 +0000 Date: Sat, 4 Jul 2020 21:16:36 +0100 From: Al Viro To: Miklos Szeredi Cc: Greg Kroah-Hartman , Michael Kerrisk , shuah@kernel.org, Linux API , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-man , linux-kselftest@vger.kernel.org Subject: Re: [PATCH 1/3] readfile: implement readfile syscall Message-ID: <20200704201636.GE2786714@ZenIV.linux.org.uk> References: <20200704140250.423345-1-gregkh@linuxfoundation.org> <20200704140250.423345-2-gregkh@linuxfoundation.org> <20200704201206.GD2786714@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200704201206.GD2786714@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 04, 2020 at 09:12:06PM +0100, Al Viro wrote: > On Sat, Jul 04, 2020 at 09:41:09PM +0200, Miklos Szeredi wrote: > > And "If the size of file is smaller than the value provided in count > > then the whole file will be copied into buf", which is simply a lie; > > for example seq_file will happily return a smaller-than-PAGE_SIZE > > chunk if at least one record fits in there. You'll have a very hard > > time explaining that in the man page. So I think there are two > > possible ways forward: > > > > 1) just leave the first explanation (it's an open + read + close > > equivalent) and leave out the rest > > > > 2) add a loop around the vfs_read() in the code. > > 3) don't bother with the entire thing, until somebody manages to demonstrate > a setup where it does make a real difference (compared to than the obvious > sequence of syscalls, that is). At which point we'll need to figure out > what's going on and deal with the underlying problem of that setup. Incidentally, if that's intended for use on _sysfs_, I would like to see the effects of that sucker being called by many processes in parallel, seeing that sysfs has, er, certain scalability problems in its lookups. And I would be very surprised if they were not heavier than said overhead of two extra syscalls.