From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932470AbcEKJdI (ORCPT ); Wed, 11 May 2016 05:33:08 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35928 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932154AbcEKJdE (ORCPT ); Wed, 11 May 2016 05:33:04 -0400 Date: Wed, 11 May 2016 18:34:35 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Ganesh Mahendran , Nitin Gupta , Andrew Morton , Linux-MM , linux-kernel Subject: Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage() Message-ID: <20160511093435.GA13113@swordfish> References: <1462425447-13385-1-git-send-email-opensource.ganesh@gmail.com> <20160505100329.GA497@swordfish> <20160506030935.GA18573@bbox> <20160506090801.GA488@swordfish> <20160506093342.GB488@swordfish> <20160509050102.GA4574@blaptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160509050102.GA4574@blaptop> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (05/09/16 14:01), Minchan Kim wrote: [..] > > no, we need cltd there. but ZS_MAX_PAGES_PER_ZSPAGE also affects > > ZS_MIN_ALLOC_SIZE, which is used in several places, like > > get_size_class_index(). that's why ZS_MAX_PAGES_PER_ZSPAGE data > > type change `improves' zs_malloc(). > > Why not if such simple improves zsmalloc? :) > Please send a patch. > > Thanks a lot, Sergey! Hello Minchan, sorry for long reply, I decided to investigate it a bit further. with this patch, gcc 6.1 -O2 generates "+13" instructions more, -Os "-25" instructions less. this +13 ins case is a no-no-no. -ss