From: Vineet Gupta Subject: Re: [PATCH v2 1/5] ARC: mm: remove __ARCH_USE_5LEVEL_HACK Date: Tue, 15 Oct 2019 15:06:41 -0700 Message-ID: References: <20191015191926.9281-1-vgupta@synopsys.com> <20191015191926.9281-2-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Linus Torvalds Cc: linux-arch , Arnd Bergmann , Peter Zijlstra , "Aneesh Kumar K . V" , Linux Kernel Mailing List , Nick Piggin , Linux-MM , Andrew Morton , linux-snps-arc@lists.infradead.org, Will Deacon , "Kirill A . Shutemov" List-Id: linux-arch.vger.kernel.org On 10/15/19 2:48 PM, Linus Torvalds wrote: > On Tue, Oct 15, 2019 at 12:19 PM Vineet Gupta > wrote: >> This is a non-functional change anyways since ARC has software page walker >> with 2 lookup levels (pgd -> pte) > > Could we encourage other architectures to do the same, and get rid of > all uses of __ARCH_USE_5LEVEL_HACK? IMHO this should have been done at the onset. The actual changes don't seem that difficult, just need to add the missing p4d calls although I can sympathize with hassles of coordinating/building/testing/yadi yada cross arch. OTOH, the [45]LEVEL_HACK seem like a nice way to "fold" the levels: the skipped/folded level vanishes completely. Among others it does things like #define p4d_t pgd_t On ARC 2-level code: free_pte_range pmd_pgtable(*pmd); ((((((*pmd).pud).pgd))) & PAGE_MASK)); <-- 5LEVEL_HACK vs. ((((((((*pmd).pud).p4d).pgd)))) & PAGE_MASK )); <-- w/o 5LEVEL_HACK pmd_clear(pmd); *(pmd)).pud).pgd)))) = 0 vs. *(pmd)).pud).p4d).pgd)))) = 0 So we may not be able to fix all he historical misgivigs, but this might alleviate the pain a bit. I'll try to dabble a bit. Thx for taking a look and te ACKs. -Vineet