public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Perepechko <anserper@yandex.ru>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: quota: dqio_mutex design
Date: Fri, 10 Mar 2017 01:29:22 +0300	[thread overview]
Message-ID: <2044807.uqPyBdneMn@panda> (raw)
In-Reply-To: <20170303100842.GB4373@quack2.suse.cz>

Hello!

Jan, do you think it makes sense, as an improvement
until the code restructuring, to exit immediately from
ext4_mark_dquot_dirty() if dquot_mark_dquot_dirty()
returns 1?

It seems that in this case we are guaranteed that some
thread is somewhere in the middle of mark_dquot_dirty()
and clear_dquot_dirty(), so it will update the quota file
buffer with the latest dquot data.

That would improve a single user/group scenario like:
thread 1) processing dquot_commit()
thread 2) dirtied dquot and is waiting for dqio_mutex
thread 3, 4, 5 ...) dirtied dquot and are waiting for dqio_mutex

If we exit immediately on dquot dirtying, threads 3, 4, 5, ...
can let thread 2 update the buffer data and themselves
may not block on the mutex.

Thank you,
Andrew


> Hello!
> 
> On Thu 02-02-17 15:23:44, Andrew Perepechko wrote:
> > We have a heavy metadata related workload (ext4, quota journalling)
> > and profiling shows that there's significant dqio_mutex contention.
> > 
> > From the quota code, it looks like every time dqio_mutex is taken
> > it protects access to only one quota file.
> > 
> > Is it possible to split dqio_mutex for each of MAXQUOTAS so that
> > e.g. 2 parallel dquot_commit()'s can be running for user and group
> > quota update? Am I missing any dqio_mutex function that requires
> > dqio_mutex to be monolithic?
> 
> So we can certainly make dqio_mutex less heavy. Making it per-quota-type
> would OK but I suspect it will not bring a big benefit. What would likely
> be more noticeable is if we avoided dqio_mutex for updates of quota
> information - that should not be that hard to do since we update that
> in-place and so don't really need the serialization for anything
> substantial. However we will need some restructuring of the code to make
> such locking scheme possible in a clean way...
> 
> 								Honza

  reply	other threads:[~2017-03-09 22:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 12:23 quota: dqio_mutex design Andrew Perepechko
2017-03-03 10:08 ` Jan Kara
2017-03-09 22:29   ` Andrew Perepechko [this message]
2017-03-13  8:44     ` Jan Kara
2017-06-21 10:52   ` Jan Kara
     [not found]     ` <4181747.CBilgxvOab@panda>
2017-08-01 13:02       ` Jan Kara
2017-08-02 16:25         ` Jan Kara
2017-08-02 17:52           ` Andrew Perepechko
2017-08-03 11:09             ` Jan Kara
2017-08-03 11:31             ` Wang Shilong
2017-08-03 12:24               ` Andrew Perepechko
2017-08-03 13:19                 ` Wang Shilong
2017-08-03 13:41                   ` Andrew Perepechko
2017-08-03 13:55                     ` Andrew Perepechko
2017-08-03 14:23                       ` Jan Kara
2017-08-03 14:36               ` Jan Kara
2017-08-03 14:39                 ` Wang Shilong
2017-08-08 16:06                   ` Jan Kara
2017-08-14  3:24                     ` Wang Shilong
2017-08-14  3:28                       ` Wang Shilong
2017-08-14  3:53                       ` Wang Shilong
2017-08-14  8:22                         ` Jan Kara

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=2044807.uqPyBdneMn@panda \
    --to=anserper@yandex.ru \
    --cc=jack@suse.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox