From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753121AbdJUIcQ (ORCPT ); Sat, 21 Oct 2017 04:32:16 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:44991 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbdJUIcN (ORCPT ); Sat, 21 Oct 2017 04:32:13 -0400 X-Google-Smtp-Source: ABhQp+RNIOxyuZxS8GmncudzQI4X8dtRPDrIaq4bzzZ6Ew0SiVEeL+PS+5P+/BKpyoRe6IkyZHHPLg== Date: Sat, 21 Oct 2017 11:32:10 +0300 From: "Kirill A. Shutemov" 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 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: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ‘size_class’ 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