All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dmitry <dmonakhov@openvz.org>
Cc: Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, hch@infradead.org
Subject: Re: [PATCH 06/19] quota: Remove state_lock
Date: Tue, 23 Nov 2010 11:55:30 +0100	[thread overview]
Message-ID: <20101123105530.GA6113@quack.suse.cz> (raw)
In-Reply-To: <8739qtkptf.fsf@dmon-lap.sw.ru>

On Tue 23-11-10 00:31:56, Dmitry wrote:
> On Mon, 22 Nov 2010 22:12:09 +0100, Jan Kara <jack@suse.cz> wrote:
> > On Thu 11-11-10 15:14:25, Dmitry Monakhov wrote:
> > > The only reader which use state_lock is dqget(), and is it serialized
> > > with quota_disable via SRCU. And state_lock doesn't guaranties anything
> > > for that case. All methods which modify quota flags already protected by
> > > dqonoff_mutex. Get rid of useless state_lock.
> >   dq_state_lock has two properties you miss here:
> > a) It guarantees we read a consistent value from a quota state variable.
>   So what, it is not guaranteed anything. Quota make becomes disabled
>   one nanosecond after check.
>   And with srcu_read_lock we can be guarantee what quota will be available
>   for the caller. Even in case of stale value.
  Well, that's not completely my point. The point is that when we
manipulate flags in an non-atomic way (and using &=, |=, ... is a
non-atomic way), we are not really guaranteed what values a reader will see
while the change happens. So in theory the reader could see that all quotas
are disabled during a transition from usrquota enabled to usrquota+grpquota
enabled (I admit a stupid example but you get the point).

> > b) We read an uptodate value from quota state variable.
>    All callers which modify the state already holds onoff_mutex so
>    implicit mem barriers always guaranteed.
  Yes, so eventually the quota state is guaranteed to have a consistent
value but it says nothing about when and what reader not using onoff_mutex
sees.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2010-11-23 10:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11 12:14 [PATCH 00/19] quota: RFC SMP improvements for generic quota V3 Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 01/19] quota: protect getfmt call with dqonoff_mutex lock Dmitry Monakhov
2010-11-11 13:36   ` Christoph Hellwig
2010-11-22 19:35   ` Jan Kara
2010-12-02 11:40     ` Dmitry
2010-11-11 12:14 ` [PATCH 02/19] kernel: add bl_list Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 03/19] quota: Wrap common expression to helper function Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 04/19] quota: protect dqget() from parallels quotaoff via SRCU Dmitry Monakhov
2010-11-22 21:21   ` Jan Kara
2010-11-22 21:53     ` Dmitry
2010-11-11 12:14 ` [PATCH 05/19] quota: mode quota internals from sb to quota_info Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 06/19] quota: Remove state_lock Dmitry Monakhov
2010-11-22 21:12   ` Jan Kara
2010-11-22 21:31     ` Dmitry
2010-11-23 10:55       ` Jan Kara [this message]
2010-11-23 11:33         ` Jan Kara
2010-11-11 12:14 ` [PATCH 07/19] quota: add quota format lock Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 08/19] quota: make dquot lists per-sb Dmitry Monakhov
2010-11-22 21:37   ` Jan Kara
2010-11-11 12:14 ` [PATCH 09/19] quota: optimize quota_initialize Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 10/19] quota: user per-backet hlist lock for dquot_hash Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 11/19] quota: remove global dq_list_lock Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 12/19] quota: rename dq_lock Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 13/19] quota: make per-sb dq_data_lock Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 14/19] quota: protect dquot mem info with object's lock Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 15/19] quota: drop dq_data_lock where possible Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 16/19] quota: relax dq_data_lock dq_lock locking consistency Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 17/19] quota: Some stylistic cleanup for dquot interface Dmitry Monakhov
2010-11-23 11:37   ` Jan Kara
2010-11-11 12:14 ` [PATCH 18/19] fs: add unlocked helpers Dmitry Monakhov
2010-11-11 12:14 ` [PATCH 19/19] quota: protect i_dquot with i_lock instead of dqptr_sem Dmitry Monakhov
2010-11-19  5:44 ` [PATCH 00/19] quota: RFC SMP improvements for generic quota V3 Dmitry

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=20101123105530.GA6113@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=dmonakhov@openvz.org \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.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 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.