1. 07 Nov, 2020 16 commits
    • Paul E. McKenney's avatar
      rcutorture: Make stutter_wait() caller restore priority · ab1b7880
      Paul E. McKenney authored
      Currently, stutter_wait() will happily spin waiting for the stutter
      interval to end even if the caller is running at a real-time priority
      level.  This could starve normal-priority tasks for no good reason.  This
      commit therefore drops the calling task's priority to SCHED_OTHER MAX_NICE
      if stutter_wait() needs to wait.  But when it waits, stutter_wait()
      returns true, which allows the caller to restore the priority if needed.
      Callers that were already running at SCHED_OTHER MAX_NICE obviously
      do not need any changes, but this commit also restores priority for
      higher-priority callers.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      ab1b7880
    • Paul E. McKenney's avatar
      torture: Force weak-hashed pointers on console log · c1e06287
      Paul E. McKenney authored
      Although the rcutorture scripting now deals correctly with full-up
      security-induced pointer obfuscation, it is still counter-productive for
      kernel hackers who are analyzing console output.  This commit therefore
      sets the debug_boot_weak_hash kernel boot parameter, which enables
      printing of weak-hashed pointers for torture-test runs.
      
      Please note that this change applies only to runs initiated by the
      kvm.sh scripting.  If you are instead using modprobe and rmmod, it is
      your responsibility to build and boot the underlying kernel to your taste.
      
      Please note further that this change does not result in a security hole
      in normal use.  The rcutorture testing runs with a negligible userspace,
      no networking, and no user interaction.  Besides which, there is no data
      of value that can be extracted from an rcutorture guest OS that could
      not also be extracted from the host that this guest is running on.
      Suggested-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      c1e06287
    • Paul E. McKenney's avatar
      rcutorture: Prevent hangs for invalid arguments · 4994684c
      Paul E. McKenney authored
      If an rcutorture torture-test run is given a bad kvm.sh argument, the
      test will complain to the console, which is good.  What is bad is that
      from the user's perspective, it will just hang for the time specified
      by the --duration argument.  This commit therefore forces an immediate
      kernel shutdown if a rcu_torture_init()-time error occurs, thus avoiding
      the appearance of a hang.  It also forces a console splat in this case
      to clearly indicate the presence of an error.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      4994684c
    • Paul E. McKenney's avatar
      torture: Prevent jitter processes from delaying failed run · c64659ef
      Paul E. McKenney authored
      Even when the kernel panics and qemu dies, runs with jitter enabled will
      continue uselessly until the jitter.sh processes terminate.  This can
      be annoying if a planned one-hour run instead dies during boot.
      
      This commit therefore kills the jitter.sh processes when the run ends
      more than one minute prior to the termination time specified by the
      kvm.sh --duration argument or its default.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      c64659ef
    • Paul E. McKenney's avatar
      locktorture: Prevent hangs for invalid arguments · 6b74fa0a
      Paul E. McKenney authored
      If an locktorture torture-test run is given a bad kvm.sh argument, the
      test will complain to the console, which is good.  What is bad is that
      from the user's perspective, it will just hang for the time specified
      by the --duration argument.  This commit therefore forces an immediate
      kernel shutdown if a lock_torture_init()-time error occurs, thus avoiding
      the appearance of a hang.  It also forces a console splat in this case
      to clearly indicate the presence of an error.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      6b74fa0a
    • Hou Tao's avatar
      locktorture: Ignore nreaders_stress if no readlock support · e5ace37d
      Hou Tao authored
      Exclusive locks do not have readlock support, which means that a
      locktorture run with the following module parameters will do nothing:
      
       torture_type=mutex_lock nwriters_stress=0 nreaders_stress=1
      
      This commit therefore rejects this combination for exclusive locks by
      returning -EINVAL during module init.
      Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      e5ace37d
    • Paul E. McKenney's avatar
      rcutorture: Adjust scenarios SRCU-t and SRCU-u to make kconfig happy · 6f26d010
      Paul E. McKenney authored
      The SRCU-u scenario expects to enable lockdep but to also disable the
      CONFIG_PREEMPT_COUNT kconfig option.  This no longer works.  This commit
      therefore instead enables lockdep in SRCU-t, which then allows SRCU-u
      to disable CONFIG_PREEMPT_COUNT.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      6f26d010
    • Paul E. McKenney's avatar
      refscale: Prevent hangs for invalid arguments · bc80d353
      Paul E. McKenney authored
      If an refscale torture-test run is given a bad kvm.sh argument, the
      test will complain to the console, which is good.  What is bad is that
      from the user's perspective, it will just hang for the time specified
      by the --duration argument.  This commit therefore forces an immediate
      kernel shutdown if a ref_scale_init()-time error occurs, thus avoiding
      the appearance of a hang.  It also forces a console splat in this case
      to clearly indicate the presence of an error.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      bc80d353
    • Paul E. McKenney's avatar
      rcuscale: Prevent hangs for invalid arguments · 2f2214d4
      Paul E. McKenney authored
      If an rcuscale torture-test run is given a bad kvm.sh argument, the
      test will complain to the console, which is good.  What is bad is that
      from the user's perspective, it will just hang for the time specified
      by the --duration argument.  This commit therefore forces an immediate
      kernel shutdown if a rcu_scale_init()-time error occurs, thus avoiding
      the appearance of a hang.  It also forces a console splat in this case
      to clearly indicate the presence of an error.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      2f2214d4
    • Paul E. McKenney's avatar
      torture: Exclude "NOHZ tick-stop error" from fatal errors · 8d68e68a
      Paul E. McKenney authored
      The "NOHZ tick-stop error: Non-RCU local softirq work is pending"
      warning happens frequently and appears to be irrelevant to the various
      torture tests.  This commit therefore filters it out.
      
      If there proves to be a need to pay attention to it a later commit will
      add an "advice" category to allow the user to immediately see that
      although something happened, it was not an indictment of the system
      being tortured.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      8d68e68a
    • Paul E. McKenney's avatar
      rcuscale: Avoid divide by zero · 45c7b962
      Paul E. McKenney authored
      The rcuscale test module does not use batches, so there is only
      ever one batch.  This commit therefore informs the kvm-recheck-rcuscale.sh
      script of this fact of life.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      45c7b962
    • Paul E. McKenney's avatar
      rcuscale: Add RCU Tasks Trace · 899f317e
      Paul E. McKenney authored
      This commit adds the ability to test performance and scalability of RCU
      Tasks Trace updaters.
      Reported-by: default avatarAlexei Starovoitov <alexei.starovoitov@gmail.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      899f317e
    • Paul E. McKenney's avatar
      scftorture: Add an alternative IPI vector · 1ac78b49
      Paul E. McKenney authored
      The scftorture tests currently use only smp_call_function() and
      friends, which means that these tests cannot locate bugs caused by
      interactions between different IPI vectors.  This commit therefore adds
      the rescheduling IPI to the mix.
      
      Note that this commit permits resched_cpus() only when scftorture is
      built in.  This is a workaround.  Longer term, this will use real wakeups
      rather than resched_cpu().
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      1ac78b49
    • Paul E. McKenney's avatar
      torture: Make torture_stutter() use hrtimer · fda5ba9e
      Paul E. McKenney authored
      The torture_stutter() function uses schedule_timeout_interruptible()
      to time the stutter duration, but this can miss race conditions due to
      its being time-synchronized with everything else that is based on the
      timer wheels.  This commit therefore converts torture_stutter() to use
      the high-resolution timers via schedule_hrtimeout(), and also to fuzz
      the stutter interval.  While in the area, this commit also limits the
      spin-loop portion of the stutter_wait() function's wait loop to two
      jiffies, down from about one second.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      fda5ba9e
    • Paul E. McKenney's avatar
      torture: Periodically pause in stutter_wait() · 19012b78
      Paul E. McKenney authored
      Running locktorture scenario LOCK05 results in hangs:
      
      tools/testing/selftests/rcutorture/bin/kvm.sh --allcpus --torture lock --duration 3 --configs LOCK05
      
      The lock_torture_writer() kthreads set themselves to MAX_NICE while
      running SCHED_OTHER.  Other locktorture kthreads run at default niceness,
      also SCHED_OTHER.  This results in these other locktorture kthreads
      indefinitely preempting the lock_torture_writer() kthreads.  Note that
      the cond_resched() in the stutter_wait() function's loop is ineffective
      because this scenario is built with CONFIG_PREEMPT=y.
      
      It is not clear that such indefinite preemption is supposed to happen, but
      in the meantime this commit prevents kthreads running in stutter_wait()
      from being completely CPU-bound, thus allowing the other threads to get
      some CPU in a timely fashion.  This commit also uses hrtimers to provide
      very short sleeps to avoid degrading the sudden-on testing that stutter
      is supposed to provide.
      Reviewed-by: default avatarDavidlohr Bueso <dbueso@suse.de>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      19012b78
    • Paul E. McKenney's avatar
      locktorture: Track time of last ->writeunlock() · 3480d677
      Paul E. McKenney authored
      This commit adds a last_lock_release variable that tracks the time of
      the last ->writeunlock() call, which allows easier diagnosing of lock
      hangs when using a kernel debugger.
      Acked-by: default avatarDavidlohr Bueso <dbueso@suse.de>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      3480d677
  2. 03 Nov, 2020 2 commits
    • Paul E. McKenney's avatar
      torture: Don't kill gdb sessions · 08c79742
      Paul E. McKenney authored
      The rcutorture scripting will do a "kill -9" on any guest OS that exceeds
      its --duration by more than a few minutes, which is very valuable when
      bugs result in hangs.  However, this is a problem when the "hang" was due
      to a --gdb debugging session.
      
      This commit therefore refrains from killing the guest OS when a debugging
      session is in progress.  This means that the user must manually kill the
      kvm.sh process group if a hang really does occur.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      08c79742
    • Paul E. McKenney's avatar
      refscale: Bounds-check module parameters · 0c6d18d8
      Paul E. McKenney authored
      The default value for refscale.nreaders is -1, which results in the code
      setting the value to three-quarters of the number of CPUs.  On single-CPU
      systems, this results in three-quarters of the value one, which the C
      language's integer arithmetic rounds to zero.  This in turn results in
      a divide-by-zero error.
      
      This commit therefore adds bounds checking to the refscale module
      parameters, so that if they are less than one, they are set to the
      value one.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Tested-by "Chen, Rong A" <rong.a.chen@intel.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      0c6d18d8
  3. 25 Oct, 2020 17 commits
  4. 24 Oct, 2020 5 commits
    • Linus Torvalds's avatar
      Merge tag 'block-5.10-2020-10-24' of git://git.kernel.dk/linux-block · d7691390
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request from Christoph
           - rdma error handling fixes (Chao Leng)
           - fc error handling and reconnect fixes (James Smart)
           - fix the qid displace when tracing ioctl command (Keith Busch)
           - don't use BLK_MQ_REQ_NOWAIT for passthru (Chaitanya Kulkarni)
           - fix MTDT for passthru (Logan Gunthorpe)
           - blacklist Write Same on more devices (Kai-Heng Feng)
           - fix an uninitialized work struct (zhenwei pi)"
      
       - lightnvm out-of-bounds fix (Colin)
      
       - SG allocation leak fix (Doug)
      
       - rnbd fixes (Gioh, Guoqing, Jack)
      
       - zone error translation fixes (Keith)
      
       - kerneldoc markup fix (Mauro)
      
       - zram lockdep fix (Peter)
      
       - Kill unused io_context members (Yufen)
      
       - NUMA memory allocation cleanup (Xianting)
      
       - NBD config wakeup fix (Xiubo)
      
      * tag 'block-5.10-2020-10-24' of git://git.kernel.dk/linux-block: (27 commits)
        block: blk-mq: fix a kernel-doc markup
        nvme-fc: shorten reconnect delay if possible for FC
        nvme-fc: wait for queues to freeze before calling update_hr_hw_queues
        nvme-fc: fix error loop in create_hw_io_queues
        nvme-fc: fix io timeout to abort I/O
        null_blk: use zone status for max active/open
        nvmet: don't use BLK_MQ_REQ_NOWAIT for passthru
        nvmet: cleanup nvmet_passthru_map_sg()
        nvmet: limit passthru MTDS by BIO_MAX_PAGES
        nvmet: fix uninitialized work for zero kato
        nvme-pci: disable Write Zeroes on Sandisk Skyhawk
        nvme: use queuedata for nvme_req_qid
        nvme-rdma: fix crash due to incorrect cqe
        nvme-rdma: fix crash when connect rejected
        block: remove unused members for io_context
        blk-mq: remove the calling of local_memory_node()
        zram: Fix __zram_bvec_{read,write}() locking order
        skd_main: remove unused including <linux/version.h>
        sgl_alloc_order: fix memory leak
        lightnvm: fix out-of-bounds write to array devices->info[]
        ...
      d7691390
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.10-2020-10-24' of git://git.kernel.dk/linux-block · af004187
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
      
       - fsize was missed in previous unification of work flags
      
       - Few fixes cleaning up the flags unification creds cases (Pavel)
      
       - Fix NUMA affinities for completely unplugged/replugged node for io-wq
      
       - Two fallout fixes from the set_fs changes. One local to io_uring, one
         for the splice entry point that io_uring uses.
      
       - Linked timeout fixes (Pavel)
      
       - Removal of ->flush() ->files work-around that we don't need anymore
         with referenced files (Pavel)
      
       - Various cleanups (Pavel)
      
      * tag 'io_uring-5.10-2020-10-24' of git://git.kernel.dk/linux-block:
        splice: change exported internal do_splice() helper to take kernel offset
        io_uring: make loop_rw_iter() use original user supplied pointers
        io_uring: remove req cancel in ->flush()
        io-wq: re-set NUMA node affinities if CPUs come online
        io_uring: don't reuse linked_timeout
        io_uring: unify fsize with def->work_flags
        io_uring: fix racy REQ_F_LINK_TIMEOUT clearing
        io_uring: do poll's hash_node init in common code
        io_uring: inline io_poll_task_handler()
        io_uring: remove extra ->file check in poll prep
        io_uring: make cached_cq_overflow non atomic_t
        io_uring: inline io_fail_links()
        io_uring: kill ref get/drop in personality init
        io_uring: flags-based creds init in queue
      af004187
    • Linus Torvalds's avatar
      Merge tag 'libata-5.10-2020-10-24' of git://git.kernel.dk/linux-block · cb6b2897
      Linus Torvalds authored
      Pull libata fixes from Jens Axboe:
       "Two minor libata fixes:
      
         - Fix a DMA boundary mask regression for sata_rcar (Geert)
      
         - kerneldoc markup fix (Mauro)"
      
      * tag 'libata-5.10-2020-10-24' of git://git.kernel.dk/linux-block:
        ata: fix some kernel-doc markups
        ata: sata_rcar: Fix DMA boundary mask
      cb6b2897
    • Linus Torvalds's avatar
      Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 0eac1102
      Linus Torvalds authored
      Pull misc vfs updates from Al Viro:
       "Assorted stuff all over the place (the largest group here is
        Christoph's stat cleanups)"
      
      * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fs: remove KSTAT_QUERY_FLAGS
        fs: remove vfs_stat_set_lookup_flags
        fs: move vfs_fstatat out of line
        fs: implement vfs_stat and vfs_lstat in terms of vfs_fstatat
        fs: remove vfs_statx_fd
        fs: omfs: use kmemdup() rather than kmalloc+memcpy
        [PATCH] reduce boilerplate in fsid handling
        fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS
        selftests: mount: add nosymfollow tests
        Add a "nosymfollow" mount option.
      0eac1102
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-5.10-1' of git://git.infradead.org/users/hch/dma-mapping · 1b307ac8
      Linus Torvalds authored
      Pull dma-mapping fixes from Christoph Hellwig:
      
       - document the new dma_{alloc,free}_pages() API
      
       - two fixups for the dma-mapping.h split
      
      * tag 'dma-mapping-5.10-1' of git://git.infradead.org/users/hch/dma-mapping:
        dma-mapping: document dma_{alloc,free}_pages
        dma-mapping: move more functions to dma-map-ops.h
        ARM/sa1111: add a missing include of dma-map-ops.h
      1b307ac8