lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 26 Mar 2024 10:29:16 +0000
From: tada keisuke <keisuke1.tada@...xia.com>
To: "song@...nel.org" <song@...nel.org>,
        "yukuai3@...wei.com"
	<yukuai3@...wei.com>
CC: "linux-raid@...r.kernel.org" <linux-raid@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH 00/11] md: avoid counter operation conflicts

Currently, active_aligned_reads and nr_pending used as counters are atomic types.
Therefore, when inc/dec in a multi-core results in conflicts.

To solve this problem, use "percpu_ref" counters that can avoid conflicts and maintain consistency.

Switch modes of percpu_ref to achieve both consistency and conflict avoidance.
During normal operations such as inc/dec, it operates as percpu mode.
When consistency is required, it operates as atomic mode.
The operations that require consistency are as follows:
・Zero check for the counter
・All operations in RAID 1/10

Patches 1, 3, 6 change active_aligned_reads, and patches 2, 4, 5, 7 to 11 change nr_pending.
nr_pending temporarily switch from percpu mode to atomic mode in patch 7.
This is to reduce the amount of changes from patches 8 to 10.
Finally, nr_pending switch from atomic mode to percpu mode in patch 11.

Keisuke TADA (11):
  add infra for active_aligned_reads changes
  add infra for nr_pending changes
  workaround for inconsistency of config state in takeover
  minimize execution of zero check for nr_pending
  match the type of variables to percpu_ref
  avoid conflicts in active_aligned_reads operations
  change the type of nr_pending from atomic_t to percpu_ref
  add atomic mode switching in RAID 1/10
  add atomic mode switching when removing disk
  add atomic mode switching when I/O completion
  avoid conflicts in nr_pending operations

 drivers/md/md-bitmap.c   |  2 +-
 drivers/md/md.c          | 40 +++++++++++++++---
 drivers/md/md.h          | 62 ++++++++++++++++++++++++----
 drivers/md/raid1.c       | 37 +++++++++++------
 drivers/md/raid10.c      | 60 ++++++++++++++++-----------
 drivers/md/raid5-cache.c |  4 +-
 drivers/md/raid5.c       | 89 +++++++++++++++++++++++++++-------------
 drivers/md/raid5.h       | 17 +++++++-
 8 files changed, 230 insertions(+), 81 deletions(-)


base-commit: fcf3f7e2fc8a53a6140beee46ec782a4c88e4744
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ