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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80103C83F1A for ; Tue, 29 Aug 2023 14:20:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235272AbjH2OUO (ORCPT ); Tue, 29 Aug 2023 10:20:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236682AbjH2OTx (ORCPT ); Tue, 29 Aug 2023 10:19:53 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 116F5199 for ; Tue, 29 Aug 2023 07:19:49 -0700 (PDT) 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=e4hMctN6emCgrqiKuxK7UKWS85HR+fi7fjHSuR7TJAk=; b=wGtTAk8uXg4+MUSjXCkamKt4+O ytIr3Go3FRCrQRV2Bcs7qEZBhVZFDleCQWG+1fal6IxDqrNIt0ba+7uTclPUN+JjINfL4tcjQ6Zsa DZ3r+hv7v0cmIFAdtbdSEMI2R0mYXbvScPCX9noQQwt9b0xKmrcbC9cASH2QzzZeuOR/B/6qH/rm1 RH01II3NoRdmwioVWAszh+NazastL1w4SczDpXbMTAbiyrMLkP5ggtXn+T5W/Fm86zbgj2hFIie+E v1AiH79QxLeZUjd1IC1bxvRCcWmOYRaQDTmxexp7xFANkZW+mgYjkclwR73BELHEQwiqiPSyg+5ik Sj/lurOA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qazZ3-0071DB-D2; Tue, 29 Aug 2023 14:19:29 +0000 Date: Tue, 29 Aug 2023 15:19:29 +0100 From: Matthew Wilcox To: Ryan Roberts Cc: Will Deacon , "Aneesh Kumar K.V" , Andrew Morton , Nick Piggin , Peter Zijlstra , Christian Borntraeger , Sven Schnelle , Arnd Bergmann , David Hildenbrand , Yu Zhao , "Kirill A. Shutemov" , Yin Fengwei , Yang Shi , "Huang, Ying" , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 4/4] mm/mmu_gather: Store and process pages in contig ranges Message-ID: References: <20230810103332.3062143-1-ryan.roberts@arm.com> <20230810103332.3062143-5-ryan.roberts@arm.com> <29099099-7ef2-45cb-bab7-455f58de47d1@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <29099099-7ef2-45cb-bab7-455f58de47d1@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 29, 2023 at 03:02:22PM +0100, Ryan Roberts wrote: > >> + if (put_devmap_managed_page(&folio->page)) > >> + continue; > >> + if (folio_put_testzero(folio)) > > > > We're only putting one ref for the zone_device folios? Surely > > this should be ref_sub_and_test like below? > > Good point. This function is originally a copy/paste of release_pages(), and I > obviously missed this. In fact, looking at it again today, I think I'll factor > out the vast majority into a common helper, since I'm currently duplicating a > whole bunch here. > > In practice I think all devmap folios will be small today though? So while I > agree I need to fix this, I think in practice it will currently do the right thing? I think the devdax code uses 2MB folios. > > You'll be glad to know I've factored out a nice little helper for that. > > OK, what's it called? This is just copied from release_pages() at the moment. > Happy to use your helper in the refactored common helper. I'll send out those patches today.