1. 28 Sep, 2017 1 commit
    • Dennis Zhou's avatar
      percpu: fix iteration to prevent skipping over block · 1fa4df3e
      Dennis Zhou authored
      The iterator functions pcpu_next_md_free_region and
      pcpu_next_fit_region use the block offset to determine if they have
      checked the area in the prior iteration. However, this causes an issue
      when the block offset is greater than subsequent block contig hints. If
      within the iterator it moves to check subsequent blocks, it may fail in
      the second predicate due to the block offset not being cleared. Thus,
      this causes the allocator to skip over blocks leading to false failures
      when allocating from the reserved chunk. While this happens in the
      general case as well, it will only fail if it cannot allocate a new
      chunk.
      
      This patch resets the block offset to 0 to pass the second predicate
      when checking subseqent blocks within the iterator function.
      Signed-off-by: default avatarDennis Zhou <dennisszhou@gmail.com>
      Reported-and-tested-by: default avatarLuis Henriques <lhenriques@suse.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      1fa4df3e
  2. 27 Sep, 2017 1 commit
  3. 26 Sep, 2017 3 commits
    • Mark Rutland's avatar
      percpu: make this_cpu_generic_read() atomic w.r.t. interrupts · e88d62cd
      Mark Rutland authored
      As raw_cpu_generic_read() is a plain read from a raw_cpu_ptr() address,
      it's possible (albeit unlikely) that the compiler will split the access
      across multiple instructions.
      
      In this_cpu_generic_read() we disable preemption but not interrupts
      before calling raw_cpu_generic_read(). Thus, an interrupt could be taken
      in the middle of the split load instructions. If a this_cpu_write() or
      RMW this_cpu_*() op is made to the same variable in the interrupt
      handling path, this_cpu_read() will return a torn value.
      
      For native word types, we can avoid tearing using READ_ONCE(), but this
      won't work in all cases (e.g. 64-bit types on most 32-bit platforms).
      This patch reworks this_cpu_generic_read() to use READ_ONCE() where
      possible, otherwise falling back to disabling interrupts.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Pranith Kumar <bobby.prani@gmail.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-arch@vger.kernel.org
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      e88d62cd
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · e365806a
      Linus Torvalds authored
      Pull compat fix from Al Viro:
       "I really wish gcc warned about conversions from pointer to function
        into void *..."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fix a typo in put_compat_shm_info()
      e365806a
    • Al Viro's avatar
      fix a typo in put_compat_shm_info() · b776e4b1
      Al Viro authored
      "uip" misspelled as "up"; unfortunately, the latter happens to be
      a function and gcc is happy to convert it to void *...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      b776e4b1
  4. 25 Sep, 2017 35 commits