From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932071AbdHUPeE (ORCPT ); Mon, 21 Aug 2017 11:34:04 -0400 Received: from mga06.intel.com ([134.134.136.31]:18650 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753222AbdHUP3Z (ORCPT ); Mon, 21 Aug 2017 11:29:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,409,1498546800"; d="scan'208";a="892652529" From: "Kirill A. Shutemov" To: Linus Torvalds , x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: Andrew Morton , Andy Lutomirski , Dmitry Safonov , Cyrill Gorcunov , Borislav Petkov , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" , Minchan Kim , Nitin Gupta , Sergey Senozhatsky Subject: [PATCHv5 02/19] mm/zsmalloc: Prepare to variable MAX_PHYSMEM_BITS Date: Mon, 21 Aug 2017 18:28:59 +0300 Message-Id: <20170821152916.40124-3-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170821152916.40124-1-kirill.shutemov@linux.intel.com> References: <20170821152916.40124-1-kirill.shutemov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With boot-time switching between paging mode we will have variable MAX_PHYSMEM_BITS. Let's use the maximum varible possible for CONFIG_X86_5LEVEL=y configuration to define zsmalloc data structures. Signed-off-by: Kirill A. Shutemov Cc: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky --- mm/zsmalloc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 013eea76685e..468879915d3d 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -93,7 +93,13 @@ #define MAX_PHYSMEM_BITS BITS_PER_LONG #endif #endif + +#ifdef CONFIG_X86_5LEVEL +/* MAX_PHYSMEM_BITS is variable, use maximum value here */ +#define _PFN_BITS (52 - PAGE_SHIFT) +#else #define _PFN_BITS (MAX_PHYSMEM_BITS - PAGE_SHIFT) +#endif /* * Memory for allocating for handle keeps object position by -- 2.14.1