From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1955890AbdDZGEt (ORCPT ); Wed, 26 Apr 2017 02:04:49 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36075 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1949960AbdDZGEq (ORCPT ); Wed, 26 Apr 2017 02:04:46 -0400 Date: Wed, 26 Apr 2017 15:04:28 +0900 From: Sergey Senozhatsky To: Joonsoo Kim Cc: Sergey Senozhatsky , Andrew Morton , Minchan Kim , Sergey Senozhatsky , linux-kernel@vger.kernel.org, kernel-team@lge.com Subject: Re: [PATCH v4 2/4] zram: implement deduplication in zram Message-ID: <20170426060428.GE673@jagdpanzerIV.localdomain> References: <1493167946-10936-1-git-send-email-iamjoonsoo.kim@lge.com> <1493167946-10936-3-git-send-email-iamjoonsoo.kim@lge.com> <20170426023718.GB673@jagdpanzerIV.localdomain> <20170426055929.GB29773@js1304-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170426055929.GB29773@js1304-desktop> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (04/26/17 14:59), Joonsoo Kim wrote: > On Wed, Apr 26, 2017 at 11:37:18AM +0900, Sergey Senozhatsky wrote: > > On (04/26/17 09:52), js1304@gmail.com wrote: > > [..] > > > struct zram_entry { > > > + struct rb_node rb_node; > > > + u32 len; > > > + u32 checksum; > > > + unsigned long refcount; > > > > use refcount_t? what do you think? > > We don't need atomic operation for refcount but refcount_t does. > API of refcount_t provides additional guarantee that refcount will not > overflow but I'm not sure that this overhead is needed here. refcount_t has some additional debugging features which probably could be helpful one day, but not necessarily needed in current zram_dedup implementation, agree. asked just in case. -ss