linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC -next v2 00/41] md/md-bitmap: introduce bitmap_operations and make structure internel
@ 2024-08-14  7:10 Yu Kuai
  2024-08-14  7:10 ` [PATCH RFC -next v2 01/41] md/raid1: use md_bitmap_wait_behind_writes() in raid1_read_request() Yu Kuai
                   ` (41 more replies)
  0 siblings, 42 replies; 47+ messages in thread
From: Yu Kuai @ 2024-08-14  7:10 UTC (permalink / raw)
  To: mariusz.tkaczyk, hch, song
  Cc: linux-kernel, linux-raid, yukuai3, yukuai1, yi.zhang, yangerkun

From: Yu Kuai <yukuai3@huawei.com>

Changes in v2:
 - add patch 1-8 to prevent dereference bitmap directly, and the last
 patch to make bitmap structure internel.
 - use plain function alls "bitmap_ops->xxx()" directly;

The background is that currently bitmap is using a global spin_lock,
cauing lock contention and huge IO performance degration for all raid
levels.

However, it's impossible to implement a new lock free bitmap with
current situation that md-bitmap exposes the internal implementation
with lots of exported apis. Hence bitmap_operations is invented, to
describe bitmap core implementation, and a new bitmap can be introduced
with a new bitmap_operations, we only need to switch to the new one
during initialization.

And with this we can build bitmap as kernel module, but that's not
our concern for now.

Noted I just compile this patchset, not tested yet.

Yu Kuai (41):
  md/raid1: use md_bitmap_wait_behind_writes() in raid1_read_request()
  md/md-bitmap: replace md_bitmap_status() with a new helper
    md_bitmap_get_stats()
  md: use new helper md_bitmap_get_stats() in update_array_info()
  md/md-bitmap: add 'events_cleared' into struct md_bitmap_stats
  md/md-bitmap: add 'sync_size' into struct md_bitmap_stats
  md/md-bitmap: add 'file_pages' into struct md_bitmap_stats
  md/md-bitmap: add 'behind_writes' and 'behind_wait' into struct
    md_bitmap_stats
  md/md-cluster: use helper md_bitmap_get_stats() to get pages in
    resize_bitmaps()
  md/md-bitmap: add a new helper md_bitmap_set_pages()
  md/md-bitmap: introduce struct bitmap_operations
  md/md-bitmap: simplify md_bitmap_create() + md_bitmap_load()
  md/md-bitmap: merge md_bitmap_create() into bitmap_operations
  md/md-bitmap: merge md_bitmap_load() into bitmap_operations
  md/md-bitmap: merge md_bitmap_destroy() into bitmap_operations
  md/md-bitmap: merge md_bitmap_flush() into bitmap_operations
  md/md-bitmap: make md_bitmap_print_sb() internal
  md/md-bitmap: merge md_bitmap_update_sb() into bitmap_operations
  md/md-bitmap: merge md_bitmap_status() into bitmap_operations
  md/md-bitmap: remove md_bitmap_setallbits()
  md/md-bitmap: merge bitmap_write_all() into bitmap_operations
  md/md-bitmap: merge md_bitmap_dirty_bits() into bitmap_operations
  md/md-bitmap: merge md_bitmap_startwrite() into bitmap_operations
  md/md-bitmap: merge md_bitmap_endwrite() into bitmap_operations
  md/md-bitmap: merge md_bitmap_start_sync() into bitmap_operations
  md/md-bitmap: remove the parameter 'aborted' for md_bitmap_end_sync()
  md/md-bitmap: merge md_bitmap_end_sync() into bitmap_operations
  md/md-bitmap: merge md_bitmap_close_sync() into bitmap_operations
  md/md-bitmap: mrege md_bitmap_cond_end_sync() into bitmap_operations
  md/md-bitmap: merge md_bitmap_sync_with_cluster() into
    bitmap_operations
  md/md-bitmap: merge md_bitmap_unplug_async() into md_bitmap_unplug()
  md/md-bitmap: merge bitmap_unplug() into bitmap_operations
  md/md-bitmap: merge md_bitmap_daemon_work() into bitmap_operations
  md/md-bitmap: pass in mddev directly for md_bitmap_resize()
  md/md-bitmap: merge md_bitmap_resize() into bitmap_operations
  md/md-bitmap: merge get_bitmap_from_slot() into bitmap_operations
  md/md-bitmap: merge md_bitmap_copy_from_slot() into struct
    bitmap_operation.
  md/md-bitmap: merge md_bitmap_set_pages() into struct
    bitmap_operations
  md/md-bitmap: merge md_bitmap_free() into bitmap_operations
  md/md-bitmap: merge md_bitmap_wait_behind_writes() into
    bitmap_operations
  md/md-bitmap: merge md_bitmap_enabled() into bitmap_operations
  md/md-bitmap: make in memory structure internal

 drivers/md/dm-raid.c     |   7 +-
 drivers/md/md-bitmap.c   | 561 +++++++++++++++++++++++++++++----------
 drivers/md/md-bitmap.h   | 272 ++++---------------
 drivers/md/md-cluster.c  |  79 +++---
 drivers/md/md.c          | 133 ++++++----
 drivers/md/md.h          |   3 +-
 drivers/md/raid1-10.c    |   9 +-
 drivers/md/raid1.c       |  78 +++---
 drivers/md/raid10.c      |  73 ++---
 drivers/md/raid5-cache.c |   8 +-
 drivers/md/raid5.c       |  62 ++---
 11 files changed, 731 insertions(+), 554 deletions(-)

-- 
2.39.2


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

end of thread, other threads:[~2024-08-19 11:13 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14  7:10 [PATCH RFC -next v2 00/41] md/md-bitmap: introduce bitmap_operations and make structure internel Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 01/41] md/raid1: use md_bitmap_wait_behind_writes() in raid1_read_request() Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 02/41] md/md-bitmap: replace md_bitmap_status() with a new helper md_bitmap_get_stats() Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 03/41] md: use new helper md_bitmap_get_stats() in update_array_info() Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 04/41] md/md-bitmap: add 'events_cleared' into struct md_bitmap_stats Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 05/41] md/md-bitmap: add 'sync_size' " Yu Kuai
2024-08-14 12:52   ` Mariusz Tkaczyk
2024-08-14  7:10 ` [PATCH RFC -next v2 06/41] md/md-bitmap: add 'file_pages' " Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 07/41] md/md-bitmap: add 'behind_writes' and 'behind_wait' " Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 08/41] md/md-cluster: use helper md_bitmap_get_stats() to get pages in resize_bitmaps() Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 09/41] md/md-bitmap: add a new helper md_bitmap_set_pages() Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 10/41] md/md-bitmap: introduce struct bitmap_operations Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 11/41] md/md-bitmap: simplify md_bitmap_create() + md_bitmap_load() Yu Kuai
2024-08-19  8:10   ` Su Yue
2024-08-19 11:06     ` Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 12/41] md/md-bitmap: merge md_bitmap_create() into bitmap_operations Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 13/41] md/md-bitmap: merge md_bitmap_load() " Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 14/41] md/md-bitmap: merge md_bitmap_destroy() " Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 15/41] md/md-bitmap: merge md_bitmap_flush() " Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 16/41] md/md-bitmap: make md_bitmap_print_sb() internal Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 17/41] md/md-bitmap: merge md_bitmap_update_sb() into bitmap_operations Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 18/41] md/md-bitmap: merge md_bitmap_status() " Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 19/41] md/md-bitmap: remove md_bitmap_setallbits() Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 20/41] md/md-bitmap: merge bitmap_write_all() into bitmap_operations Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 21/41] md/md-bitmap: merge md_bitmap_dirty_bits() " Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 22/41] md/md-bitmap: merge md_bitmap_startwrite() " Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 23/41] md/md-bitmap: merge md_bitmap_endwrite() " Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 24/41] md/md-bitmap: merge md_bitmap_start_sync() " Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 25/41] md/md-bitmap: remove the parameter 'aborted' for md_bitmap_end_sync() Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 26/41] md/md-bitmap: merge md_bitmap_end_sync() into bitmap_operations Yu Kuai
2024-08-14  7:10 ` [PATCH RFC -next v2 27/41] md/md-bitmap: merge md_bitmap_close_sync() " Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 28/41] md/md-bitmap: mrege md_bitmap_cond_end_sync() " Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 29/41] md/md-bitmap: merge md_bitmap_sync_with_cluster() " Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 30/41] md/md-bitmap: merge md_bitmap_unplug_async() into md_bitmap_unplug() Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 31/41] md/md-bitmap: merge bitmap_unplug() into bitmap_operations Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 32/41] md/md-bitmap: merge md_bitmap_daemon_work() " Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 33/41] md/md-bitmap: pass in mddev directly for md_bitmap_resize() Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 34/41] md/md-bitmap: merge md_bitmap_resize() into bitmap_operations Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 35/41] md/md-bitmap: merge get_bitmap_from_slot() " Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 36/41] md/md-bitmap: merge md_bitmap_copy_from_slot() into struct bitmap_operation Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 37/41] md/md-bitmap: merge md_bitmap_set_pages() into struct bitmap_operations Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 38/41] md/md-bitmap: merge md_bitmap_free() into bitmap_operations Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 39/41] md/md-bitmap: merge md_bitmap_wait_behind_writes() " Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 40/41] md/md-bitmap: merge md_bitmap_enabled() " Yu Kuai
2024-08-14  7:11 ` [PATCH RFC -next v2 41/41] md/md-bitmap: make in memory structure internal Yu Kuai
2024-08-19  8:18 ` [PATCH RFC -next v2 00/41] md/md-bitmap: introduce bitmap_operations and make structure internel Su Yue
2024-08-19 11:13   ` Yu Kuai

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