From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752601AbcDSHkF (ORCPT ); Tue, 19 Apr 2016 03:40:05 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:54844 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752487AbcDSHkC (ORCPT ); Tue, 19 Apr 2016 03:40:02 -0400 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.98.150 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Tue, 19 Apr 2016 16:40:59 +0900 From: Minchan Kim To: Sergey Senozhatsky CC: Andrew Morton , , , , , Vlastimil Babka , Joonsoo Kim , , , , Mel Gorman , Hugh Dickins , Rik van Riel , , Gioh Kim , Sangseok Lee , Chan Gyun Jeong , Al Viro , YiPing Xu Subject: Re: [PATCH v3 06/16] zsmalloc: squeeze inuse into page->mapping Message-ID: <20160419074059.GA18448@bbox> References: <1459321935-3655-1-git-send-email-minchan@kernel.org> <1459321935-3655-7-git-send-email-minchan@kernel.org> <20160417150804.GA575@swordfish> MIME-Version: 1.0 In-Reply-To: <20160417150804.GA575@swordfish> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB08/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/04/19 16:39:58, Serialize by Router on LGEKRMHUB08/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/04/19 16:39:58, Serialize complete at 2016/04/19 16:39:58 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 18, 2016 at 12:08:04AM +0900, Sergey Senozhatsky wrote: > Hello, > > On (03/30/16 16:12), Minchan Kim wrote: > [..] > > +static int get_zspage_inuse(struct page *first_page) > > +{ > > + struct zs_meta *m; > > + > > + VM_BUG_ON_PAGE(!is_first_page(first_page), first_page); > > + > > + m = (struct zs_meta *)&first_page->mapping; > .. > > +static void set_zspage_inuse(struct page *first_page, int val) > > +{ > > + struct zs_meta *m; > > + > > + VM_BUG_ON_PAGE(!is_first_page(first_page), first_page); > > + > > + m = (struct zs_meta *)&first_page->mapping; > .. > > +static void mod_zspage_inuse(struct page *first_page, int val) > > +{ > > + struct zs_meta *m; > > + > > + VM_BUG_ON_PAGE(!is_first_page(first_page), first_page); > > + > > + m = (struct zs_meta *)&first_page->mapping; > .. > > static void get_zspage_mapping(struct page *first_page, > > unsigned int *class_idx, > > enum fullness_group *fullness) > > { > > - unsigned long m; > > + struct zs_meta *m; > > + > > VM_BUG_ON_PAGE(!is_first_page(first_page), first_page); > > + m = (struct zs_meta *)&first_page->mapping; > .. > > static void set_zspage_mapping(struct page *first_page, > > unsigned int class_idx, > > enum fullness_group fullness) > > { > > + struct zs_meta *m; > > + > > VM_BUG_ON_PAGE(!is_first_page(first_page), first_page); > > > > + m = (struct zs_meta *)&first_page->mapping; > > + m->fullness = fullness; > > + m->class = class_idx; > > } > > > a nitpick: this > > struct zs_meta *m; > VM_BUG_ON_PAGE(!is_first_page(first_page), first_page); > m = (struct zs_meta *)&first_page->mapping; > > > seems to be common in several places, may be it makes sense to > factor it out and turn into a macro or a static inline helper? > > other than that, looks good to me Yeb. > > Reviewed-by: Sergey Senozhatsky Thanks for the review!