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 64E8FC388F9 for ; Sat, 7 Nov 2020 17:21:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4555D20878 for ; Sat, 7 Nov 2020 17:20:59 +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="VCnsLuEs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4555D20878 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 7781F6B0036; Sat, 7 Nov 2020 12:20:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 728586B005D; Sat, 7 Nov 2020 12:20:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 616DB6B0068; Sat, 7 Nov 2020 12:20:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0184.hostedemail.com [216.40.44.184]) by kanga.kvack.org (Postfix) with ESMTP id 41BA06B0036 for ; Sat, 7 Nov 2020 12:20:58 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D48298249980 for ; Sat, 7 Nov 2020 17:20:57 +0000 (UTC) X-FDA: 77458287354.25.maid81_540386c272dc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id B3A4B1804E3A0 for ; Sat, 7 Nov 2020 17:20:57 +0000 (UTC) X-HE-Tag: maid81_540386c272dc X-Filterd-Recvd-Size: 2980 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Sat, 7 Nov 2020 17:20:55 +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=wsqbZWpX+RE3jugUa643uHAaAtcUOG7w2keGcxmfdNc=; b=VCnsLuEs+ZsM8cYsagcJWvj1LG DgF9uVNC0l2NV7uG6Vp5K5o2hPnG+BTlVAqYkEX5/w08iVbCtvLFVXLtFpfPYeJm0ayJZk2XFQOam UWj/uWSid0MdShWnfgtQgINHBbvb0f8i6fRh6G5WKimYzPr/mbe1S1Or23Nlde5GkLFrWIwrpfcs1 +qUwIWN+rp+2YnB7IaKSF2nXPRKyLPZtDrD9zCUfnZMnvq31PCJAZ20MpPCPU4vy/HZeT8fLrIJIc zk9uXG51oR22XVhkNwX/RNa4VwYaIcrMLA6ZXZNfCbfarwxB34I+WyFZbJL/jfwT6XldyzFm30thM v50qwLUQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kbRtR-0007dI-15; Sat, 07 Nov 2020 17:20:49 +0000 Date: Sat, 7 Nov 2020 17:20:48 +0000 From: Matthew Wilcox To: Kent Overstreet Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, hch@lst.de Subject: Re: [PATCH 1/4] pagevec: Allow pagevecs to be different sizes Message-ID: <20201107172048.GW17076@casper.infradead.org> References: <20201106080815.GC31585@lst.de> <20201106123040.28451-1-willy@infradead.org> <20201107170813.GD3365678@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201107170813.GD3365678@moria.home.lan> 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 Sat, Nov 07, 2020 at 12:08:13PM -0500, Kent Overstreet wrote: > On Fri, Nov 06, 2020 at 12:30:37PM +0000, Matthew Wilcox (Oracle) wrote: > > struct pagevec { > > - unsigned char nr; > > - bool percpu_pvec_drained; > > - struct page *pages[PAGEVEC_SIZE]; > > + union { > > + struct { > > + unsigned char sz; > > + unsigned char nr; > > + bool percpu_pvec_drained; > This should probably be removed, it's only used by the swap code and I don't > think it belongs in the generic data structure. That would mean nr and size (and > let's please use more standard naming...) can be u32, not u8s. Nevertheless, that's a very important user of pagevecs! You and I have no need for it in the fs code, but it doesn't hurt to leave it here. I really don't think that increasing the size above 255 is worth anything. See my earlir analysis of the effect of increasing the batch size. > > + struct page *pages[PAGEVEC_SIZE]; > > + }; > > + void *__p[PAGEVEC_SIZE + 1]; > > What's up with this union? *blink*. That was supposed to be 'struct page *pages[];' And the reason to do it that way is to avoid overly-clever instrumentation like kmsan from saying "Hey, nr is bigger than 16, this is a buffer overrun". Clearly I didn't build a kernel with the various sanitisers enabled, but I'll do that now.