From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932682AbcEQB10 (ORCPT ); Mon, 16 May 2016 21:27:26 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36498 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932631AbcEQB1Y (ORCPT ); Mon, 16 May 2016 21:27:24 -0400 Date: Tue, 17 May 2016 10:27:12 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky Subject: Re: [PATCH v5 08/12] zsmalloc: introduce zspage structure Message-ID: <20160517012712.GA497@swordfish> References: <1462760433-32357-1-git-send-email-minchan@kernel.org> <1462760433-32357-9-git-send-email-minchan@kernel.org> <20160516030941.GD504@swordfish> <20160517011418.GB31335@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160517011418.GB31335@bbox> 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/17/16 10:14), Minchan Kim wrote: [..] > > can we also switch create_cache() to errnos? I just like a bit > > better > > return -ENOMEM; > > else > > return 0; > > > > than > > > > return 1; > > else > > return 0; > > > > Hmm, of course, I can do it easily. > But zs_create_pool returns NULL without error propagation from sub > functions so I don't see any gain from returning errno from > create_cache. I don't mean I hate it but just need a justificaion > to persuade grumpy me. :) not married to those errnos. can skip it. > > > +static struct zspage *isolate_zspage(struct size_class *class, bool source) > > > { > > > + struct zspage *zspage; > > > + enum fullness_group fg[2] = {ZS_ALMOST_EMPTY, ZS_ALMOST_FULL}; > > > + if (!source) { > > > + fg[0] = ZS_ALMOST_FULL; > > > + fg[1] = ZS_ALMOST_EMPTY; > > > + } > > > + > > > + for (i = 0; i < 2; i++) { > > > > sorry, why not "for (i = ZS_ALMOST_EMPTY; i <= ZS_ALMOST_FULL ..." ? > > For source zspage, the policy is to find a fragment object from ZS_ALMOST_EMPTY. > For target zspage, the policy is to find a fragment object from ZS_ALMOST_FULL. > > Do I misunderstand your question? ahhh... sorry, it's just me being silly. I got it now. -ss