linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Refactor snapshot vs nocow writers locking
@ 2019-06-06 13:52 Nikolay Borisov
  2019-06-06 13:52 ` [PATCH 1/2] btrfs: Implement DRW lock Nikolay Borisov
  2019-06-06 13:52 ` [PATCH 2/2] btrfs: convert snapshot/nocow exlcusion to drw lock Nikolay Borisov
  0 siblings, 2 replies; 19+ messages in thread
From: Nikolay Borisov @ 2019-06-06 13:52 UTC (permalink / raw)
  To: linux-btrfs; +Cc: linux-kernel, andrea.parri, peterz, paulmck, Nikolay Borisov

This patchset first factors out the open code which essentially implements a 
lock that allows to have either multiple reader or multiple writers but not 
both. Then patch 2 just converts the code to using the newly introduced lock. 

The individual patch descriptions contain more information about the technical 
details and invariants that the lock provide. 

I have also CC'ed a copule of the maintainer of linux memory model since my 
patches just factor out the code and I would really like someone proficient 
enough in the usage/semantics of memory barries to review it as well. 

Nikolay Borisov (2):
  btrfs: Implement DRW lock
  btrfs: convert snapshot/nocow exlcusion to drw lock

 fs/btrfs/Makefile      |  2 +-
 fs/btrfs/ctree.h       | 10 ++----
 fs/btrfs/disk-io.c     | 39 ++---------------------
 fs/btrfs/drw_lock.c    | 71 ++++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/drw_lock.h    | 23 ++++++++++++++
 fs/btrfs/extent-tree.c | 35 ---------------------
 fs/btrfs/file.c        | 12 +++----
 fs/btrfs/inode.c       |  8 ++---
 fs/btrfs/ioctl.c       | 10 ++----
 9 files changed, 114 insertions(+), 96 deletions(-)
 create mode 100644 fs/btrfs/drw_lock.c
 create mode 100644 fs/btrfs/drw_lock.h

-- 
2.17.1


^ permalink raw reply	[flat|nested] 19+ messages in thread
* [PATCH 0/2] Refactor snapshot vs nocow writers locking
@ 2020-01-30 12:59 Nikolay Borisov
  2020-01-30 12:59 ` [PATCH 1/2] btrfs: Implement DRW lock Nikolay Borisov
  0 siblings, 1 reply; 19+ messages in thread
From: Nikolay Borisov @ 2020-01-30 12:59 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

This patchset first factors out the open code which essentially implements a 
lock that allows to have either multiple reader or multiple writers but not 
both. Then patch 2 just converts the code to using the newly introduced lock. 

The individual patch descriptions contain more information about the technical 
details and invariants that the lock provide. 

I have also CC'ed a copule of the maintainer of linux memory model since my 
patches just factor out the code and I would really like someone proficient 
enough in the usage/semantics of memory barries to review it as well. 

Nikolay Borisov (2):
  btrfs: Implement DRW lock
  btrfs: convert snapshot/nocow exlcusion to drw lock

 fs/btrfs/Makefile      |  2 +-
 fs/btrfs/ctree.h       | 10 ++----
 fs/btrfs/disk-io.c     | 39 ++---------------------
 fs/btrfs/drw_lock.c    | 71 ++++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/drw_lock.h    | 23 ++++++++++++++
 fs/btrfs/extent-tree.c | 35 ---------------------
 fs/btrfs/file.c        | 12 +++----
 fs/btrfs/inode.c       |  8 ++---
 fs/btrfs/ioctl.c       | 10 ++----
 9 files changed, 114 insertions(+), 96 deletions(-)
 create mode 100644 fs/btrfs/drw_lock.c
 create mode 100644 fs/btrfs/drw_lock.h

-- 
2.17.1


^ permalink raw reply	[flat|nested] 19+ messages in thread
* [PATCH v3 0/2] Refactor snapshot vs nocow writers locking
@ 2020-02-24 15:26 Nikolay Borisov
  2020-02-24 15:32 ` [PATCH 1/2] btrfs: Implement DRW lock Nikolay Borisov
  0 siblings, 1 reply; 19+ messages in thread
From: Nikolay Borisov @ 2020-02-24 15:26 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

Here is v3 of the DRW locking patches.

Main changes in this verison:
 * Removed EXPORT_SYMBOL for function since I do not intend to submit the locktorture
 patch
 * Added high-level comment as per David's request.

V2:
* Fixed all checkpatch warnings (Andrea Parri)
* Properly call write_unlock in btrfs_drw_try_write_lock (Filipe Manana)
* Comment fix.
* Stress tested it via locktorture. Survived for 8 straight days on a 4 socket
48 thread machine.

Nikolay Borisov (2):
  btrfs: convert snapshot/nocow exlcusion to drw lock
  btrfs: Hook btrfs' DRW lock to locktorture infrastructure

 fs/btrfs/ctree.h             |  9 +----
 fs/btrfs/disk-io.c           | 46 ++++++---------------
 fs/btrfs/extent-tree.c       | 44 ---------------------
 fs/btrfs/file.c              | 11 +++---
 fs/btrfs/inode.c             |  8 ++--
 fs/btrfs/ioctl.c             | 10 ++---
 fs/btrfs/locking.c           |  5 +++
 fs/btrfs/locking.h           |  1 +
 kernel/locking/locktorture.c | 77 +++++++++++++++++++++++++++++++++++-
 9 files changed, 107 insertions(+), 104 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-02-24 15:32 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-06 13:52 [PATCH 0/2] Refactor snapshot vs nocow writers locking Nikolay Borisov
2019-06-06 13:52 ` [PATCH 1/2] btrfs: Implement DRW lock Nikolay Borisov
2019-06-06 15:15   ` Filipe Manana
2019-06-07 10:52   ` Paul E. McKenney
2019-06-07 11:59     ` Nikolay Borisov
2019-06-08 15:13       ` Paul E. McKenney
2019-06-08 15:44         ` Nikolay Borisov
2019-06-08 16:06           ` Paul E. McKenney
2019-06-08 16:21             ` Nikolay Borisov
2019-06-08 16:39               ` Paul E. McKenney
2019-06-08 16:33   ` Andrea Parri
2019-06-12 14:05   ` David Sterba
2019-06-06 13:52 ` [PATCH 2/2] btrfs: convert snapshot/nocow exlcusion to drw lock Nikolay Borisov
2019-06-06 15:21   ` Filipe Manana
  -- strict thread matches above, loose matches on Subject: below --
2020-01-30 12:59 [PATCH 0/2] Refactor snapshot vs nocow writers locking Nikolay Borisov
2020-01-30 12:59 ` [PATCH 1/2] btrfs: Implement DRW lock Nikolay Borisov
2020-01-30 13:41   ` Christoph Hellwig
2020-01-30 13:42     ` Nikolay Borisov
2020-01-30 13:43       ` Christoph Hellwig
2020-02-24 15:26 [PATCH v3 0/2] Refactor snapshot vs nocow writers locking Nikolay Borisov
2020-02-24 15:32 ` [PATCH 1/2] btrfs: Implement DRW lock Nikolay Borisov

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).