1. 06 Mar, 2022 1 commit
    • Mingzhe Zou's avatar
      bcache: fixup bcache_dev_sectors_dirty_add() multithreaded CPU false sharing · 7b1002f7
      Mingzhe Zou authored
      When attaching a cached device (a.k.a backing device) to a cache
      device, bch_sectors_dirty_init() is called to count dirty sectors
      and stripes (see what bcache_dev_sectors_dirty_add() does) on the
      cache device.
      
      When bcache_dev_sectors_dirty_add() is called, set_bit(stripe,
      d->full_dirty_stripes) or clear_bit(stripe, d->full_dirty_stripes)
      operation will always be performed. In full_dirty_stripes, each 1bit
      represents stripe_size (8192) sectors (512B), so 1bit=4MB (8192*512),
      and each CPU cache line=64B=512bit=2048MB. When 20 threads process
      a cached disk with 100G dirty data, a single thread processes about
      23M at a time, and 20 threads total 460M. These full_dirty_stripes
      bits corresponding to the 460M data is likely to fall in the same CPU
      cache line. When one of these threads performs a set_bit or clear_bit
      operation, the same CPU cache line of other threads will become invalid
      and must read the full_dirty_stripes from the main memory again. Compared
      with single thread, the time of a bcache_dev_sectors_dirty_add()
      call is increased by about 50 times in our test (100G dirty data,
      20 threads, bcache_dev_sectors_dirty_add() is called more than
      20 million times).
      
      This patch tries to test_bit before set_bit or clear_bit operation.
      Therefore, a lot of force set and clear operations will be avoided,
      and most of bcache_dev_sectors_dirty_add() calls will only read CPU
      cache line.
      Signed-off-by: default avatarMingzhe Zou <mingzhe.zou@easystack.cn>
      Signed-off-by: default avatarColy Li <colyli@suse.de>
      7b1002f7
  2. 04 Mar, 2022 10 commits
  3. 03 Mar, 2022 1 commit
    • Jens Axboe's avatar
      Merge tag 'nvme-5.18-2022-03-03' of git://git.infradead.org/nvme into for-5.18/drivers · c48d8c5c
      Jens Axboe authored
      Pull NVMe updates from Christoph:
      
      "nvme updates for Linux 5.18
      
       - add vectored-io support for user-passthrough (Kanchan Joshi)
       - add verbose error logging (Alan Adamson)
       - support buffered I/O on block devices in nvmet (Chaitanya Kulkarni)
       - central discovery controller support (Martin Belanger)
       - fix and extended the globally unique idenfier validation (me)
       - move away from the deprecated IDA APIs (Sagi Grimberg)
       - misc code cleanup (Keith Busch, Max Gurtovoy, Qinghua Jin,
         Chaitanya Kulkarni)"
      
      * tag 'nvme-5.18-2022-03-03' of git://git.infradead.org/nvme: (27 commits)
        nvme: check that EUI/GUID/UUID are globally unique
        nvme: check for duplicate identifiers earlier
        nvme: fix the check for duplicate unique identifiers
        nvme: cleanup __nvme_check_ids
        nvme: remove nssa from struct nvme_ctrl
        nvme: explicitly set non-error for directives
        nvme: expose cntrltype and dctype through sysfs
        nvme: send uevent on connection up
        nvme: add vectored-io support for user-passthrough
        nvme: add verbose error logging
        nvme: add a helper to initialize connect_q
        nvme-rdma: add helpers for mapping/unmapping request
        nvmet-tcp: replace ida_simple[get|remove] with the simler ida_[alloc|free]
        nvmet-rdma: replace ida_simple[get|remove] with the simler ida_[alloc|free]
        nvmet-fc: replace ida_simple[get|remove] with the simler ida_[alloc|free]
        nvmet: replace ida_simple[get|remove] with the simler ida_[alloc|free]
        nvme-fc: replace ida_simple[get|remove] with the simler ida_[alloc|free]
        nvme: replace ida_simple[get|remove] with the simler ida_[alloc|free]
        nvmet: allow bdev in buffered_io mode
        nvmet: use i_size_read() to set size for file-ns
        ...
      c48d8c5c
  4. 28 Feb, 2022 27 commits
  5. 27 Feb, 2022 1 commit