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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 515ACC433DB for ; Wed, 13 Jan 2021 09:21:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09AF4233E2 for ; Wed, 13 Jan 2021 09:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726017AbhAMJVP (ORCPT ); Wed, 13 Jan 2021 04:21:15 -0500 Received: from mx2.suse.de ([195.135.220.15]:45218 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbhAMJVO (ORCPT ); Wed, 13 Jan 2021 04:21:14 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8F350ACF5; Wed, 13 Jan 2021 09:20:32 +0000 (UTC) Date: Wed, 13 Jan 2021 10:20:28 +0100 From: Oscar Salvador To: Muchun Song Cc: Jonathan Corbet , Mike Kravetz , Thomas Gleixner , mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, Peter Zijlstra , viro@zeniv.linux.org.uk, Andrew Morton , paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, Randy Dunlap , oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, Mina Almasry , David Rientjes , Matthew Wilcox , Michal Hocko , "Song Bao Hua (Barry Song)" , David Hildenbrand , HORIGUCHI =?utf-8?B?TkFPWUEo5aCA5Y+jIOebtOS5nyk=?= , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel Subject: Re: [External] Re: [PATCH v12 04/13] mm/hugetlb: Free the vmemmap pages associated with each HugeTLB page Message-ID: <20210113092028.GB24816@linux> References: <20210106141931.73931-1-songmuchun@bytedance.com> <20210106141931.73931-5-songmuchun@bytedance.com> <20210112080453.GA10895@linux> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, Jan 12, 2021 at 07:33:33PM +0800, Muchun Song wrote: > > It seems a bit odd to only pass "start" for the BUG_ON. > > Also, I kind of dislike the "addr += PAGE_SIZE" in vmemmap_pte_range. > > > > I wonder if adding a ".remap_start_addr" would make more sense. > > And adding it here with the vmemmap_remap_walk init. > > How about introducing a new function which aims to get the reuse > page? In this case, we can drop the BUG_ON() and "addr += PAGE_SIZE" > which is in vmemmap_pte_range. The vmemmap_remap_range only > does the remapping. How would that look? It might be good, dunno, but the point is, we should try to make the rules as simple as possible, dropping weird assumptions. Callers of vmemmap_remap_free should know three things: - Range to be remapped - Addr to remap to - Current implemantion needs addr to be remap to to be part of the complete range right? -- Oscar Salvador SUSE L3