From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9F05C433E2 for ; Sat, 4 Jul 2020 20:16:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2B7A20890 for ; Sat, 4 Jul 2020 20:16:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728031AbgGDUQk (ORCPT ); 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.