public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Nitin Gupta <ngupta@vflare.org>,
	Jerome Marchand <jmarchan@redhat.com>
Subject: Re: [PATCH 6/7] zram: remove workqueue for freeing removed pending slot
Date: Tue, 14 Jan 2014 10:09:14 +0300	[thread overview]
Message-ID: <20140114070914.GB2322@swordfish> (raw)
In-Reply-To: <20140113233848.GT1992@bbox>

Hello Minchan,

On (01/14/14 08:38), Minchan Kim wrote:
> Hello Sergey,
> 
> On Mon, Jan 13, 2014 at 10:42:56PM +0300, Sergey Senozhatsky wrote:
> > On (01/13/14 20:19), Minchan Kim wrote:
> > 
> > Hello Minchan,
> > I think we need to down_write init_lock in zram_slot_free_notify(),
> > and thus can avoid locking meta->tb_lock. otherwise, I think,
> 
> zram_slot_free_notify is atomic path so we couldn't hold mutex.
> 
> > there is a chance that zram_slot_free_notify() can race with
> > device reset, e.g.
> > 	
> > 	zram_slot_free_notify()			zram_reset_device()
> > 						down_write(&zram->init_lock);
> > 	meta = zram->meta
> > 						zram_meta_free(zram->meta);
> > 						zram->meta = NULL;
> > 	write_lock(&meta->tb_lock);
> > 	[...]
> > 	write_unlock(&meta->tb_lock);
> > 						[..]
> > 						up_write(&zram->init_lock);
> > 
> 
> Nope. We couldn't reset active device by bdev->bd_holders check
> logic in reset_store.
> 

true. sorry for the noise.

	-ss

  reply	other threads:[~2014-01-14  7:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 11:18 [PATCH 0/7] zram bug fix and lock redesign Minchan Kim
2014-01-13 11:18 ` [PATCH 1/7] zram: fix race between reset and flushing pending work Minchan Kim
2014-01-13 23:55   ` Andrew Morton
2014-01-14  0:15     ` Minchan Kim
2014-01-14  7:14     ` Sergey Senozhatsky
2014-01-13 11:18 ` [PATCH 2/7] zram: delay pending free request in read path Minchan Kim
2014-01-13 11:18 ` [PATCH 3/7] zram: remove unnecessary free Minchan Kim
2014-01-13 11:18 ` [PATCH 4/7] zram: use atomic operation for stat Minchan Kim
2014-01-13 23:58   ` Andrew Morton
2014-01-14  0:19     ` Minchan Kim
2014-01-14  0:23       ` Andrew Morton
2014-01-14  0:38         ` Minchan Kim
2014-01-13 11:19 ` [PATCH 5/7] zram: introduce zram->tb_lock Minchan Kim
2014-01-13 11:19 ` [PATCH 6/7] zram: remove workqueue for freeing removed pending slot Minchan Kim
2014-01-13 19:42   ` Sergey Senozhatsky
2014-01-13 23:38     ` Minchan Kim
2014-01-14  7:09       ` Sergey Senozhatsky [this message]
2014-01-13 11:19 ` [PATCH 7/7] zram: remove unnecessary lock Minchan Kim
2014-01-14  9:29   ` Jerome Marchand
2014-01-15  1:34     ` Minchan Kim

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=20140114070914.GB2322@swordfish \
    --to=sergey.senozhatsky@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jmarchan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    /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