From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752369AbbF2Gkb (ORCPT ); Mon, 29 Jun 2015 02:40:31 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35728 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751103AbbF2GkW (ORCPT ); Mon, 29 Jun 2015 02:40:22 -0400 Date: Mon, 29 Jun 2015 15:40:29 +0900 From: Minchan Kim To: Sergey Senozhatsky Cc: 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: <20150629064029.GA13179@bbox> References: <1434628004-11144-1-git-send-email-sergey.senozhatsky@gmail.com> <1434628004-11144-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: <1434628004-11144-4-git-send-email-sergey.senozhatsky@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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