Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3621070ybt; Sun, 5 Jul 2020 01:16:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRs+/3rnosdaMHItFa+y/2iNr8rEcZWokmCmUWRvT6UL06sbUs+NRrth/s1Ry/8aBYLju3 X-Received: by 2002:a05:6402:1153:: with SMTP id g19mr48625244edw.127.1593936980711; Sun, 05 Jul 2020 01:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593936980; cv=none; d=google.com; s=arc-20160816; b=TJk3PnRj4qlhy9akzsOEG47ItKK1UhMWEQk8SJEJOOpFtDzSBsOOSEv+Zgw1Rz9X9q qaTQoQRVsDoYD4q8dtZNKnuLj5mNd2mWXpCHgVf18lwxgvgPtd2noOb7ACkJRTwo5UOT UPwrduOySREpl46et6iudLtpb/wSGrbfgw76dK6PT/KjHEg1v1DEh7vVSbHuiJBYem2Y Z7IE7UG2S3WD7FqJ3lG8eb+VQVUo5TbNtiuBcx53b06Yb0KFDfAMOc5TP23RfuKbPxT2 mhyd+5fKJFXqd5uZfVbeorZm2ZYzkUMhGbJ5b2hWYFYVWwmiweWinw4fTl4B0VRK3KsR jhKg== 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=EJiinHIzzWcArwXCNdhG/QC4c/5ZNHXp58Kejth+CbY=; b=uKjCzp0lTtvoZ07MlmB51urlL6M6dfmwCDoteWn9zjrdt9Bpcs1qzUiHHnHrdgx5ND 5pQKiSkENTueVF8DB2AhVy7QVDBgA6W/Lal1fm7lkFRt/OtvSVDXrwTjlyJGW/04CWMT LVqqtNqATqWegDd6b1tYI3SBK+JyrtSz2Y/E2ngEgG4SWWiA3TX1bRXluVuf3Ay3xxCO Jb+h3ISJ2DGUnZVmI9CXiJpwHlieqTqcwOVPaJcuEkV7FRLASmhgWxddYqzw4AhRLcbS wMJ54CNV6eigyU64VH1BzYw9uRzQJpRuDeLVah5dZpQFaDCtdD2Rfy9TZ/QDLciSrd2a ss+g== 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 qk3si11304248ejb.323.2020.07.05.01.15.56; Sun, 05 Jul 2020 01:16:20 -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 S1726491AbgGEIOm (ORCPT + 99 others); Sun, 5 Jul 2020 04:14:42 -0400 Received: from shells.gnugeneration.com ([66.240.222.126]:48028 "EHLO shells.gnugeneration.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726052AbgGEIOm (ORCPT ); Sun, 5 Jul 2020 04:14:42 -0400 X-Greylist: delayed 447 seconds by postgrey-1.27 at vger.kernel.org; Sun, 05 Jul 2020 04:14:42 EDT Received: by shells.gnugeneration.com (Postfix, from userid 1000) id 1E45E1A401F9; Sun, 5 Jul 2020 01:07:15 -0700 (PDT) Date: Sun, 5 Jul 2020 01:07:14 -0700 From: Vito Caputo To: Matthew Wilcox Cc: Jan Ziak <0xe2.0x9a.0x9b@gmail.com>, gregkh@linuxfoundation.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-man@vger.kernel.org, mtk.manpages@gmail.com, shuah@kernel.org, viro@zeniv.linux.org.uk Subject: Re: [PATCH 0/3] readfile(2): a new syscall to make open/read/close faster Message-ID: <20200705080714.76m64pwwpvlzji2v@shells.gnugeneration.com> References: <20200705021631.GR25523@casper.infradead.org> <20200705031208.GS25523@casper.infradead.org> <20200705032732.GT25523@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200705032732.GT25523@casper.infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 05, 2020 at 04:27:32AM +0100, Matthew Wilcox wrote: > On Sun, Jul 05, 2020 at 05:18:58AM +0200, Jan Ziak wrote: > > On Sun, Jul 5, 2020 at 5:12 AM Matthew Wilcox wrote: > > > > > > You should probably take a look at io_uring. That has the level of > > > complexity of this proposal and supports open/read/close along with many > > > other opcodes. > > > > Then glibc can implement readfile using io_uring and there is no need > > for a new single-file readfile syscall. > > It could, sure. But there's also a value in having a simple interface > to accomplish a simple task. Your proposed API added a very complex > interface to satisfy needs that clearly aren't part of the problem space > that Greg is looking to address. I disagree re: "aren't part of the problem space". Reading small files from procfs was specifically called out in the rationale for the syscall. In my experience you're rarely monitoring a single proc file in any situation where you care about the syscall overhead. You're monitoring many of them, and any serious effort to do this efficiently in a repeatedly sampled situation has cached the open fds and already uses pread() to simply restart from 0 on every sample and not repeatedly pay for the name lookup. Basically anything optimally using the existing interfaces for sampling proc files needs a way to read multiple open file descriptors in a single syscall to move the needle. This syscall doesn't provide that. It doesn't really give any advantage over what we can achieve already. It seems basically pointless to me, from a monitoring proc files perspective. Regards, Vito Caputo