1. 06 2月, 2018 2 次提交
  2. 29 1月, 2018 3 次提交
    • J
      fs: handle inode->i_version more efficiently · f02a9ad1
      Jeff Layton 提交于
      Since i_version is mostly treated as an opaque value, we can exploit that
      fact to avoid incrementing it when no one is watching. With that change,
      we can avoid incrementing the counter on writes, unless someone has
      queried for it since it was last incremented. If the a/c/mtime don't
      change, and the i_version hasn't changed, then there's no need to dirty
      the inode metadata on a write.
      
      Convert the i_version counter to an atomic64_t, and use the lowest order
      bit to hold a flag that will tell whether anyone has queried the value
      since it was last incremented.
      
      When we go to maybe increment it, we fetch the value and check the flag
      bit.  If it's clear then we don't need to do anything if the update
      isn't being forced.
      
      If we do need to update, then we increment the counter by 2, and clear
      the flag bit, and then use a CAS op to swap it into place. If that
      works, we return true. If it doesn't then do it again with the value
      that we fetch from the CAS operation.
      
      On the query side, if the flag is already set, then we just shift the
      value down by 1 bit and return it. Otherwise, we set the flag in our
      on-stack value and again use cmpxchg to swap it into place if it hasn't
      changed. If it has, then we use the value from the cmpxchg as the new
      "old" value and try again.
      
      This method allows us to avoid incrementing the counter on writes (and
      dirtying the metadata) under typical workloads. We only need to increment
      if it has been queried since it was last changed.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Acked-by: NDave Chinner <dchinner@redhat.com>
      Tested-by: NKrzysztof Kozlowski <krzk@kernel.org>
      f02a9ad1
    • J
      fs: don't take the i_lock in inode_inc_iversion · 7594c461
      Jeff Layton 提交于
      The rationale for taking the i_lock when incrementing this value is
      lost in antiquity. The readers of the field don't take it (at least
      not universally), so my assumption is that it was only done here to
      serialize incrementors.
      
      If that is indeed the case, then we can drop the i_lock from this
      codepath and treat it as a atomic64_t for the purposes of
      incrementing it. This allows us to use inode_inc_iversion without
      any danger of lock inversion.
      
      Note that the read side is not fetched atomically with this change.
      The assumption here is that that is not a critical issue since the
      i_version is not fully synchronized with anything else anyway.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NJan Kara <jack@suse.cz>
      7594c461
    • J
      fs: new API for handling inode->i_version · ae5e165d
      Jeff Layton 提交于
      Add a documentation blob that explains what the i_version field is, how
      it is expected to work, and how it is currently implemented by various
      filesystems.
      
      We already have inode_inc_iversion. Add several other functions for
      manipulating and accessing the i_version counter. For now, the
      implementation is trivial and basically works the way that all of the
      open-coded i_version accesses work today.
      
      Future patches will convert existing users of i_version to use the new
      API, and then convert the backend implementation to do things more
      efficiently.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NJan Kara <jack@suse.cz>
      ae5e165d
  3. 26 1月, 2018 5 次提交
    • C
      regulator: add PM suspend and resume hooks · f7efad10
      Chunyan Zhang 提交于
      In this patch, consumers are allowed to set suspend voltage, and this
      actually just set the "uV" in constraint::regulator_state, when the
      regulator_suspend_late() was called by PM core through callback when
      the system is entering into suspend, the regulator device would act
      suspend activity then.
      
      And it assumes that if any consumer set suspend voltage, the regulator
      device should be enabled in the suspend state.  And if the suspend
      voltage of a regulator device for all consumers was set zero, the
      regulator device would be off in the suspend state.
      
      This patch also provides a new function hook to regulator devices for
      resuming from suspend states.
      Signed-off-by: NChunyan Zhang <zhang.chunyan@linaro.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      f7efad10
    • C
      regulator: empty the old suspend functions · aa27bbc6
      Chunyan Zhang 提交于
      Regualtor suspend/resume functions should only be called by PM suspend
      core via registering dev_pm_ops, and regulator devices should implement
      the callback functions.  Thus, any regulator consumer shouldn't call
      the regulator suspend/resume functions directly.
      
      In order to avoid compile errors, two empty functions with the same name
      still be left for the time being.
      Signed-off-by: NChunyan Zhang <zhang.chunyan@linaro.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      aa27bbc6
    • C
      regulator: leave one item to record whether regulator is enabled · 72069f99
      Chunyan Zhang 提交于
      The items "disabled" and "enabled" are a little redundant, since only one
      of them would be set to record if the regulator device should keep on
      or be switched to off in suspend states.
      
      So in this patch, the "disabled" was removed, only leave the "enabled":
        - enabled == 1 for regulator-on-in-suspend
        - enabled == 0 for regulator-off-in-suspend
        - enabled == -1 means do nothing when entering suspend mode.
      Signed-off-by: NChunyan Zhang <zhang.chunyan@linaro.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      72069f99
    • A
      module/retpoline: Warn about missing retpoline in module · caf7501a
      Andi Kleen 提交于
      There's a risk that a kernel which has full retpoline mitigations becomes
      vulnerable when a module gets loaded that hasn't been compiled with the
      right compiler or the right option.
      
      To enable detection of that mismatch at module load time, add a module info
      string "retpoline" at build time when the module was compiled with
      retpoline support. This only covers compiled C source, but assembler source
      or prebuilt object files are not checked.
      
      If a retpoline enabled kernel detects a non retpoline protected module at
      load time, print a warning and report it in the sysfs vulnerability file.
      
      [ tglx: Massaged changelog ]
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: gregkh@linuxfoundation.org
      Cc: torvalds@linux-foundation.org
      Cc: jeyu@kernel.org
      Cc: arjan@linux.intel.com
      Link: https://lkml.kernel.org/r/20180125235028.31211-1-andi@firstfloor.org
      caf7501a
    • N
      net: don't call update_pmtu unconditionally · f15ca723
      Nicolas Dichtel 提交于
      Some dst_ops (e.g. md_dst_ops)) doesn't set this handler. It may result to:
      "BUG: unable to handle kernel NULL pointer dereference at           (null)"
      
      Let's add a helper to check if update_pmtu is available before calling it.
      
      Fixes: 52a589d5 ("geneve: update skb dst pmtu on tx path")
      Fixes: a93bf0ff ("vxlan: update skb dst pmtu on tx path")
      CC: Roman Kapl <code@rkapl.cz>
      CC: Xin Long <lucien.xin@gmail.com>
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f15ca723
  4. 25 1月, 2018 3 次提交
  5. 24 1月, 2018 3 次提交
  6. 22 1月, 2018 5 次提交
  7. 21 1月, 2018 1 次提交
  8. 20 1月, 2018 4 次提交
  9. 19 1月, 2018 2 次提交
  10. 18 1月, 2018 4 次提交
  11. 17 1月, 2018 6 次提交
  12. 16 1月, 2018 2 次提交
    • A
      blkcg: simplify statistic accumulation code · ddc21231
      Arnd Bergmann 提交于
      Some older compilers (gcc-4.4 through 4.6 in particular) struggle
      with the way that blkg_rwstat_read() returns a structure, leading
      to excessive stack usage and rather inefficient code:
      
      block/blk-cgroup.c: In function 'blkg_destroy':
      block/blk-cgroup.c:354:1: error: the frame size of 1296 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
      block/cfq-iosched.c: In function 'cfqg_stats_add_aux':
      block/cfq-iosched.c:753:1: error: the frame size of 1928 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
      block/bfq-cgroup.c: In function 'bfqg_stats_add_aux':
      block/bfq-cgroup.c:299:1: error: the frame size of 1928 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
      
      I also notice that there is no point in using atomic accesses
      for the local variables, so storing the temporaries in simple 'u64'
      variables not only avoids the stack usage on older compilers but
      also improves the object code on modern versions.
      
      Fixes: e6269c44 ("blkcg: add blkg_[rw]stat->aux_cnt and replace cfq_group->dead_stats with it")
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ddc21231
    • F
      nubus: Add support for the driver model · 7f86c765
      Finn Thain 提交于
      This patch brings basic support for the Linux Driver Model to the
      NuBus subsystem.
      
      For flexibility, the matching of boards with drivers is left up to the
      drivers. This is also the approach taken by NetBSD. A board may have
      many functions, and drivers may have to consider many functional
      resources and board resources in order to match a device.
      
      This implementation does not bind drivers to resources (nor does it bind
      many drivers to the same board). Apple's NuBus declaration ROM design
      is flexible enough to allow that, but I don't see a need to support it
      as we don't use the "slot zero" resources (in the main logic board ROM).
      
      Eliminate the global nubus_boards linked list by rewriting the procfs
      board iterator around bus_for_each_dev(). Hence the nubus device refcount
      can be used to determine the lifespan of board objects.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Tested-by: NStan Johnson <userm57@yahoo.com>
      Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      7f86c765