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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 CABC7C1975A for ; Wed, 25 Mar 2020 14:43:28 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D226208E0 for ; Wed, 25 Mar 2020 14:43:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="YUccMzib" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D226208E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=szeredi.hu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48nW7x54WpzDqg1 for ; Thu, 26 Mar 2020 01:43:25 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=szeredi.hu (client-ip=2607:f8b0:4864:20::d42; helo=mail-io1-xd42.google.com; envelope-from=miklos@szeredi.hu; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=szeredi.hu Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=szeredi.hu header.i=@szeredi.hu header.a=rsa-sha256 header.s=google header.b=YUccMzib; dkim-atps=neutral Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48nW7p6FV1zDqdp for ; Thu, 26 Mar 2020 01:43:15 +1100 (AEDT) Received: by mail-io1-xd42.google.com with SMTP id d15so2476106iog.3 for ; Wed, 25 Mar 2020 07:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BYoi0GgKGrZ5Iy05aE5oc1zP5UUaQTjapju/izAR4hI=; b=YUccMzib2IwajwEuyLBHygiEi2x+yWevlxfsequqpaIt/Mza/TxUmFkitS3U4FkfKx P1XwXxBJ8Cx5HEmhYoBLdWFHhmr6xou5YR2utppkELKcqyaDd4EOavtJNBW3boLnPkzx WgZmdQ9YRsyheNZWEZrba/miSYKYdDAaziYyc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BYoi0GgKGrZ5Iy05aE5oc1zP5UUaQTjapju/izAR4hI=; b=AifaeMG3DI3GBjOtiD1JygCr3IXcbS+IJfakO3t7eLmi/eS1KUbHTLCYRZyEnsDkx3 8pv3YeQVQ2BwNeFWOWRow7R0eL1RbZTLIgrJnex3tE79Q+r1w1LJRez2cWRw9UYXYygw wBFFru50f31EYF8nszkN3L07/4Yo8L02v0LY8PHrq9w9ri4JtZCtq1xucI2iIRDdIwZT 5dR3dkO5A67Tl6IKKTrL+y8GE9drYO+yjmDnEWZQ+qZrBMvDJfrd+TcnG/fOP4b1lGfN dBt5dYfNdqcVPE+VBcjB/5wF5PS7XIK7ukDB7o1rL9LgTDpRTHL8sPF4uwB9UBYu/UJe 4DLA== X-Gm-Message-State: ANhLgQ2i3tJ3WscdCukpwtd8JcvYDykqDR/Kq474GRn/2IecEwmeTRrN zTboec5e6qmAKUkHxzyeQ7C7cxUFV4Jm5V0u5+DrYQ== X-Google-Smtp-Source: ADFU+vsgMMqodCZqPGFNfCT+HdNRTtLLlUdy5AMnDcVBoatxWj+vZY48emoAVNd+HvHliFjTkg/kdF6pmkOGcZxuC6s= X-Received: by 2002:a6b:3a07:: with SMTP id h7mr3235359ioa.191.1585147393572; Wed, 25 Mar 2020 07:43:13 -0700 (PDT) MIME-Version: 1.0 References: <20200323202259.13363-1-willy@infradead.org> <20200323202259.13363-25-willy@infradead.org> <20200325120254.GA22483@bombadil.infradead.org> In-Reply-To: <20200325120254.GA22483@bombadil.infradead.org> From: Miklos Szeredi Date: Wed, 25 Mar 2020 15:43:02 +0100 Message-ID: Subject: Re: [PATCH v10 24/25] fuse: Convert from readpages to readahead To: Matthew Wilcox Content-Type: text/plain; charset="UTF-8" X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-xfs , William Kucharski , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-mm@kvack.org, ocfs2-devel@oss.oracle.com, Dave Chinner , linux-fsdevel@vger.kernel.org, Andrew Morton , linux-ext4@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-btrfs@vger.kernel.org Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" Archived-At: List-Archive: On Wed, Mar 25, 2020 at 1:02 PM Matthew Wilcox wrote: > > On Wed, Mar 25, 2020 at 10:42:56AM +0100, Miklos Szeredi wrote: > > > + while ((page = readahead_page(rac))) { > > > + if (fuse_readpages_fill(&data, page) != 0) > > > > Shouldn't this unlock + put page on error? > > We're certainly inconsistent between the two error exits from > fuse_readpages_fill(). But I think we can simplify the whole thing > ... how does this look to you? Nice, overall. > > - while ((page = readahead_page(rac))) { > - if (fuse_readpages_fill(&data, page) != 0) > + nr_pages = min(readahead_count(rac), fc->max_pages); Missing fc->max_read clamp. > + ia = fuse_io_alloc(NULL, nr_pages); > + if (!ia) > return; > + ap = &ia->ap; > + __readahead_batch(rac, ap->pages, nr_pages); nr_pages = __readahead_batch(...)? This will give consecutive pages, right? Thanks, Miklos