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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 EB6B3C2D0A3 for ; Sat, 7 Nov 2020 01:21:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 70FE62065C for ; Sat, 7 Nov 2020 01:21:20 +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="jLAwBDeE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70FE62065C 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 5ED796B0036; Fri, 6 Nov 2020 20:21:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 59EA26B005D; Fri, 6 Nov 2020 20:21:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 48D646B0068; Fri, 6 Nov 2020 20:21:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0252.hostedemail.com [216.40.44.252]) by kanga.kvack.org (Postfix) with ESMTP id 19F9A6B0036 for ; Fri, 6 Nov 2020 20:21:19 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B11181EE6 for ; Sat, 7 Nov 2020 01:21:18 +0000 (UTC) X-FDA: 77455869036.25.tax68_2915ed5272d7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 916891804E3A0 for ; Sat, 7 Nov 2020 01:21:18 +0000 (UTC) X-HE-Tag: tax68_2915ed5272d7 X-Filterd-Recvd-Size: 2858 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Sat, 7 Nov 2020 01:21:18 +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=CcHu04oLtaeo7nAVGHC2uMTz2OBKyS2RSKI34+iWAGQ=; b=jLAwBDeEbi3879TM5c3BBT2iMu ji/sGPj2run20F63PHtA+DSEg9wRHLiOFF7yyrSyS22bKb8k9ZsbXbW4ggWKiFyQCds9GdS/ocfyZ J1pBjCGQSplFOnGfklG63xDXsc8ZUNXX7C3jwgMwYtcskmgRBy7G7kiuct/wMrqj2gomRCQ0T/X3I 0vdFrEq5nJETcDFR2BXfPPbVPFyiLn3/rpVNpYWkMyK9tSwVAaWcRQbYmnh3ZV9w9LAlHQNRVyOnE OvmhpKHQY2dvLnjmdio7W7aagd1uutYVUQgvIQlkulimhThhF930yvJID02ESfN6LgiPciP4YGQOV j0qQqYOA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kbCum-0006vq-6L; Sat, 07 Nov 2020 01:21:12 +0000 Date: Sat, 7 Nov 2020 01:21:12 +0000 From: Matthew Wilcox To: Tim Chen Cc: linux-mm@kvack.org, Jan Kara Subject: Re: [PATCH 1/2] pagevec: Allow pagevecs to be different sizes Message-ID: <20201107012112.GU17076@casper.infradead.org> References: <20201105172651.2455-1-willy@infradead.org> <20201105172651.2455-2-willy@infradead.org> <1c857e99-5985-5bc2-ca29-c77d612460fa@linux.intel.com> <20201106191210.GR17076@casper.infradead.org> <400d19a9-1113-5903-053e-85100104d229@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <400d19a9-1113-5903-053e-85100104d229@linux.intel.com> 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, Nov 06, 2020 at 02:18:40PM -0800, Tim Chen wrote: > On 11/6/20 11:12 AM, Matthew Wilcox wrote: > > I have a number of changes already in that area that are currently in-flight. > > https://lore.kernel.org/linux-mm/20201026041408.25230-1-willy@infradead.org/ > > > > (although I should modify patch 9/12 to not use PAGEVEC_SIZE directly) > > Okay. I assume that you are using pagevec_size somewhere to replace those > hardcoded PAGEVEC_SIZE somewhere. Ah. I felt I should add it, as a counterpart to pagevec_count(). But most users don't need to ask what size the pagevec is; they just add pages to it until it's full. eg: pvec = this_cpu_ptr(&lru_pvecs.lru_add); if (!pagevec_add(pvec, page) || PageCompound(page)) __pagevec_lru_add(pvec); so as long as it's right in pagevec_add(), it'll be fine: static inline unsigned pagevec_add(struct pagevec *pvec, struct page *page) { pvec->pages[pvec->nr++] = page; return pagevec_space(pvec); } and I fix pagevec_space in patch 1: return pvec->sz - pvec->nr;