1. 25 Jan, 2019 6 commits
    • Paul E. McKenney's avatar
      rcu: Eliminate RCU_BH_FLAVOR and RCU_SCHED_FLAVOR · c97058d0
      Paul E. McKenney authored
      Now that the RCU flavors have been consolidated, RCU_BH_FLAVOR and
      RCU_SCHED_FLAVOR are no longer used.  This commit therefore saves a
      few lines by removing them.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
      c97058d0
    • Paul E. McKenney's avatar
      rcu: Inline force_quiescent_state() into rcu_force_quiescent_state() · cd920e5a
      Paul E. McKenney authored
      Given that rcu_force_quiescent_state() is a simple wrapper around
      force_quiescent_state(), this commit saves a few lines of code by
      inlining force_quiescent_state() into rcu_force_quiescent_state(),
      and changing all references to force_quiescent_state() to instead
      invoke rcu_force_quiescent_state().
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
      cd920e5a
    • Paul E. McKenney's avatar
      rcu: Make expedited IPI handler return after handling critical section · 1de462ed
      Paul E. McKenney authored
      During expedited RCU grace-period initialization, IPIs are sent to
      all non-idle online CPUs.  The IPI handler checks to see if the CPU is
      in quiescent state, reporting one if so.  This handler looks at three
      different cases: (1) The CPU is not in an rcu_read_lock()-based critical
      section, (2) The CPU is in the process of exiting an rcu_read_lock()-based
      critical section, and (3) The CPU is in an rcu_read_lock()-based critical
      section.  In case (2), execution falls through into case (3).
      
      This is harmless from a functionality viewpoint, but can result in
      needless overhead during an improbable corner case.  This commit therefore
      adds the "return" statement needed to prevent fall-through.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
      1de462ed
    • Paul E. McKenney's avatar
      rcu: Rename and comment changes due to only one rcuo kthread per CPU · ad368d15
      Paul E. McKenney authored
      Given RCU flavor consolidation, the name rcu_spawn_all_nocb_kthreads()
      is quite misleading.  It no longer ever creates more than one kthread,
      and it does so only for the specified CPU.  This commit therefore changes
      this name to the more descriptive rcu_spawn_cpu_nocb_kthread(), and also
      fixes up a similar issue in its header comment while in the area.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
      ad368d15
    • Paul E. McKenney's avatar
      sched: Replace synchronize_sched() with synchronize_rcu() · b290ebcf
      Paul E. McKenney authored
      Now that synchronize_rcu() waits for preempt-disable regions of
      code as well as RCU read-side critical sections, synchronize_sched()
      can be replaced by synchronize_rcu(), in fact, synchronize_sched()
      is now completely equivalent to synchronize_rcu().  This commit
      therefore replaces synchronize_sched() with synchronize_rcu() so that
      synchronize_sched() can eventually be removed entirely.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      b290ebcf
    • Paul E. McKenney's avatar
      sched: Replace call_rcu_sched() with call_rcu() · 337e9b07
      Paul E. McKenney authored
      Now that call_rcu()'s callback is not invoked until after all
      preempt-disable regions of code have completed (in addition to explicitly
      marked RCU read-side critical sections), call_rcu() can be used in place
      of call_rcu_sched().  This commit therefore makes that change.
      
      While in the area, this commit also updates an outdated header comment
      for for_each_domain().
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      337e9b07
  2. 21 Jan, 2019 3 commits
    • Paul E. McKenney's avatar
      tools/memory-model: Make scripts take "-j" abbreviation for "--jobs" · 910cc959
      Paul E. McKenney authored
      The "--jobs" argument to the litmus-test scripts is similar to the "-jN"
      argument to "make", so this commit allows the "-jN" form as well.  While
      in the area, it also prohibits the various forms of "-j0".
      Suggested-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: akiyks@gmail.com
      Cc: boqun.feng@gmail.com
      Cc: dhowells@redhat.com
      Cc: j.alglave@ucl.ac.uk
      Cc: linux-arch@vger.kernel.org
      Cc: luc.maranget@inria.fr
      Cc: npiggin@gmail.com
      Cc: parri.andrea@gmail.com
      Cc: will.deacon@arm.com
      Link: http://lkml.kernel.org/r/20181203230451.28921-3-paulmck@linux.ibm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      910cc959
    • Paul E. McKenney's avatar
      tools/memory-model: Add scripts to check github litmus tests · b02eb5b0
      Paul E. McKenney authored
      The https://github.com/paulmckrcu/litmus repository contains a large
      number of C-language litmus tests that include "Result:" comments
      predicting the verification result.  This commit adds a number of scripts
      that run tests on these litmus tests:
      
      checkghlitmus.sh:
      	Runs all litmus tests in the https://github.com/paulmckrcu/litmus
              archive that are C-language and that have "Result:" comment lines
      	documenting expected results, comparing the actual results to
      	those expected.  Clones the repository if it has not already
      	been cloned into the "tools/memory-model/litmus" directory.
      
      initlitmushist.sh
      	Run all litmus tests having no more than the specified number
      	of processes given a specified timeout, recording the results in
      	.litmus.out files.  Clones the repository if it has not already
      	been cloned into the "tools/memory-model/litmus" directory.
      
      newlitmushist.sh
      	For all new or updated litmus tests having no more than the
      	specified number of processes given a specified timeout, run
      	and record the results in .litmus.out files.
      
      checklitmushist.sh
      	Run all litmus tests having .litmus.out files from previous
      	initlitmushist.sh or newlitmushist.sh runs, comparing the
      	herd output to that of the original runs.
      
      The above scripts will run litmus tests concurrently, by default with
      one job per available CPU.  Giving any of these scripts the --help
      argument will cause them to print usage information.
      
      This commit also adds a number of helper scripts that are not intended
      to be invoked from the command line:
      
      cmplitmushist.sh: Compare the output of two different runs of the same
      	litmus test.
      
      judgelitmus.sh: Compare the output of a litmus test to its "Result:"
      	comment line.
      
      parseargs.sh: Parse command-line arguments.
      
      runlitmushist.sh: Run the litmus tests whose pathnames are provided one
      	per line on standard input.
      
      While in the area, this commit also makes the existing checklitmus.sh
      and checkalllitmus.sh scripts use parseargs.sh in order to provide a
      bit of uniformity.  In addition, per-litmus-test status output is directed
      to stdout, while end-of-test summary information is directed to stderr.
      Finally, the error flag standardizes on "!!!" to assist those familiar
      with rcutorture output.
      
      The defaults for the parseargs.sh arguments may be overridden by using
      environment variables: LKMM_DESTDIR for --destdir, LKMM_HERD_OPTIONS
      for --herdoptions, LKMM_JOBS for --jobs, LKMM_PROCS for --procs, and
      LKMM_TIMEOUT for --timeout.
      
      [ paulmck: History-check summary-line changes per Alan Stern feedback. ]
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: akiyks@gmail.com
      Cc: boqun.feng@gmail.com
      Cc: dhowells@redhat.com
      Cc: j.alglave@ucl.ac.uk
      Cc: linux-arch@vger.kernel.org
      Cc: luc.maranget@inria.fr
      Cc: npiggin@gmail.com
      Cc: parri.andrea@gmail.com
      Cc: stern@rowland.harvard.edu
      Cc: will.deacon@arm.com
      Link: http://lkml.kernel.org/r/20181203230451.28921-2-paulmck@linux.ibm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b02eb5b0
    • Andrea Parri's avatar
      tools/memory-model: Model smp_mb__after_unlock_lock() · 5b735eb1
      Andrea Parri authored
      The kernel documents smp_mb__after_unlock_lock() the following way:
      
        "Place this after a lock-acquisition primitive to guarantee that
         an UNLOCK+LOCK pair acts as a full barrier.  This guarantee applies
         if the UNLOCK and LOCK are executed by the same CPU or if the
         UNLOCK and LOCK operate on the same lock variable."
      
      Formalize in LKMM the above guarantee by defining (new) mb-links according
      to the law:
      
        ([M] ; po ; [UL] ; (co | po) ; [LKW] ;
      	fencerel(After-unlock-lock) ; [M])
      
      where the component ([UL] ; co ; [LKW]) identifies "UNLOCK+LOCK pairs on
      the same lock variable" and the component ([UL] ; po ; [LKW]) identifies
      "UNLOCK+LOCK pairs executed by the same CPU".
      
      In particular, the LKMM forbids the following two behaviors (the second
      litmus test below is based on:
      
        Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.html
      
      c.f., Section "Tree RCU Grace Period Memory Ordering Building Blocks"):
      
      C after-unlock-lock-same-cpu
      
      (*
       * Result: Never
       *)
      
      {}
      
      P0(spinlock_t *s, spinlock_t *t, int *x, int *y)
      {
      	int r0;
      
      	spin_lock(s);
      	WRITE_ONCE(*x, 1);
      	spin_unlock(s);
      	spin_lock(t);
      	smp_mb__after_unlock_lock();
      	r0 = READ_ONCE(*y);
      	spin_unlock(t);
      }
      
      P1(int *x, int *y)
      {
      	int r0;
      
      	WRITE_ONCE(*y, 1);
      	smp_mb();
      	r0 = READ_ONCE(*x);
      }
      
      exists (0:r0=0 /\ 1:r0=0)
      
      C after-unlock-lock-same-lock-variable
      
      (*
       * Result: Never
       *)
      
      {}
      
      P0(spinlock_t *s, int *x, int *y)
      {
      	int r0;
      
      	spin_lock(s);
      	WRITE_ONCE(*x, 1);
      	r0 = READ_ONCE(*y);
      	spin_unlock(s);
      }
      
      P1(spinlock_t *s, int *y, int *z)
      {
      	int r0;
      
      	spin_lock(s);
      	smp_mb__after_unlock_lock();
      	WRITE_ONCE(*y, 1);
      	r0 = READ_ONCE(*z);
      	spin_unlock(s);
      }
      
      P2(int *z, int *x)
      {
      	int r0;
      
      	WRITE_ONCE(*z, 1);
      	smp_mb();
      	r0 = READ_ONCE(*x);
      }
      
      exists (0:r0=0 /\ 1:r0=0 /\ 2:r0=0)
      Signed-off-by: default avatarAndrea Parri <andrea.parri@amarulasolutions.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
      Cc: Akira Yokosawa <akiyks@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Daniel Lustig <dlustig@nvidia.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Jade Alglave <j.alglave@ucl.ac.uk>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Luc Maranget <luc.maranget@inria.fr>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: parri.andrea@gmail.com
      Link: http://lkml.kernel.org/r/20181203230451.28921-1-paulmck@linux.ibm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5b735eb1
  3. 18 Jan, 2019 4 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · d7393226
      Linus Torvalds authored
      Pull rdma fixes frfom Jason Gunthorpe:
       "Not much so far. We have the usual batch of bugs and two fixes to code
        merged this cycle:
      
         - Restore valgrind support for the ioctl verbs interface merged this
           window, and fix a missed error code on an error path from that
           conversion
      
         - A user reported crash on obsolete mthca hardware
      
         - pvrdma was using the wrong command opcode toward the hypervisor
      
         - NULL pointer crash regression when dumping rdma-cm over netlink
      
         - Be conservative about exposing the global rkey"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/uverbs: Mark ioctl responses with UVERBS_ATTR_F_VALID_OUTPUT
        RDMA/mthca: Clear QP objects during their allocation
        RDMA/vmw_pvrdma: Return the correct opcode when creating WR
        RDMA/cma: Add cm_id restrack resource based on kernel or user cm_id type
        RDMA/nldev: Don't expose unsafe global rkey to regular user
        RDMA/uverbs: Fix post send success return value in case of error
      d7393226
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2019-01-18' of git://anongit.freedesktop.org/drm/drm · 1092a94f
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "The rc3 fixes are a bit scattered:
      
         - meson, sun4i and rockchip all had missing of_node_put.
      
         - qxl and virtio both were advertising dma-buf to userspace when they
           really shouldn't have.
      
        Otherwise:
      
        meson:
         - modesetting regression fix
      
        i915 GVT:
         - one cmd parser failure fix
         - region cleanup fix in vGPU destroy
      
        amdgpu:
         - KFD fixes for arm64 mixed APU/DGPU
         - vega12 powerplay fix
         - raven DC fixes
         - freesync fix"
      
      * tag 'drm-fixes-2019-01-18' of git://anongit.freedesktop.org/drm/drm:
        drm/amd/display: Detach backlight from stream
        drm/sun4i: backend: add missing of_node_puts
        Revert "drm/amdgpu: validate user pitch alignment"
        Revert "drm/amdgpu: validate user GEM object size"
        drm/meson: Fix atomic mode switching regression
        drm/i915/gvt: Fix mmap range check
        drm/i915/gvt: free VFIO region space in vgpu detach
        drm/amd/display: Fix disabled cursor on top screen edge
        drm/amd/display: fix warning on raven hotplug
        drm/amd/display: fix PME notification not working in RV desktop
        drm/amd/display: Only get the connector state for VRR when toggled
        drm/amd/display: Pack DMCU iRAM alignment
        drm/amd/powerplay: run acg btc for Vega12
        drm/amdkfd: Don't assign dGPUs to APU topology devices
        drm/amdkfd: Allow building KFD on ARM64 (v2)
        drm/meson: add missing of_node_put
        drm/virtio: drop prime import/export callbacks
        drm/qxl: drop prime import/export callbacks
        drm/i915/gvt: Allow F_CMD_ACCESS on mmio 0x21f0
        drm/rockchip: add missing of_node_put
      1092a94f
    • Linus Torvalds's avatar
      Merge tag 'led-fix-for-5.0-rc3' of... · 2451f371
      Linus Torvalds authored
      Merge tag 'led-fix-for-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
      
      Pull LED fix from Jacek Anaszewski.
      
      * tag 'led-fix-for-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
        leds: lp5523: fix a missing check of return value of lp55xx_read
      2451f371
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.0-rc3' of... · 0a2fbed8
      Linus Torvalds authored
      Merge tag 'hwmon-for-v5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
       "Minor fixes/regressions"
      
      * tag 'hwmon-for-v5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (tmp421) Correct the misspelling of the tmp442 compatible attribute in OF device ID table
        hwmon: (occ) Fix potential integer overflow
        hwmon: (lm80) Fix missing unlock on error in set_fan_div()
        hwmon: (nct6775) Enable IO mapping for NCT6797D and NCT6798D
        hwmon: (nct6775) Fix chip ID for NCT6798D
      0a2fbed8
  4. 17 Jan, 2019 18 commits
  5. 16 Jan, 2019 9 commits