1. 23 3月, 2022 2 次提交
    • X
      nvme-pci: expose use_threaded_interrupts read-only in sysfs · 2e21e445
      Xin Hao 提交于
      Allow reading /sys/module/nvme/parameters/use_threaded_interrupts to see
      if the use_threaded_interrupts module parameter is in use.
      Signed-off-by: NXin Hao <xhao@linux.alibaba.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      2e21e445
    • P
      nvme: fix the read-only state for zoned namespaces with unsupposed features · 726be2c7
      Pankaj Raghav 提交于
      commit 2f4c9ba2 ("nvme: export zoned namespaces without Zone Append
      support read-only") marks zoned namespaces without append support
      read-only.  It does iso by setting NVME_NS_FORCE_RO in ns->flags in
      nvme_update_zone_info and checking for that flag later in
      nvme_update_disk_info to mark the disk as read-only.
      
      But commit 73d90386 ("nvme: cleanup zone information initialization")
      rearranged nvme_update_disk_info to be called before
      nvme_update_zone_info and thus not marking the disk as read-only.
      The call order cannot be just reverted because nvme_update_zone_info sets
      certain queue parameters such as zone_write_granularity that depend on the
      prior call to nvme_update_disk_info.
      
      Remove the call to set_disk_ro in nvme_update_disk_info. and call
      set_disk_ro after nvme_update_zone_info and nvme_update_disk_info to set
      the permission for ZNS drives correctly. The same applies to the
      multipath disk path.
      
      Fixes: 73d90386 ("nvme: cleanup zone information initialization")
      Signed-off-by: NPankaj Raghav <p.raghav@samsung.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      726be2c7
  2. 21 3月, 2022 3 次提交
  3. 18 3月, 2022 2 次提交
    • J
      Merge tag 'nvme-5.18-2022-03-17' of git://git.infradead.org/nvme into for-5.18/drivers · ae53aea6
      Jens Axboe 提交于
      Pull NVMe updates from Christoph:
      
      "Second round of nvme updates for Linux 5.18
      
       - add lockdep annotations for in-kernel sockets (Chris Leech)
       - use vmalloc for ANA log buffer (Hannes Reinecke)
       - kerneldoc fixes (Chaitanya Kulkarni)
       - cleanups (Guoqing Jiang, Chaitanya Kulkarni, me)
       - warn about shared namespaces without multipathing (me)"
      
      * tag 'nvme-5.18-2022-03-17' of git://git.infradead.org/nvme:
        nvme: warn about shared namespaces without CONFIG_NVME_MULTIPATH
        nvme: remove nvme_alloc_request and nvme_alloc_request_qid
        nvme: cleanup how disk->disk_name is assigned
        nvmet: move the call to nvmet_ns_changed out of nvmet_ns_revalidate
        nvmet: use snprintf() with PAGE_SIZE in configfs
        nvmet: don't fold lines
        nvmet-rdma: fix kernel-doc warning for nvmet_rdma_device_removal
        nvmet-fc: fix kernel-doc warning for nvmet_fc_unregister_targetport
        nvmet-fc: fix kernel-doc warning for nvmet_fc_register_targetport
        nvme-tcp: lockdep: annotate in-kernel sockets
        nvme-tcp: don't fold the line
        nvme-tcp: don't initialize ret variable
        nvme-multipath: call bio_io_error in nvme_ns_head_submit_bio
        nvme-multipath: use vmalloc for ANA log buffer
      ae53aea6
    • R
      virtio_blk: eliminate anonymous module_init & module_exit · bcfe9b6c
      Randy Dunlap 提交于
      Eliminate anonymous module_init() and module_exit(), which can lead to
      confusion or ambiguity when reading System.map, crashes/oops/bugs,
      or an initcall_debug log.
      
      Give each of these init and exit functions unique driver-specific
      names to eliminate the anonymous names.
      
      Example 1: (System.map)
       ffffffff832fc78c t init
       ffffffff832fc79e t init
       ffffffff832fc8f8 t init
      
      Example 2: (initcall_debug log)
       calling  init+0x0/0x12 @ 1
       initcall init+0x0/0x12 returned 0 after 15 usecs
       calling  init+0x0/0x60 @ 1
       initcall init+0x0/0x60 returned 0 after 2 usecs
       calling  init+0x0/0x9a @ 1
       initcall init+0x0/0x9a returned 0 after 74 usecs
      
      Fixes: e467cde2 ("Block driver using virtio.")
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: virtualization@lists.linux-foundation.org
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: linux-block@vger.kernel.org
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: NJason Wang <jasowang@redhat.com>
      Reviewed-by: NIra Weiny <ira.weiny@intel.com>
      Link: https://lore.kernel.org/r/20220316192010.19001-2-rdunlap@infradead.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      bcfe9b6c
  4. 16 3月, 2022 3 次提交
  5. 15 3月, 2022 1 次提交
  6. 14 3月, 2022 10 次提交
  7. 11 3月, 2022 2 次提交
  8. 09 3月, 2022 10 次提交
  9. 06 3月, 2022 3 次提交
    • J
      Merge branch 'for-next' of... · a7637069
      Jens Axboe 提交于
      Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache into for-5.18/drivers
      
      Pull bcache updates from Coly:
      
      "We have 2 patches for Linux v5.18, both of them are from Mingzhe Zou.
       The first patch improves bcache initialization speed by avoid
       unnecessary cost of cache consistency, the second one fixes a potential
       NULL pointer deference in bcache initialization time."
      
      * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache:
        bcache: fixup multiple threads crash
        bcache: fixup bcache_dev_sectors_dirty_add() multithreaded CPU false sharing
      a7637069
    • M
      bcache: fixup multiple threads crash · 887554ab
      Mingzhe Zou 提交于
      When multiple threads to check btree nodes in parallel, the main
      thread wait for all threads to stop or CACHE_SET_IO_DISABLE flag:
      
      wait_event_interruptible(check_state->wait,
                               atomic_read(&check_state->started) == 0 ||
                               test_bit(CACHE_SET_IO_DISABLE, &c->flags));
      
      However, the bch_btree_node_read and bch_btree_node_read_done
      maybe call bch_cache_set_error, then the CACHE_SET_IO_DISABLE
      will be set. If the flag already set, the main thread return
      error. At the same time, maybe some threads still running and
      read NULL pointer, the kernel will crash.
      
      This patch change the event wait condition, the main thread must
      wait for all threads to stop.
      
      Fixes: 8e710227 ("bcache: make bch_btree_check() to be multithreaded")
      Signed-off-by: NMingzhe Zou <mingzhe.zou@easystack.cn>
      Cc: stable@vger.kernel.org # v5.7+
      Signed-off-by: NColy Li <colyli@suse.de>
      887554ab
    • M
      bcache: fixup bcache_dev_sectors_dirty_add() multithreaded CPU false sharing · 7b1002f7
      Mingzhe Zou 提交于
      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: NMingzhe Zou <mingzhe.zou@easystack.cn>
      Signed-off-by: NColy Li <colyli@suse.de>
      7b1002f7
  10. 05 3月, 2022 4 次提交