linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Byungchul Park <byungchul.park@lge.com>
Cc: peterz@infradead.org, mingo@kernel.org,
	linux-kernel@vger.kernel.org, npiggin@suse.de,
	sergey.senozhatsky@gmail.com, gregkh@linuxfoundation.org,
	minchan@kernel.org, sergey.senozhatsky.work@gmail.com
Subject: Re: [PATCH 3/5] lockdep: Apply bit_spin_lock lockdep to zram
Date: Tue, 21 Jun 2016 00:36:19 +0900	[thread overview]
Message-ID: <20160620153619.GA649@swordfish> (raw)
In-Reply-To: <1466398515-1005-4-git-send-email-byungchul.park@lge.com>

On (06/20/16 13:55), Byungchul Park wrote:
> In order to use lockdep-enabled bit_spin_lock, we have to call
> bit_spin_init() when a instance including the bit used as lock
> creates, and bit_spin_free() when the instance including the bit
> destroys.
> 
> The zram is one of bit_spin_lock users. And this patch adds
> bit_spin_init() and bit_spin_free() properly to apply the lock
> correctness validator to bit_spin_lock the rzam is using.

Hello,

just for information

there was a proposal from -rt people to use normal spinlocks
for table's entries, rather that bitspinlock. I had a patch
some time ago, will obtain some performance data and post
RFC [may be tomorrow].

	-ss

> Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> ---
>  drivers/block/zram/zram_drv.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 370c2f7..2bc3bde 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -495,6 +495,11 @@ static void zram_meta_free(struct zram_meta *meta, u64 disksize)
>  	}
>  
>  	zs_destroy_pool(meta->mem_pool);
> +
> +	for (index = 0; index < num_pages; index++) {
> +		bit_spin_free(ZRAM_ACCESS, &meta->table[index].value);
> +	}
> +
>  	vfree(meta->table);
>  	kfree(meta);
>  }
> @@ -503,6 +508,7 @@ static struct zram_meta *zram_meta_alloc(char *pool_name, u64 disksize)
>  {
>  	size_t num_pages;
>  	struct zram_meta *meta = kmalloc(sizeof(*meta), GFP_KERNEL);
> +	int index;
>  
>  	if (!meta)
>  		return NULL;
> @@ -520,6 +526,10 @@ static struct zram_meta *zram_meta_alloc(char *pool_name, u64 disksize)
>  		goto out_error;
>  	}
>  
> +	for (index = 0; index < num_pages; index++) {
> +		bit_spin_init(ZRAM_ACCESS, &meta->table[index].value);
> +	}
> +
>  	return meta;
>  
>  out_error:
> -- 
> 1.9.1
> 

  reply	other threads:[~2016-06-20 15:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20  4:55 [PATCH 0/5] Implement bitlock map allocator Byungchul Park
2016-06-20  4:55 ` [PATCH 1/5] lockdep: " Byungchul Park
2016-06-30 12:59   ` Peter Zijlstra
2016-07-01  0:24     ` Byungchul Park
2016-07-01  7:53       ` Peter Zijlstra
2016-07-04  7:29         ` Byungchul Park
2016-07-07 10:22           ` Byungchul Park
2016-07-13 20:17           ` Peter Zijlstra
2016-07-18  1:46             ` Byungchul Park
2016-06-20  4:55 ` [PATCH 2/5] lockdep: Apply bitlock to bit_spin_lock Byungchul Park
2016-06-20  4:55 ` [PATCH 3/5] lockdep: Apply bit_spin_lock lockdep to zram Byungchul Park
2016-06-20 15:36   ` Sergey Senozhatsky [this message]
2016-06-21  1:05     ` Byungchul Park
2016-06-20  4:55 ` [PATCH 4/5] fs/buffer.c: Remove trailing white space Byungchul Park
2016-06-20  4:55 ` [PATCH 5/5] lockdep: Apply bit_spin_lock lockdep to BH_Uptodate_Lock Byungchul Park
2016-06-29 12:45 ` [PATCH 0/5] Implement bitlock map allocator Byungchul Park

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=20160620153619.GA649@swordfish \
    --to=sergey.senozhatsky@gmail.com \
    --cc=byungchul.park@lge.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=mingo@kernel.org \
    --cc=npiggin@suse.de \
    --cc=peterz@infradead.org \
    --cc=sergey.senozhatsky.work@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).