Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1517269

Re: [PATCH/RFC v2] z3fold: use per-page read/write lock

From Andi Kleen <andi@firstfloor.org>
Newsgroups linux.kernel
Subject Re: [PATCH/RFC v2] z3fold: use per-page read/write lock
Date 2016-11-08 16:10 +0100
Message-ID <sBgc9-2wv-3@gated-at.bofh.it> (permalink)
References <sBeal-12r-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 08, 2016 at 01:58:34PM +0100, Vitaly Wool wrote:
> Most of z3fold operations are in-page, such as modifying z3fold
> page header or moving z3fold objects within a page. Taking
> per-pool spinlock to protect per-page objects is therefore
> suboptimal, and the idea of having a per-page spinlock (or rwlock)
> has been around for some time. However, adding one directly to the
> z3fold header makes the latter quite big on some systems so that
> it won't fit in a signle chunk.
> 
> This patch implements spinlock-based per-page locking mechanism
> which is lightweight enough to fit into the z3fold header.
> 
> Changes from v1 [1]:
> - custom locking mechanism changed to spinlocks
> - no read/write locks, just per-page spinlock

Looks good.

BTW the spinlock could still grow when debug options  like
lockdep are enabled. So something would still need to be done about
that BUILD_BUG_ON(). Otherwise would need to force a raw spin lock.

-Andi

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH/RFC v2] z3fold: use per-page read/write lock Vitaly Wool <vitalywool@gmail.com> - 2016-11-08 14:00 +0100
  Re: [PATCH/RFC v2] z3fold: use per-page read/write lock Andi Kleen <andi@firstfloor.org> - 2016-11-08 16:10 +0100

csiph-web