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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CAB4C433EF for ; Thu, 23 Dec 2021 14:18:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF84F6B007B; Thu, 23 Dec 2021 09:18:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CA6DE6B007E; Thu, 23 Dec 2021 09:18:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BBC146B0081; Thu, 23 Dec 2021 09:18:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id AD8DA6B007B for ; Thu, 23 Dec 2021 09:18:47 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5C2BA181AC9C6 for ; Thu, 23 Dec 2021 14:18:47 +0000 (UTC) X-FDA: 78949265094.16.B9EC9E7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id 0730F16004B for ; Thu, 23 Dec 2021 14:18:38 +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=af1HB3iQXtGY96eAtIbQ9A2o1JhPBSZtPCS4+NWkcYE=; b=YCkfflfGOS/KJkEKl9FUzUTPgv RreldabdUEmgYccieLGO3w1FVa3jKrgGJVGi8ALVuSgYm/9tb+8rjjPZHJEZC+6HAVMc8UNuZeoX9 iA9/roErqV/34tpixMZCVKjiaqZFTWPwi67/+0jq0nxlFh0RzobZiCo7ovlJ92EQaHd5Molfgge2X KUaIBS6x9NvP5tWVPgBGDNif7IORhKDjMKrN0wdIgT7FDHnqG+brOOiRBCfwxoJ7z1DJH0rhWlTCA 1VYu+k9zTLu/4gBKojVz+KdYVwwxPkzjDV2MoygmjmRap4cmZkra7CyWBaFCqCXTlAGDsEBgKsvkH j9yBdj0w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0OvZ-004KUh-0W; Thu, 23 Dec 2021 14:18:41 +0000 Date: Thu, 23 Dec 2021 14:18:40 +0000 From: Matthew Wilcox To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 05/48] pagevec: Add folio_batch Message-ID: References: <20211208042256.1923824-1-willy@infradead.org> <20211208042256.1923824-6-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 0730F16004B X-Stat-Signature: cmt5ho4hc6kxbsihxunw64tnfgs3ye8u Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=YCkfflfG; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1640269118-535399 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 Wed, Dec 22, 2021 at 10:54:27PM -0800, Christoph Hellwig wrote: > On Wed, Dec 08, 2021 at 04:22:13AM +0000, Matthew Wilcox (Oracle) wrote: > > +static inline void folio_batch_release(struct folio_batch *fbatch) > > +{ > > + pagevec_release((struct pagevec *)fbatch); > > +} > > + > > +static inline void folio_batch_remove_exceptionals(struct folio_batch *fbatch) > > +{ > > + pagevec_remove_exceptionals((struct pagevec *)fbatch); > > +} > > I think these casts need documentation, both here and at the > struct folio_batch and struct pagevec definitions. > > Alternatively I wonder if a union in stuct pagevec so that it can store > folios or pages might be the better option. I tried that way first, but then the caller & callee need to agree whether they're storing folios or pages in the pagevec. And that's kind of why we have types. pagevec_remove_exceptionals() goes away by the end of this series. pagevec_release() will take longer to remove. What documentation do you want to see?