All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Cory Pruce <corypruce@gmail.com>
Cc: Nitin Gupta <nitingupta910@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	minchan@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Zram/Zmalloc Questions
Date: Tue, 8 Nov 2016 09:33:56 +0900	[thread overview]
Message-ID: <20161108003356.GA9043@swordfish> (raw)
In-Reply-To: <CANOqyr7Lwgyax9F4Jogi=ecqKMbCTUQ5LmuXVk5LfTk0ksv4rg@mail.gmail.com>

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

       reply	other threads:[~2016-11-08  1:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CANOqyr7Lwgyax9F4Jogi=ecqKMbCTUQ5LmuXVk5LfTk0ksv4rg@mail.gmail.com>
2016-11-08  0:33 ` Sergey Senozhatsky [this message]
     [not found]   ` <CANOqyr4GuFs+Ayt7UFUKnssTFTP=NTRcP-p12xjPpvqxV4+ZYg@mail.gmail.com>
2016-11-08  3:46     ` Zram/Zmalloc Questions Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161108003356.GA9043@swordfish \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=corypruce@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=nitingupta910@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.