From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753556AbbF2JGf (ORCPT ); Mon, 29 Jun 2015 05:06:35 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:34152 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785AbbF2JGF (ORCPT ); Mon, 29 Jun 2015 05:06:05 -0400 Date: Mon, 29 Jun 2015 18:06:34 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC][PATCHv3 3/7] zsmalloc: always keep per-class stats Message-ID: <20150629090634.GC549@swordfish> References: <1434628004-11144-1-git-send-email-sergey.senozhatsky@gmail.com> <1434628004-11144-4-git-send-email-sergey.senozhatsky@gmail.com> <20150629064029.GA13179@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150629064029.GA13179@bbox> User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (06/29/15 15:40), Minchan Kim wrote: > On Thu, Jun 18, 2015 at 08:46:40PM +0900, Sergey Senozhatsky wrote: > > Always account per-class `zs_size_stat' stats. This data will > > help us make better decisions during compaction. We are especially > > interested in OBJ_ALLOCATED and OBJ_USED, which can tell us if > > class compaction will result in any memory gain. > > > > For instance, we know the number of allocated objects in the class, > > the number of objects being used (so we also know how many objects > > are not used) and the number of objects per-page. So we can ensure > > if we have enough unused objects to form at least one ZS_EMPTY > > zspage during compaction. > > > > We calculate this value on per-class basis so we can calculate a > > total number of zspages that can be released. Which is exactly what > > a shrinker wants to know. > > > > Signed-off-by: Sergey Senozhatsky > Acked-by: Minchan Kim > thanks. -ss