1. 09 Mar, 2022 3 commits
  2. 08 Mar, 2022 6 commits
    • Jens Axboe's avatar
      Merge branch 'md-next' of... · a2daeab5
      Jens Axboe authored
      Merge branch 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-5.18/drivers
      
      Pull MD fixes from Song:
      
      "Most of these changes are minor fixes and clean-ups."
      
      * 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md:
        md: use msleep() in md_notify_reboot()
        lib/raid6: Include <asm/ppc-opcode.h> for VPERMXOR
        lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3
        lib/raid6/test: fix multiple definition linking error
        md: raid1/raid10: drop pending_cnt
      a2daeab5
    • Eric Dumazet's avatar
      md: use msleep() in md_notify_reboot() · 7d959f6e
      Eric Dumazet authored
      Calling mdelay(1000) from process context, even while a reboot
      is in progress, does not make sense.
      
      Using msleep() allows other threads to make progress.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: linux-raid@vger.kernel.org
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      7d959f6e
    • Paul Menzel's avatar
      lib/raid6: Include <asm/ppc-opcode.h> for VPERMXOR · 5b401e4e
      Paul Menzel authored
      On Ubuntu 21.10 (ppc64le) building raid6test with gcc (Ubuntu
      11.2.0-7ubuntu2) 11.2.0 fails with the error below.
      
          gcc -I.. -I ../../../include -g -O2                       \
                   -I../../../arch/powerpc/include -DCONFIG_ALTIVEC \
                   -c -o vpermxor1.o vpermxor1.c
          vpermxor1.c: In function ‘raid6_vpermxor1_gen_syndrome_real’:
          vpermxor1.c:64:29: error: expected string literal before ‘VPERMXOR’
             64 |   asm(VPERMXOR(%0,%1,%2,%3):"=v"(wq0):"v"(gf_high), "v"(gf_low), "v"(wq0));
                |       ^~~~~~~~
          make: *** [Makefile:58: vpermxor1.o] Error 1
      
      So, include the header asm/ppc-opcode.h defining this macro also when
      not building the Linux kernel but only this too.
      
      Cc: Matt Brown <matthew.brown.dev@gmail.com>
      Signed-off-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      5b401e4e
    • Paul Menzel's avatar
      lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3 · 633174a7
      Paul Menzel authored
      Buidling raid6test on Ubuntu 21.10 (ppc64le) with GNU Make 4.3 shows the
      errors below:
      
          $ cd lib/raid6/test/
          $ make
          <stdin>:1:1: error: stray ‘\’ in program
          <stdin>:1:2: error: stray ‘#’ in program
          <stdin>:1:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ \
              before ‘<’ token
      
          [...]
      
      The errors come from the HAS_ALTIVEC test, which fails, and the POWER
      optimized versions are not built. That’s also reason nobody noticed on the
      other architectures.
      
      GNU Make 4.3 does not remove the backslash anymore. From the 4.3 release
      announcment:
      
      > * WARNING: Backward-incompatibility!
      >   Number signs (#) appearing inside a macro reference or function invocation
      >   no longer introduce comments and should not be escaped with backslashes:
      >   thus a call such as:
      >     foo := $(shell echo '#')
      >   is legal.  Previously the number sign needed to be escaped, for example:
      >     foo := $(shell echo '\#')
      >   Now this latter will resolve to "\#".  If you want to write makefiles
      >   portable to both versions, assign the number sign to a variable:
      >     H := \#
      >     foo := $(shell echo '$H')
      >   This was claimed to be fixed in 3.81, but wasn't, for some reason.
      >   To detect this change search for 'nocomment' in the .FEATURES variable.
      
      So, do the same as commit 9564a8cf ("Kbuild: fix # escaping in .cmd
      files for future Make") and commit 929bef46 ("bpf: Use $(pound) instead
      of \# in Makefiles") and define and use a $(pound) variable.
      
      Reference for the change in make:
      https://git.savannah.gnu.org/cgit/make.git/commit/?id=c6966b323811c37acedff05b57
      
      Cc: Matt Brown <matthew.brown.dev@gmail.com>
      Signed-off-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      633174a7
    • Dirk Müller's avatar
      lib/raid6/test: fix multiple definition linking error · a5359ddd
      Dirk Müller authored
      GCC 10+ defaults to -fno-common, which enforces proper declaration of
      external references using "extern". without this change a link would
      fail with:
      
        lib/raid6/test/algos.c:28: multiple definition of `raid6_call';
        lib/raid6/test/test.c:22: first defined here
      
      the pq.h header that is included already includes an extern declaration
      so we can just remove the redundant one here.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarDirk Müller <dmueller@suse.de>
      Reviewed-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      a5359ddd
    • Mariusz Tkaczyk's avatar
      md: raid1/raid10: drop pending_cnt · daae161f
      Mariusz Tkaczyk authored
      Those counters are not necessary after commit 11bb45e8aaf6 ("md: drop queue
      limitation for RAID1 and RAID10"). Remove them from all code (conf and
      plug structs). raid1_plug_cb and raid10_plug_cb are identical, so move
      definition of raid1_plug_cb to common raid1-10 definitions and use it for
      RAID10 too.
      Signed-off-by: default avatarMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      daae161f
  3. 06 Mar, 2022 3 commits
    • Jens Axboe's avatar
      Merge branch 'for-next' of... · a7637069
      Jens Axboe authored
      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
    • Mingzhe Zou's avatar
      bcache: fixup multiple threads crash · 887554ab
      Mingzhe Zou authored
      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: default avatarMingzhe Zou <mingzhe.zou@easystack.cn>
      Cc: stable@vger.kernel.org # v5.7+
      Signed-off-by: default avatarColy Li <colyli@suse.de>
      887554ab
    • 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
  4. 04 Mar, 2022 10 commits
  5. 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
  6. 28 Feb, 2022 17 commits