From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id 2D45F6B0038 for ; Sat, 21 Oct 2017 04:32:14 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id v127so5596488wma.3 for ; Sat, 21 Oct 2017 01:32:14 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c30sor1472545edf.16.2017.10.21.01.32.12 for (Google Transport Security); Sat, 21 Oct 2017 01:32:13 -0700 (PDT) Date: Sat, 21 Oct 2017 11:32:10 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH 1/4] mm/zsmalloc: Prepare to variable MAX_PHYSMEM_BITS Message-ID: <20171021083210.njqhsc3wlhkh5g34@node.shutemov.name> References: <20171020195934.32108-1-kirill.shutemov@linux.intel.com> <20171020195934.32108-2-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Nitin Gupta Cc: "Kirill A. Shutemov" , Ingo Molnar , Linus Torvalds , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Cyrill Gorcunov , Borislav Petkov , Andi Kleen , linux-mm , linux-kernel , Minchan Kim , Sergey Senozhatsky On Fri, Oct 20, 2017 at 06:43:55PM -0700, Nitin Gupta wrote: > On Fri, Oct 20, 2017 at 12:59 PM, Kirill A. Shutemov > wrote: > > With boot-time switching between paging mode we will have variable > > MAX_PHYSMEM_BITS. > > > > Let's use the maximum variable possible for CONFIG_X86_5LEVEL=y > > configuration to define zsmalloc data structures. > > > > The patch introduces MAX_POSSIBLE_PHYSMEM_BITS to cover such case. > > It also suits well to handle PAE special case. > > > > > I see that with your upcoming patch, MAX_PHYSMEM_BITS is turned into a > variable for x86_64 case as: (pgtable_l5_enabled ? 52 : 46). > > Even with this change, I don't see a need for this new > MAX_POSSIBLE_PHYSMEM_BITS constant. This is the error, I'm talking about: mm/zsmalloc.c:249:21: error: variably modified a??size_classa?? at file scope struct size_class *size_class[ZS_SIZE_CLASSES]; ZS_SIZE_CLASSES ZS_MIN_ALLOC_SIZE OBJ_INDEX_BITS _PFN_BITS MAX_PHYSMEM_BITS (pgtable_l5_enabled ? 52 : 46) Check without the patch and full patchset applied. -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org