From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426014AbcBRJyY (ORCPT ); Thu, 18 Feb 2016 04:54:24 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:33913 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425751AbcBRJyT (ORCPT ); Thu, 18 Feb 2016 04:54:19 -0500 Date: Thu, 18 Feb 2016 18:55:36 +0900 From: Sergey Senozhatsky To: Joonsoo Kim Cc: Sergey Senozhatsky , Andrew Morton , Minchan Kim , Linux Memory Management List , LKML , Sergey Senozhatsky Subject: Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Message-ID: <20160218095536.GA503@swordfish> References: <1455764556-13979-1-git-send-email-sergey.senozhatsky@gmail.com> <1455764556-13979-4-git-send-email-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Joonsoo, On (02/18/16 17:28), Joonsoo Kim wrote: > 2016-02-18 12:02 GMT+09:00 Sergey Senozhatsky > : > > ZS_MAX_PAGES_PER_ZSPAGE does not have to be order or 2. The existing > > limit of 4 pages per zspage sets a tight limit on ->huge classes, which > > results in increased memory wastage and consumption. > > There is a reason that it is order of 2. Increasing ZS_MAX_PAGES_PER_ZSPAGE > is related to ZS_MIN_ALLOC_SIZE. If we don't have enough OBJ_INDEX_BITS, > ZS_MIN_ALLOC_SIZE would be increase and it causes regression on some > system. Thanks! do you mean PHYSMEM_BITS != BITS_PER_LONG systems? PAE/LPAE? isn't it the case that on those systems ZS_MIN_ALLOC_SIZE already bigger than 32? MAX_PHYSMEM_BITS 36 _PFN_BITS 36 - 12 OBJ_INDEX_BITS (32 - (36 - 12) - 1) ZS_MIN_ALLOC_SIZE MAX(32, 4 << 12 >> (32 - (36 - 12) - 1)) != 32 -ss