From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752496AbcKHBB1 (ORCPT ); Mon, 7 Nov 2016 20:01:27 -0500 Received: from mail-pf0-f181.google.com ([209.85.192.181]:35955 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263AbcKHBB0 (ORCPT ); Mon, 7 Nov 2016 20:01:26 -0500 Date: Tue, 8 Nov 2016 09:33:56 +0900 From: Sergey Senozhatsky To: Cory Pruce Cc: Nitin Gupta , Sergey Senozhatsky , minchan@kernel.org, linux-kernel@vger.kernel.org Subject: Re: Zram/Zmalloc Questions Message-ID: <20161108003356.GA9043@swordfish> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (11/07/16 10:50), Cory Pruce wrote: > I see in zsmalloc.c that zsmalloc is mounted as a pseudo filesystem (block > device I believe). However, there are empty implementations of > zsmalloc_mount and zsmalloc_unmount for when CONFIG_COMPACTION is not set. no. it's because compaction needs an inode via alloc_anon_inode(). look at inode->i_mapping->a_ops. zsmalloc does require or depend on mounting otherwise. [..] > Why is bit_spin_lock being used instead of the general spin_lock? Is there > some performance benefit? no. to save the memory. look at bits squeezing from handle. otherwise, one would have to allocate both handle and a 4-byte spin_lock. I believe bit_spin_lock in general have worse performance than spin_lock, just because spin_lock is not always "a silly busy loop", while bit_spin_lock is. -ss