Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4236673pxb; Tue, 26 Jan 2021 16:38:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaC7M0Ui0HRrfQXZMJkQ+Nl8W/FMusdvFPIwpMtkqbYEJhJBprjIGIuHqLXEiVcvM0i2iX X-Received: by 2002:a05:6402:c9c:: with SMTP id cm28mr6790897edb.281.1611707886757; Tue, 26 Jan 2021 16:38:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611707886; cv=none; d=google.com; s=arc-20160816; b=yx6cg9RlnwVhGKNdpnNO2sbhc9hD5Xu48KB6bcsMut2aJtS5DGU0cfx/FfQTt5Tttp gblbdflIWWmXlwLYH1FWDwnjvyggLqpjRGhVfKwFa0Lm9KDZGFHWYYYVtwo852XaRwSw huonjQaSut46xCs8Bt9NELESPDRiosXC4eowhMGMKz1lSnMuz4ttNPYQOIavrrpV28QT PSzF4Q55BokV9eKk4AWDvjdfhtsvwbUBSj56OIQtYe55UdNkEjvjB/QFlCPz8q6GlmZU DC/EUt7ZfSrQJDejxgmPWoHJmj7RVL5zKPXlZudmAUPEyBUty3QkaQv4HCoEIiaTcvED E/Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dhSDWdgO45oMOw4U14ZD4IpWy4LqGlGQzgyJ+NX3F9s=; b=s0egX12wxB46yB/IVa25VS3klLg4tgMrnTZ+Ba/8zHiAozjxlAZz8ulySEPO6Frk9N m2oL1hxcHxy6QyKqvq6gSStOCz94mkH5QzHg35cUivAkN18foqFYZrhJvuw3m8myRhB8 UsBpHIBHmcDfNdlHGDK/vJ9uwFdNvhi2T4RB5G8Afm4M1MfxX3IK6ung/QKDtTXEKRnP PJmd9VyadbdLkafgarV3Vgol2/+vbFCR6htDjt7yW1o91Ly3jYviZ8QNM4g8pWQlvjld +RDTeeIBzL8Fr3me4aiwhhS2h9TGnHjmkulnG95O8AjkQuT8LCIbBhC4zxa3j30fApug Cn2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RV5i8IOr; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oq8si89727ejb.537.2021.01.26.16.37.24; Tue, 26 Jan 2021 16:38:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RV5i8IOr; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390660AbhA0A2h (ORCPT + 99 others); Tue, 26 Jan 2021 19:28:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56665 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389500AbhAZTMe (ORCPT ); Tue, 26 Jan 2021 14:12:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611688267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dhSDWdgO45oMOw4U14ZD4IpWy4LqGlGQzgyJ+NX3F9s=; b=RV5i8IOr+AD8PVlARWPcj/V3Aef7XJUDwmYp5eA/FXlu1pwjmupvJxXEwK1Uo16ilnfxLn GcXdeVs+2L8BuReRVm+aybpV5CZvGOjSQTbXA2ASq2Q3e+CksGM9aM+gQU8WNiOL0okA5w A4+2vLSlAQ2GZaVbrhEu56Ntl3ONE1M= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-277-JQGo7issMISUG2qOKuIKzQ-1; Tue, 26 Jan 2021 14:11:04 -0500 X-MC-Unique: JQGo7issMISUG2qOKuIKzQ-1 Received: by mail-ed1-f72.google.com with SMTP id q12so5033503edr.2 for ; Tue, 26 Jan 2021 11:11:04 -0800 (PST) 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=dhSDWdgO45oMOw4U14ZD4IpWy4LqGlGQzgyJ+NX3F9s=; b=YVojhRsPjM1THoQIEmHH+CBEm55eFxIsxtSx46TUuZS2U1Zhp/6+6AcQ6hT1FoIL7A V7EwsI3nuvwyNQhlUbKaZsLpSoepeoALJsBpH42kUZJ+TDbNr7syy/MTQuUrfhg3Iwo0 mTL+zp0DtXamETiNIo2oRvztRSWMuJMCmqA27Njby+XJVVZmB73M4wrVcZnJCJLkeHKn oxyLi+GrLYLyQ6Y4Z+xkgTEjZgIwAdQzg0/vKIitE3ikPZh2azZlUj/v0Xgoz8K5b75E Xhnff3kt5UN24e+hxsthJ70LButtueCK3KhNVXChsb2fOjNtgiC4FHf/rUI9wg0E/q82 9R4A== X-Gm-Message-State: AOAM53175PwPnB8PutwFtxKgekLRlV3t9VMZ+KupH54R3uUOEhYQGu8c E7EAX3yrRWThS8K40OB3fciKEX2dAq+fN/WmNOoo7coS96Q9jussg466GDKGQ0D/eCJJ2swCuA3 eXjGLwOk78D63SnB8YDaaZCQZS2c88+sgCx62 X-Received: by 2002:aa7:ce87:: with SMTP id y7mr5760851edv.211.1611688263259; Tue, 26 Jan 2021 11:11:03 -0800 (PST) X-Received: by 2002:aa7:ce87:: with SMTP id y7mr5760842edv.211.1611688263103; Tue, 26 Jan 2021 11:11:03 -0800 (PST) MIME-Version: 1.0 References: <161161025063.2537118.2009249444682241405.stgit@warthog.procyon.org.uk> <161161064956.2537118.3354798147866150631.stgit@warthog.procyon.org.uk> <20210126013611.GI308988@casper.infradead.org> In-Reply-To: From: David Wysochanski Date: Tue, 26 Jan 2021 14:10:26 -0500 Message-ID: Subject: Re: [PATCH 32/32] NFS: Convert readpage to readahead and use netfs_readahead for fscache To: Chuck Lever Cc: Matthew Wilcox , David Howells , Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet , Jeff Layton , Al Viro , linux-cachefs , "linux-afs@lists.infradead.org" , Linux NFS Mailing List , CIFS , "ceph-devel@vger.kernel.org" , "v9fs-developer@lists.sourceforge.net" , linux-fsdevel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Jan 26, 2021 at 10:25 AM Chuck Lever wrote: > > > > > On Jan 25, 2021, at 8:36 PM, Matthew Wilcox wrote: > > > > > > For Subject: s/readpage/readpages/ > > > > On Mon, Jan 25, 2021 at 09:37:29PM +0000, David Howells wrote: > >> +int __nfs_readahead_from_fscache(struct nfs_readdesc *desc, > >> + struct readahead_control *rac) > > > > I thought you wanted it called ractl instead of rac? That's what I've > > been using in new code. > > > >> - dfprintk(FSCACHE, "NFS: nfs_getpages_from_fscache (0x%p/%u/0x%p)\n", > >> - nfs_i_fscache(inode), npages, inode); > >> + dfprintk(FSCACHE, "NFS: nfs_readahead_from_fscache (0x%p/0x%p)\n", > >> + nfs_i_fscache(inode), inode); > > > > We do have readahead_count() if this is useful information to be logging. > > As a sidebar, the Linux NFS community is transitioning to tracepoints. > It would be helpful (but not completely necessary) to use tracepoints > in new code instead of printk. > The netfs API has a lot of good tracepoints and to be honest I think we can get rid of fscache's rpcdebug, but let me take a closer look to be sure. I didn't use rpcdebug much, if at all, in the latest rounds of debugging. > > >> +static inline int nfs_readahead_from_fscache(struct nfs_readdesc *desc, > >> + struct readahead_control *rac) > >> { > >> - if (NFS_I(inode)->fscache) > >> - return __nfs_readpages_from_fscache(ctx, inode, mapping, pages, > >> - nr_pages); > >> + if (NFS_I(rac->mapping->host)->fscache) > >> + return __nfs_readahead_from_fscache(desc, rac); > >> return -ENOBUFS; > >> } > > > > Not entirely sure that it's worth having the two functions separated any more. > > > >> /* attempt to read as many of the pages as possible from the cache > >> * - this returns -ENOBUFS immediately if the cookie is negative > >> */ > >> - ret = nfs_readpages_from_fscache(desc.ctx, inode, mapping, > >> - pages, &nr_pages); > >> + ret = nfs_readahead_from_fscache(&desc, rac); > >> if (ret == 0) > >> goto read_complete; /* all pages were read */ > >> > >> nfs_pageio_init_read(&desc.pgio, inode, false, > >> &nfs_async_read_completion_ops); > >> > >> - ret = read_cache_pages(mapping, pages, readpage_async_filler, &desc); > >> + while ((page = readahead_page(rac))) { > >> + ret = readpage_async_filler(&desc, page); > >> + put_page(page); > >> + } > > > > I thought with the new API we didn't need to do this kind of thing > > any more? ie no matter whether fscache is configured in or not, it'll > > submit the I/Os. > > -- > Chuck Lever > > >