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=-3.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 B74F7C433DF for ; Fri, 3 Jul 2020 11:41:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 775BF20772 for ; Fri, 3 Jul 2020 11:41:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="XocJJ6PE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 775BF20772 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F3B206B00C0; Fri, 3 Jul 2020 07:41:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EC52D6B00C2; Fri, 3 Jul 2020 07:41:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8DAD6B00C4; Fri, 3 Jul 2020 07:41:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id C42456B00C0 for ; Fri, 3 Jul 2020 07:41:16 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 41E121AB11 for ; Fri, 3 Jul 2020 11:41:16 +0000 (UTC) X-FDA: 76996573752.23.crowd47_2401a0826e91 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 11A8E3BD48 for ; Fri, 3 Jul 2020 11:41:16 +0000 (UTC) X-HE-Tag: crowd47_2401a0826e91 X-Filterd-Recvd-Size: 3144 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2020 11:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=brKPBqGkq9UpOiE2pzCiAvP7F0wRaBf/lffdYdZP/rY=; b=XocJJ6PESJAwgCpUXDyHtQLyEY ImvwQMMgXfNfl/2vJRzeoMsFHOQbc6U3VvRGZALaGzCRdcq4/Py/xEghTVrPLnzQCwkwKIaAXICoz Kg+2CbynrhQfNNo33tS8nq3CUUujct0ek/qAb5kNGsAU5zis0gLisiajUb5NHL+N+yondC6UIpCgk iwJIX+U6eRrE6Iez6yUgNwYxpKrIGUzffzSf8NqCKeVftBWuOLbFtBdAggk+5DAxT+6hGVM/dmVeY sznKaHOF8crWlVtyREAfZ26xGBqikJF0sdqoDeVS3v6yyIvKl1ecLCyjzwY1rcKwAy0WFkVrFWEU/ sHa/Plxw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrK45-0000Gn-0o; Fri, 03 Jul 2020 11:41:09 +0000 Date: Fri, 3 Jul 2020 12:41:08 +0100 From: Matthew Wilcox To: Andreas Gruenbacher Cc: Linus Torvalds , Dave Chinner , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC v2 1/2] fs: Add IOCB_NOIO flag for generic_file_read_iter Message-ID: <20200703114108.GE25523@casper.infradead.org> References: <20200703095325.1491832-1-agruenba@redhat.com> <20200703095325.1491832-2-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200703095325.1491832-2-agruenba@redhat.com> X-Rspamd-Queue-Id: 11A8E3BD48 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jul 03, 2020 at 11:53:24AM +0200, Andreas Gruenbacher wrote: > Add an IOCB_NOIO flag that indicates to generic_file_read_iter that it > shouldn't trigger any filesystem I/O for the actual request or for > readahead. This allows to do tentative reads out of the page cache as > some filesystems allow, and to take the appropriate locks and retry the > reads only if the requested pages are not cached. > > Signed-off-by: Andreas Gruenbacher Reviewed-by: Matthew Wilcox (Oracle) > @@ -2249,9 +2253,18 @@ EXPORT_SYMBOL_GPL(generic_file_buffered_read); > * > * This is the "read_iter()" routine for all filesystems > * that can use the page cache directly. > + * > + * The IOCB_NOWAIT flag in iocb->ki_flags indicates that -EAGAIN shall > + * be returned when no data can be read without waiting for I/O requests > + * to complete; it doesn't prevent readahead. > + * > + * The IOCB_NOIO flag in iocb->ki_flags indicates that -EAGAIN shall be > + * returned when no data can be read without issuing new I/O requests, > + * and 0 shall be returned when readhead would have been triggered. s/shall/may/ -- if we read a previous page then hit a readahead page, we'll return a positive value. If the first page we hit is a readahead page, then yes, we'll return zero. Again, I'm happy for the patch to go in as-is without this nitpick.