From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752554AbcDSHpX (ORCPT ); Tue, 19 Apr 2016 03:45:23 -0400 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:60334 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751474AbcDSHpV (ORCPT ); Tue, 19 Apr 2016 03:45:21 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.98.76 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:46:15 +0900 From: Minchan Kim To: Sergey Senozhatsky CC: Andrew Morton , , , , , Vlastimil Babka , Joonsoo Kim , , , , Mel Gorman , Hugh Dickins , Sergey Senozhatsky , Rik van Riel , , Gioh Kim , Sangseok Lee , Chan Gyun Jeong , Al Viro , YiPing Xu Subject: Re: [PATCH v3 10/16] zsmalloc: factor page chain functionality out Message-ID: <20160419074615.GC18448@bbox> References: <1459321935-3655-1-git-send-email-minchan@kernel.org> <1459321935-3655-11-git-send-email-minchan@kernel.org> <20160418003305.GA5882@swordfish> MIME-Version: 1.0 In-Reply-To: <20160418003305.GA5882@swordfish> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB05/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/04/19 16:45:17, Serialize by Router on LGEKRMHUB05/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/04/19 16:45:17, Serialize complete at 2016/04/19 16:45:17 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 09:33:05AM +0900, Sergey Senozhatsky wrote: > Hello, > > On (03/30/16 16:12), Minchan Kim wrote: > > @@ -1421,7 +1434,6 @@ static unsigned long obj_malloc(struct size_class *class, > > unsigned long m_offset; > > void *vaddr; > > > > - handle |= OBJ_ALLOCATED_TAG; > > a nitpick, why did you replace this ALLOCATED_TAG assignment > with 2 'handle | OBJ_ALLOCATED_TAG'? I thought this handle variable in here is pure handle but OBJ_ALLOCATED_TAG should live in head(i.e., link->handle), not pure handle, itself. > > -ss > > > obj = get_freeobj(first_page); > > objidx_to_page_and_offset(class, first_page, obj, > > &m_page, &m_offset); > > @@ -1431,10 +1443,10 @@ static unsigned long obj_malloc(struct size_class *class, > > set_freeobj(first_page, link->next >> OBJ_ALLOCATED_TAG); > > if (!class->huge) > > /* record handle in the header of allocated chunk */ > > - link->handle = handle; > > + link->handle = handle | OBJ_ALLOCATED_TAG; > > else > > /* record handle in first_page->private */ > > - set_page_private(first_page, handle); > > + set_page_private(first_page, handle | OBJ_ALLOCATED_TAG); > > kunmap_atomic(vaddr); > > mod_zspage_inuse(first_page, 1); > > zs_stat_inc(class, OBJ_USED, 1);