Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2006668ybv; Sun, 23 Feb 2020 20:34:14 -0800 (PST) X-Google-Smtp-Source: APXvYqyqoath+K6aFVgRdbiZAVCX+8YNRK1XbyOcH6w596z29/prJ4Fo81JJUTcjxqEtnsK7b7zE X-Received: by 2002:aca:f20b:: with SMTP id q11mr10685595oih.78.1582518854193; Sun, 23 Feb 2020 20:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582518854; cv=none; d=google.com; s=arc-20160816; b=Axm8Pz7QV5QI46Knt+raJBeE4AD1TRE4sUvUtPUpqA7ZHeHLTqYN9B2HfHW9FuWGZk JeUyydHFi1eX6GHgTmfD8uAIlOp3Unlv2ns4rwaSc6d5ogKtylGpj9ALCqE0YnpLOKHV /bC5Tq1enEqWcZeB0D86/tbc9234OzLojDvTTXyg7zY5YywFTwXqUYdQgI0c0R/eq2a3 YTE60JDNu58Hi0TEc7ovfOVWeRnObDRBaiLVkXQt4qmrl2j9zqQ8JqnVgFKlNPCFQVPe 4GuhnArdWsf76XKRjLc6J2EF31clNs/RYdeP/PniRhgySumghfaHyBui0Fp5LPDKEF6x ho7g== 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 :dkim-signature; bh=oZOe8S6XU8WPAzzWKK+7v8HQwuSfqOL+eNbf+Acq4Wc=; b=NnQvxWN0bw7fTeloAp1MZVS0CTKciS0jFq+aZaxwCC+nt/wgP3Wo66ggDCR4Ser/l4 ER0SVDcRoMB7UGLfi5GqRHirJW2BwsnWrJ1hRYK1focNB1XXt5TN1vAgGJYKTglNO28Z RSlg3ZkAa+ICOsK92dzaW2lJDNMX6zCX5oHbV9lfu2ZlYL/OpMvIMCNpY1tjaAfSEG3U jiY9Paz0U9IAF2+idxw5+/TGQXzjKlHrO57+HvqaL24uEjmqNMXbz62Uwwt2nxEcjMzp GIBelMfXxKlfsHfBhiDavGjN/D87zIVCRLLRedOuzXhBZLTlfFhYeQW6Y6rwXiM8zVSC HYMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ALNrh1EB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si5583666otk.225.2020.02.23.20.34.02; Sun, 23 Feb 2020 20:34:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ALNrh1EB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727274AbgBXEd4 (ORCPT + 99 others); Sun, 23 Feb 2020 23:33:56 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:56642 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727186AbgBXEd4 (ORCPT ); Sun, 23 Feb 2020 23:33:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=oZOe8S6XU8WPAzzWKK+7v8HQwuSfqOL+eNbf+Acq4Wc=; b=ALNrh1EBEZbPI0eohwoy43k7IJ XJ2e9816/Cs/vRrqDf3S6gKYY5tNTkWN4kjJFPML+eVKwmz8Ej5/NJIR097xCbOVGT4n/3FVCtY3O gn/yNbyTTS/qLVvgD8a/9uv4J4ws/6B3fng445cylTypcWambS3YaUfmoMD+/TOtojzWbjZpE6/zo ghV8g3yRtNrjP80Aoo51Pd9fIJz1CgBzZuRDbL9STCkWsJuA7Fz9M8l7mClCERunvUnwRHI/iy7J0 DR9XgSFpwQPqfjwVfkmT0/g0k3jsyI3Efuhg2HSWlBcxnyFp7l7jjt1QI9lutMTR51+hhwlnhGP9z +ZZz/7SQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j65RL-0000Cd-GT; Mon, 24 Feb 2020 04:33:55 +0000 Date: Sun, 23 Feb 2020 20:33:55 -0800 From: Matthew Wilcox To: "Darrick J. Wong" Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, ocfs2-devel@oss.oracle.com, linux-xfs@vger.kernel.org Subject: Re: [PATCH v7 22/24] iomap: Convert from readpages to readahead Message-ID: <20200224043355.GL24185@bombadil.infradead.org> References: <20200219210103.32400-1-willy@infradead.org> <20200219210103.32400-23-willy@infradead.org> <20200220154912.GC19577@infradead.org> <20200220165734.GZ24185@bombadil.infradead.org> <20200222010013.GH9506@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200222010013.GH9506@magnolia> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 21, 2020 at 05:00:13PM -0800, Darrick J. Wong wrote: > On Thu, Feb 20, 2020 at 08:57:34AM -0800, Matthew Wilcox wrote: > > On Thu, Feb 20, 2020 at 07:49:12AM -0800, Christoph Hellwig wrote: > > +/** > > + * iomap_readahead - Attempt to read pages from a file. > > + * @rac: Describes the pages to be read. > > + * @ops: The operations vector for the filesystem. > > + * > > + * This function is for filesystems to call to implement their readahead > > + * address_space operation. > > + * > > + * Context: The file is pinned by the caller, and the pages to be read are > > + * all locked and have an elevated refcount. This function will unlock > > + * the pages (once I/O has completed on them, or I/O has been determined to > > + * not be necessary). It will also decrease the refcount once the pages > > + * have been submitted for I/O. After this point, the page may be removed > > + * from the page cache, and should not be referenced. > > + */ > > > > > Isn't the context documentation something that belongs into the aop > > > documentation? I've never really seen the value of duplicating this > > > information in method instances, as it is just bound to be out of date > > > rather sooner than later. > > > > I'm in two minds about it as well. There's definitely no value in > > providing kernel-doc for implementations of a common interface ... so > > rather than fixing the nilfs2 kernel-doc, I just deleted it. But this > > isn't just the implementation, like nilfs2_readahead() is, it's a library > > function for filesystems to call, so it deserves documentation. On the > > other hand, there's no real thought to this on the part of the filesystem; > > the implementation just calls this with the appropriate ops pointer. > > > > Then again, I kind of feel like we need more documentation of iomap to > > help filesystems convert to using it. But maybe kernel-doc isn't the > > mechanism to provide that. > > I think we need more documentation of the parts of iomap where it can > call back into the filesystem (looking at you, iomap_dio_ops). > > I'm not opposed to letting this comment stay, though I don't see it as > all that necessary since iomap_readahead implements a callout that's > documented in vfs.rst and is thus subject to all the constraints listed > in the (*readahead) documentation. Right. And that's not currently in kernel-doc format, but should be. Something for a different patchset, IMO. What we need documenting _here_ is the conditions under which the iomap_ops are called so the filesystem author doesn't need to piece them together from three different places. Here's what I currently have: * Context: The @ops callbacks may submit I/O (eg to read the addresses of * blocks from disc), and may wait for it. The caller may be trying to * access a different page, and so sleeping excessively should be avoided. * It may allocate memory, but should avoid large allocations. This * function is called with memalloc_nofs set, so allocations will not cause * the filesystem to be reentered.