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=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 97045C433E0 for ; Mon, 8 Mar 2021 18:21:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68FE464DA3 for ; Mon, 8 Mar 2021 18:21:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230512AbhCHSU4 (ORCPT ); Mon, 8 Mar 2021 13:20:56 -0500 Received: from mx2.suse.de ([195.135.220.15]:47984 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230457AbhCHSUo (ORCPT ); Mon, 8 Mar 2021 13:20:44 -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 8700BAB8C; Mon, 8 Mar 2021 18:20:43 +0000 (UTC) Date: Mon, 8 Mar 2021 19:20:40 +0100 From: Oscar Salvador To: Dave Hansen Cc: Andrew Morton , David Hildenbrand , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/3] x86/vmemmap: Drop handling of 4K unaligned vmemmap range Message-ID: <20210308182031.GA25767@linux> References: <20210301083230.30924-1-osalvador@suse.de> <20210301083230.30924-2-osalvador@suse.de> 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-kernel@vger.kernel.org On Thu, Mar 04, 2021 at 07:50:10AM -0800, Dave Hansen wrote: > On 3/1/21 12:32 AM, Oscar Salvador wrote: > > remove_pte_table() is prepared to handle the case where either the > > start or the end of the range is not PAGE aligned. > > This cannot actually happen: > > > > __populate_section_memmap enforces the range to be PMD aligned, > > so as long as the size of the struct page remains multiple of 8, > > the vmemmap range will be aligned to PAGE_SIZE. > > > > Drop the dead code and place a VM_BUG_ON in vmemmap_{populate,free} > > to catch nasty cases. > > I was wondering why the VM_BUG_ON()s went in vmemmap_free() instead of > closer to the code that you modified in remove_pte_table(). I assume > this was because vmemmap_free() is the only (indirect) caller of > remove_pte_table(). Yes, that was pretty much the reason. It seemed reasonable to me to fence it off at the "gate", and not further deep. Does it make sense to you? May I keep your Ack? Thanks Dave! > > Otherwise, this looks fine to me: > > Acked-by: Dave Hansen > -- Oscar Salvador SUSE L3