All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Stefan (metze) Metzmacher" <metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
To: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
	matthew-Ztpu424NOJ8@public.gmane.org,
	bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cluster-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	sage-4GqslpFJ+cxBDgjK7y7TUQ@public.gmane.org,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org,
	Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-afs-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ceph-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	swhiteho-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH v1 11/11] locks: give the blocked_hash its own spinlock
Date: Tue, 04 Jun 2013 16:19:53 +0200	[thread overview]
Message-ID: <51ADF789.70906@samba.org> (raw)
In-Reply-To: <1370056054-25449-12-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1968 bytes --]

Hi Jeff,

> There's no reason we have to protect the blocked_hash and file_lock_list
> with the same spinlock. With the tests I have, breaking it in two gives
> a barely measurable performance benefit, but it seems reasonable to make
> this locking as granular as possible.

as file_lock_{list,lock} is only used for debugging (/proc/locks) after this
change, I guess it would be possible to use RCU instead of a spinlock.

@others: this was the related discussion on IRC
(http://irclog.samba.org/) about this:

16:02 < metze> jlayton: do you have time to discuss your file_lock_lock
changes?
16:02 < jlayton> metze: sure, what's up?
16:03 < jlayton> metze: note that it won't help vl's thundering herd
problems...
16:03 < metze> is it correct that after your last patch file_lock_lock
is only used for /proc/locks?
16:03 < jlayton> well, it's only used to protect the list that is used
for /proc/locks
16:04 < jlayton> it still gets taken whenever a lock is acquired or
released in order to manipulate that list
16:04 < metze> would it be a good idea to use rcu instead of a spin lock?
16:04 < jlayton> I tried using RCU, but it turned out to slow everything
down
16:04 < jlayton> this is not a read-mostly workload unfortunately
16:04 < jlayton> so doing it with mutual exclusion turns out to be faster
16:04 < metze> ok
16:05 < jlayton> I might play around with it again sometime, but I don't
think it really helps. What we need to ensure is
                 that we optimize the code that manipulates that list,
and RCU list manipulations have larger overhead
16:06 < jlayton> metze: that's a good question though so if you want to
ask it on the list, please do
16:06 < jlayton> others will probably be wondering the same thing
16:08 < metze> maybe it's worth a comment in commit message and the code
16:08 < metze> btw, why don't you remove the ' /* Protects the
file_lock_list and the blocked_hash */' comment?

metze


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Stefan (metze) Metzmacher <metze@samba.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH v1 11/11] locks: give the blocked_hash its own spinlock
Date: Tue, 04 Jun 2013 16:19:53 +0200	[thread overview]
Message-ID: <51ADF789.70906@samba.org> (raw)
In-Reply-To: <1370056054-25449-12-git-send-email-jlayton@redhat.com>

Hi Jeff,

> There's no reason we have to protect the blocked_hash and file_lock_list
> with the same spinlock. With the tests I have, breaking it in two gives
> a barely measurable performance benefit, but it seems reasonable to make
> this locking as granular as possible.

as file_lock_{list,lock} is only used for debugging (/proc/locks) after this
change, I guess it would be possible to use RCU instead of a spinlock.

@others: this was the related discussion on IRC
(http://irclog.samba.org/) about this:

16:02 < metze> jlayton: do you have time to discuss your file_lock_lock
changes?
16:02 < jlayton> metze: sure, what's up?
16:03 < jlayton> metze: note that it won't help vl's thundering herd
problems...
16:03 < metze> is it correct that after your last patch file_lock_lock
is only used for /proc/locks?
16:03 < jlayton> well, it's only used to protect the list that is used
for /proc/locks
16:04 < jlayton> it still gets taken whenever a lock is acquired or
released in order to manipulate that list
16:04 < metze> would it be a good idea to use rcu instead of a spin lock?
16:04 < jlayton> I tried using RCU, but it turned out to slow everything
down
16:04 < jlayton> this is not a read-mostly workload unfortunately
16:04 < jlayton> so doing it with mutual exclusion turns out to be faster
16:04 < metze> ok
16:05 < jlayton> I might play around with it again sometime, but I don't
think it really helps. What we need to ensure is
                 that we optimize the code that manipulates that list,
and RCU list manipulations have larger overhead
16:06 < jlayton> metze: that's a good question though so if you want to
ask it on the list, please do
16:06 < jlayton> others will probably be wondering the same thing
16:08 < metze> maybe it's worth a comment in commit message and the code
16:08 < metze> btw, why don't you remove the ' /* Protects the
file_lock_list and the blocked_hash */' comment?

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20130604/5ec71c69/attachment.sig>

WARNING: multiple messages have this Message-ID (diff)
From: "Stefan (metze) Metzmacher" <metze@samba.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: viro@zeniv.linux.org.uk, matthew@wil.cx, bfields@fieldses.org,
	linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org,
	cluster-devel@redhat.com, sage@inktank.com,
	samba-technical@lists.samba.org, Trond.Myklebust@netapp.com,
	linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org,
	dhowells@redhat.com, smfrench@gmail.com,
	linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org,
	akpm@linux-foundation.org, swhiteho@redhat.com
Subject: Re: [PATCH v1 11/11] locks: give the blocked_hash its own spinlock
Date: Tue, 04 Jun 2013 16:19:53 +0200	[thread overview]
Message-ID: <51ADF789.70906@samba.org> (raw)
In-Reply-To: <1370056054-25449-12-git-send-email-jlayton@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1968 bytes --]

Hi Jeff,

> There's no reason we have to protect the blocked_hash and file_lock_list
> with the same spinlock. With the tests I have, breaking it in two gives
> a barely measurable performance benefit, but it seems reasonable to make
> this locking as granular as possible.

as file_lock_{list,lock} is only used for debugging (/proc/locks) after this
change, I guess it would be possible to use RCU instead of a spinlock.

@others: this was the related discussion on IRC
(http://irclog.samba.org/) about this:

16:02 < metze> jlayton: do you have time to discuss your file_lock_lock
changes?
16:02 < jlayton> metze: sure, what's up?
16:03 < jlayton> metze: note that it won't help vl's thundering herd
problems...
16:03 < metze> is it correct that after your last patch file_lock_lock
is only used for /proc/locks?
16:03 < jlayton> well, it's only used to protect the list that is used
for /proc/locks
16:04 < jlayton> it still gets taken whenever a lock is acquired or
released in order to manipulate that list
16:04 < metze> would it be a good idea to use rcu instead of a spin lock?
16:04 < jlayton> I tried using RCU, but it turned out to slow everything
down
16:04 < jlayton> this is not a read-mostly workload unfortunately
16:04 < jlayton> so doing it with mutual exclusion turns out to be faster
16:04 < metze> ok
16:05 < jlayton> I might play around with it again sometime, but I don't
think it really helps. What we need to ensure is
                 that we optimize the code that manipulates that list,
and RCU list manipulations have larger overhead
16:06 < jlayton> metze: that's a good question though so if you want to
ask it on the list, please do
16:06 < jlayton> others will probably be wondering the same thing
16:08 < metze> maybe it's worth a comment in commit message and the code
16:08 < metze> btw, why don't you remove the ' /* Protects the
file_lock_list and the blocked_hash */' comment?

metze


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

  parent reply	other threads:[~2013-06-04 14:19 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-01  3:07 [PATCH v1 00/11] locks: scalability improvements for file locking Jeff Layton
2013-06-01  3:07 ` Jeff Layton
2013-06-01  3:07 ` [Cluster-devel] " Jeff Layton
2013-06-01  3:07 ` [PATCH v1 01/11] cifs: use posix_unblock_lock instead of locks_delete_block Jeff Layton
2013-06-01  3:07   ` [Cluster-devel] " Jeff Layton
     [not found]   ` <1370056054-25449-2-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-03 21:53     ` J. Bruce Fields
2013-06-03 21:53       ` J. Bruce Fields
2013-06-03 21:53       ` [Cluster-devel] " J. Bruce Fields
2013-06-01  3:07 ` [PATCH v1 02/11] locks: make generic_add_lease and generic_delete_lease static Jeff Layton
2013-06-01  3:07   ` [Cluster-devel] " Jeff Layton
     [not found]   ` <1370056054-25449-3-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-03 21:53     ` J. Bruce Fields
2013-06-03 21:53       ` J. Bruce Fields
2013-06-03 21:53       ` [Cluster-devel] " J. Bruce Fields
2013-06-01  3:07 ` [PATCH v1 04/11] locks: make "added" in __posix_lock_file a bool Jeff Layton
2013-06-01  3:07   ` [Cluster-devel] " Jeff Layton
2013-06-04 20:17   ` J. Bruce Fields
2013-06-04 20:17     ` [Cluster-devel] " J. Bruce Fields
2013-06-01  3:07 ` [PATCH v1 05/11] locks: encapsulate the fl_link list handling Jeff Layton
2013-06-01  3:07   ` [Cluster-devel] " Jeff Layton
2013-06-04 20:17   ` J. Bruce Fields
2013-06-04 20:17     ` [Cluster-devel] " J. Bruce Fields
2013-06-01  3:07 ` [PATCH v1 07/11] locks: only pull entries off of blocked_list when they are really unblocked Jeff Layton
2013-06-01  3:07   ` Jeff Layton
2013-06-01  3:07   ` [Cluster-devel] " Jeff Layton
     [not found]   ` <1370056054-25449-8-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-04 21:58     ` J. Bruce Fields
2013-06-04 21:58       ` J. Bruce Fields
2013-06-04 21:58       ` [Cluster-devel] " J. Bruce Fields
     [not found]       ` <20130604215839.GD15594-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2013-06-05 11:38         ` Jeff Layton
2013-06-05 11:38           ` Jeff Layton
2013-06-05 11:38           ` [Cluster-devel] " Jeff Layton
     [not found]           ` <20130605073822.4d67c57c-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2013-06-05 12:24             ` J. Bruce Fields
2013-06-05 12:24               ` J. Bruce Fields
2013-06-05 12:24               ` [Cluster-devel] " J. Bruce Fields
2013-06-05 12:38               ` Jeff Layton
2013-06-05 12:38                 ` [Cluster-devel] " Jeff Layton
     [not found]                 ` <20130605083859.72c855cd-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2013-06-05 12:59                   ` J. Bruce Fields
2013-06-05 12:59                     ` J. Bruce Fields
2013-06-05 12:59                     ` [Cluster-devel] " J. Bruce Fields
2013-06-01  3:07 ` [PATCH v1 08/11] locks: convert fl_link to a hlist_node Jeff Layton
2013-06-01  3:07   ` [Cluster-devel] " Jeff Layton
     [not found]   ` <1370056054-25449-9-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-04 21:59     ` J. Bruce Fields
2013-06-04 21:59       ` J. Bruce Fields
2013-06-04 21:59       ` [Cluster-devel] " J. Bruce Fields
2013-06-05 11:43       ` Jeff Layton
2013-06-05 11:43         ` [Cluster-devel] " Jeff Layton
     [not found]         ` <20130605074309.051ff75f-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2013-06-05 12:46           ` J. Bruce Fields
2013-06-05 12:46             ` J. Bruce Fields
2013-06-05 12:46             ` [Cluster-devel] " J. Bruce Fields
     [not found] ` <1370056054-25449-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-01  3:07   ` [PATCH v1 03/11] locks: comment cleanups and clarifications Jeff Layton
2013-06-01  3:07     ` Jeff Layton
2013-06-01  3:07     ` [Cluster-devel] " Jeff Layton
     [not found]     ` <1370056054-25449-4-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-03 22:00       ` J. Bruce Fields
2013-06-03 22:00         ` J. Bruce Fields
2013-06-03 22:00         ` [Cluster-devel] " J. Bruce Fields
     [not found]         ` <20130603220024.GF2109-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2013-06-04 11:09           ` Jeff Layton
2013-06-04 11:09             ` Jeff Layton
2013-06-04 11:09             ` [Cluster-devel] " Jeff Layton
2013-06-01  3:07   ` [PATCH v1 06/11] locks: convert to i_lock to protect i_flock list Jeff Layton
2013-06-01  3:07     ` Jeff Layton
2013-06-01  3:07     ` [Cluster-devel] " Jeff Layton
2013-06-04 21:22     ` J. Bruce Fields
2013-06-04 21:22       ` [Cluster-devel] " J. Bruce Fields
     [not found]       ` <20130604212208.GC15594-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2013-06-05  0:46         ` Jeff Layton
2013-06-05  0:46           ` Jeff Layton
2013-06-05  0:46           ` [Cluster-devel] " Jeff Layton
2013-06-01  3:07   ` [PATCH v1 09/11] locks: turn the blocked_list into a hashtable Jeff Layton
2013-06-01  3:07     ` Jeff Layton
2013-06-01  3:07     ` [Cluster-devel] " Jeff Layton
2013-06-01  3:07   ` [PATCH v1 10/11] locks: add a new "lm_owner_key" lock operation Jeff Layton
2013-06-01  3:07     ` Jeff Layton
2013-06-01  3:07     ` [Cluster-devel] " Jeff Layton
2013-06-01  3:07   ` [PATCH v1 11/11] locks: give the blocked_hash its own spinlock Jeff Layton
2013-06-01  3:07     ` Jeff Layton
2013-06-01  3:07     ` [Cluster-devel] " Jeff Layton
     [not found]     ` <1370056054-25449-12-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-04 14:19       ` Stefan (metze) Metzmacher [this message]
2013-06-04 14:19         ` Stefan (metze) Metzmacher
2013-06-04 14:19         ` [Cluster-devel] " Stefan Metzmacher
2013-06-04 14:39         ` Jeff Layton
2013-06-04 14:39           ` [Cluster-devel] " Jeff Layton
2013-06-04 14:46         ` Christoph Hellwig
2013-06-04 14:46           ` [Cluster-devel] " Christoph Hellwig
     [not found]           ` <20130604144640.GA7730-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2013-06-04 14:53             ` J. Bruce Fields
2013-06-04 14:53               ` J. Bruce Fields
2013-06-04 14:53               ` [Cluster-devel] " J. Bruce Fields
2013-06-04 15:15               ` Jeff Layton
2013-06-04 15:15                 ` [Cluster-devel] " Jeff Layton
2013-06-04 14:56             ` Jeff Layton
2013-06-04 14:56               ` Jeff Layton
2013-06-04 14:56               ` [Cluster-devel] " Jeff Layton
2013-06-03 19:04   ` [PATCH v1 00/11] locks: scalability improvements for file locking Davidlohr Bueso
2013-06-03 19:04     ` Davidlohr Bueso
2013-06-03 19:04     ` [Cluster-devel] " Davidlohr Bueso
2013-06-03 21:31   ` J. Bruce Fields
2013-06-03 21:31     ` J. Bruce Fields
2013-06-03 21:31     ` [Cluster-devel] " J. Bruce Fields
2013-06-04 10:54     ` Jeff Layton
2013-06-04 10:54       ` [Cluster-devel] " Jeff Layton
     [not found]       ` <20130604065417.46080a57-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-06-04 11:56         ` Jim Rees
2013-06-04 11:56           ` Jim Rees
2013-06-04 11:56           ` [Cluster-devel] " Jim Rees
     [not found]           ` <20130604115644.GA4180-63aXycvo3TyHXe+LvDLADg@public.gmane.org>
2013-06-04 12:15             ` Jeff Layton
2013-06-04 12:15               ` Jeff Layton
2013-06-04 12:15               ` [Cluster-devel] " Jeff Layton

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=51ADF789.70906@samba.org \
    --to=metze-eunubhrolfbytjvyw6ydsg@public.gmane.org \
    --cc=Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org \
    --cc=ceph-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=cluster-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-afs-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matthew-Ztpu424NOJ8@public.gmane.org \
    --cc=sage-4GqslpFJ+cxBDgjK7y7TUQ@public.gmane.org \
    --cc=samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=swhiteho-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.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.