1. 22 5月, 2015 2 次提交
  2. 16 4月, 2015 7 次提交
    • S
      zram: deprecate zram attrs sysfs nodes · 8f7d282c
      Sergey Senozhatsky 提交于
      Add Documentation/ABI/obsolete/sysfs-block-zram file and list obsolete and
      deprecated attributes there.  The patch also adds additional information
      to zram documentation and describes the basic strategy:
      
      - the existing RW nodes will be downgraded to WO nodes (in 4.11)
      - deprecated RO sysfs nodes will eventually be removed (in 4.11)
      
      Users will be additionally notified about deprecated attr usage by
      pr_warn_once() (added to every deprecated attr _show()), as suggested by
      Minchan Kim.
      
      User space is advised to use zram<id>/stat, zram<id>/io_stat and
      zram<id>/mm_stat files.
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Reported-by: NMinchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8f7d282c
    • S
      zram: export new 'mm_stat' sysfs attrs · 4f2109f6
      Sergey Senozhatsky 提交于
      Per-device `zram<id>/mm_stat' file provides mm statistics of a particular
      zram device in a format similar to block layer statistics.  The file
      consists of a single line and represents the following stats (separated by
      whitespace):
      
              orig_data_size
              compr_data_size
              mem_used_total
              mem_limit
              mem_used_max
              zero_pages
              num_migrated
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4f2109f6
    • S
      zram: export new 'io_stat' sysfs attrs · 2f6a3bed
      Sergey Senozhatsky 提交于
      Per-device `zram<id>/io_stat' file provides accumulated I/O statistics of
      particular zram device in a format similar to block layer statistics.  The
      file consists of a single line and represents the following stats
      (separated by whitespace):
      
              failed_reads
              failed_writes
              invalid_io
              notify_free
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2f6a3bed
    • S
      zram: remove `num_migrated' device attr · 10447b60
      Sergey Senozhatsky 提交于
      This patch introduces rework to zram stats.  We have per-stat sysfs nodes,
      and it makes things a bit hard to use in user space: it doesn't give an
      immediate stats 'snapshot', it requires user space to use more syscalls -
      open, read, close for every stat file, with appropriate error checks on
      every step, etc.
      
      First, zram now accounts block layer statistics, available in
      /sys/block/zram<id>/stat and /proc/diskstats files.  So some new stats are
      available (see Documentation/block/stat.txt), besides, zram's activities
      now can be monitored by sysstat's iostat or similar tools.
      
      Example:
      cat /sys/block/zram0/stat
      248     0    1984    0   251029     0  2008232   5120   0   5116   5116
      
      Second, group currently exported on per-stat basis nodes into two
      categories (files):
      
      -- zram<id>/io_stat
      accumulates device's IO stats, that are not accounted by block layer,
      and contains:
              failed_reads
              failed_writes
              invalid_io
              notify_free
      
      Example:
      cat /sys/block/zram0/io_stat
      0        0        0   652572
      
      -- zram<id>/mm_stat
      accumulates zram mm stats and contains:
              orig_data_size
              compr_data_size
              mem_used_total
              mem_limit
              mem_used_max
              zero_pages
              num_migrated
      
      Example:
      cat /sys/block/zram0/mm_stat
      434634752 270288572 279158784        0 579895296    15060        0
      
      per-stat sysfs nodes are now considered to be deprecated and we plan to
      remove them (and clean up some of the existing stat code) in two years (as
      of now, there is no warning printed to syslog about deprecated stats being
      used).  User space is advised to use the above mentioned 3 files.
      
      This patch (of 7):
      
      Remove sysfs `num_migrated' attribute.  We are moving away from per-stat
      device attrs towards 3 stat files that will accumulate io and mm stats in
      a format similar to block layer statistics in /sys/block/<dev>/stat.  That
      will be easier to use in user space, and reduce the number of syscalls
      needed to read zram device statistics.
      
      `num_migrated' will return back in zram<id>/mm_stat file.
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      10447b60
    • M
      zram: support compaction · 4e3ba878
      Minchan Kim 提交于
      Now that zsmalloc supports compaction, zram can use it.  For the first
      step, this patch exports compact knob via sysfs so user can do compaction
      via "echo 1 > /sys/block/zram0/compact".
      Signed-off-by: NMinchan Kim <minchan@kernel.org>
      Cc: Juneho Choi <juno.choi@lge.com>
      Cc: Gunho Lee <gunho.lee@lge.com>
      Cc: Luigi Semenzato <semenzato@google.com>
      Cc: Dan Streetman <ddstreet@ieee.org>
      Cc: Seth Jennings <sjennings@variantweb.net>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4e3ba878
    • M
      dm: add 'use_blk_mq' module param and expose in per-device ro sysfs attr · 17e149b8
      Mike Snitzer 提交于
      Request-based DM's blk-mq support defaults to off; but a user can easily
      change the default using the dm_mod.use_blk_mq module/boot option.
      
      Also, you can check what mode a given request-based DM device is using
      with: cat /sys/block/dm-X/dm/use_blk_mq
      
      This change enabled further cleanup and reduced work (e.g. the
      md->io_pool and md->rq_pool isn't created if using blk-mq).
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      17e149b8
    • M
      dm: impose configurable deadline for dm_request_fn's merge heuristic · 0ce65797
      Mike Snitzer 提交于
      Otherwise, for sequential workloads, the dm_request_fn can allow
      excessive request merging at the expense of increased service time.
      
      Add a per-device sysfs attribute to allow the user to control how long a
      request, that is a reasonable merge candidate, can be queued on the
      request queue.  The resolution of this request dispatch deadline is in
      microseconds (ranging from 1 to 100000 usecs), to set a 20us deadline:
        echo 20 > /sys/block/dm-7/dm/rq_based_seq_io_merge_deadline
      
      The dm_request_fn's merge heuristic and associated extra accounting is
      disabled by default (rq_based_seq_io_merge_deadline is 0).
      
      This sysfs attribute is not applicable to bio-based DM devices so it
      will only ever report 0 for them.
      
      By allowing a request to remain on the queue it will block others
      requests on the queue.  But introducing a short dequeue delay has proven
      very effective at enabling certain sequential IO workloads on really
      fast, yet IOPS constrained, devices to build up slightly larger IOs --
      yielding 90+% throughput improvements.  Having precise control over the
      time taken to wait for larger requests to build affords control beyond
      that of waiting for certain IO sizes to accumulate (which would require
      a deadline anyway).  This knob will only ever make sense with sequential
      IO workloads and the particular value used is storage configuration
      specific.
      
      Given the expected niche use-case for when this knob is useful it has
      been deemed acceptable to expose this relatively crude method for
      crafting optimal IO on specific storage -- especially given the solution
      is simple yet effective.  In the context of DM multipath, it is
      advisable to tune this sysfs attribute to a value that offers the best
      performance for the common case (e.g. if 4 paths are expected active,
      tune for that; if paths fail then performance may be slightly reduced).
      
      Alternatives were explored to have request-based DM autotune this value
      (e.g. if/when paths fail) but they were quickly deemed too fragile and
      complex to warrant further design and development time.  If this problem
      proves more common as faster storage emerges we'll have to look at
      elevating a generic solution into the block core.
      Tested-by: NShiva Krishna Merla <shivakrishna.merla@netapp.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      0ce65797
  3. 08 4月, 2015 2 次提交
  4. 06 4月, 2015 1 次提交
  5. 31 3月, 2015 1 次提交
  6. 29 3月, 2015 3 次提交
    • M
      Documentation/ABI:iio:fix typo · 5798cd23
      Martin Kepplinger 提交于
      Signed-off-by: NMartin Kepplinger <martink@posteo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      5798cd23
    • O
      iio: add support for hardware fifo · f4f4673b
      Octavian Purdila 提交于
      Some devices have hardware buffers that can store a number of samples
      for later consumption. Hardware usually provides interrupts to notify
      the processor when the FIFO is full or when it has reached a certain
      watermark level. This helps with reducing the number of interrupts to
      the host processor and thus it helps decreasing the power consumption.
      
      This patch enables usage of hardware FIFOs for IIO devices in
      conjunction with software device buffers. When the hardware FIFO is
      enabled the samples are stored in the hardware FIFO. The samples are
      later flushed to the device software buffer when the number of entries
      in the hardware FIFO reaches the hardware watermark or when a flush
      operation is triggered by the user when doing a non-blocking read
      on an empty software device buffer.
      
      In order to implement hardware FIFO support the device drivers must
      implement the following new operations: setting and getting the
      hardware FIFO watermark level, flushing the hardware FIFO to the
      software device buffer. The device must also expose information about
      the hardware FIFO such it's minimum and maximum watermark and if
      necessary a list of supported watermark values. Finally, the device
      driver must activate the hardware FIFO when the device buffer is
      enabled, if the current device settings allows it.
      
      The software device buffer watermark is passed by the IIO core to the
      device driver as a hint for the hardware FIFO watermark. The device
      driver can adjust this value to allow for hardware limitations (such
      as capping it to the maximum hardware watermark or adjust it to a
      value that is supported by the hardware). It can also disable the
      hardware watermark (and implicitly the hardware FIFO) it this value is
      below the minimum hardware watermark.
      
      Since a driver may support hardware FIFO only when not in triggered
      buffer mode (due to different semantics of hardware FIFO sampling and
      triggered sampling) this patch changes the IIO core code to allow
      falling back to non-triggered buffered mode if no trigger is enabled.
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Reviewed-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      f4f4673b
    • J
      iio: add watermark logic to iio read and poll · 37d34556
      Josselin Costanzi 提交于
      Currently the IIO buffer blocking read only wait until at least one
      data element is available.
      This patch makes the reader sleep until enough data is collected before
      returning to userspace. This should limit the read() calls count when
      trying to get data in batches.
      
      Co-author: Yannick Bedhomme <yannick.bedhomme@mobile-devices.fr>
      Signed-off-by: NJosselin Costanzi <josselin.costanzi@mobile-devices.fr>
      [rebased and remove buffer timeout]
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Reviewed-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      37d34556
  7. 28 3月, 2015 2 次提交
  8. 27 3月, 2015 1 次提交
  9. 25 3月, 2015 1 次提交
    • B
      drivers/core/of: Add symlink to device-tree from devices with an OF node · 5590f319
      Benjamin Herrenschmidt 提交于
      So I've been annoyed lately with having a bunch of devices such as i2c
      eeproms (for use by VPDs, server world !) and other bits and pieces that
      I want to be able to identify from userspace, and possibly provide
      additional data about from FW.
      
      Basically, it boils down to correlating the sysfs device with the OF
      tree device node, so that user space can use device-tree info such as
      additional "location" or "label" (or whatever else we can come up with)
      propreties to identify a given device, or get some attributes of use
      about it, etc...
      
      Now, so far, we've done that in some subsystem in a fairly ad-hoc basis
      using "devspec" properties. For example, PCI creates them if it can
      correlate the probed device with a DT node. Some powerpc specific busses
      do that too.
      
      However, i2c doesn't and it would be nice to have something more generic
      since technically any device can have a corresponding device tree node.
      
      This patch adds an "of_node" symlink to devices that have a non-NULL
      dev->of_node pointer, the patch is pretty trivial and seems to work just
      fine for me.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5590f319
  10. 19 3月, 2015 2 次提交
  11. 15 3月, 2015 3 次提交
  12. 11 3月, 2015 1 次提交
  13. 10 3月, 2015 1 次提交
  14. 09 3月, 2015 1 次提交
  15. 23 2月, 2015 1 次提交
    • O
      HID: expose country code in sysfs · a877417e
      Olivier Gay 提交于
      This commit exposes in sysfs the HID country code that is stored in the country
      member of hid_device structure. It identifies the country code of localized
      hardware.
      
      For example some keyboards use it to exhibit the language of the key layout. It
      helps the upper layer to identify the localized hardware and setup the correct
      language to use.
      
      For USB HID devices the country code comes for the HID descriptor and for
      Bluetooth HID devices it is the HIDCountryCode attribute from the SDP database.
      Signed-off-by: NOlivier Gay <ogay@logitech.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      a877417e
  16. 19 2月, 2015 2 次提交
  17. 12 2月, 2015 2 次提交
  18. 10 2月, 2015 1 次提交
  19. 07 2月, 2015 1 次提交
    • J
      samsung-laptop: enable better lid handling · b0dcaf4f
      Julijonas Kikutis 提交于
      Some Samsung laptops with SABI3 delay the sleep for 10 seconds after
      the lid is closed and do not wake up from sleep after the lid is opened.
      A SABI command is needed to enable the better behavior.
      
      Command = 0x6e, d0 = 0x81 enables this behavior. Returns d0 = 0x01.
      Command = 0x6e, d0 = 0x80 disables this behavior. Returns d0 = 0x00.
      
      Command = 0x6d and any d0 queries the state. This returns:
      d0 = 0x00000*01, d1 = 0x00, d2 = 0x00, d3 = 0x0* when it is enabled.
      d0 = 0x00000*00, d1 = 0x00, d2 = 0x00, d3 = 0x0* when it is disabled.
      Where * is 0 - laptop has never slept or hibernated after switch on,
                 1 - laptop has hibernated just before,
                 2 - laptop has slept just before.
      
      Patch addresses bug https://bugzilla.kernel.org/show_bug.cgi?id=75901 .
      It adds a sysfs attribute lid_handling with a description and also an
      addition to the quirks structure to enable the mode by default.
      
      A user with another laptop in the bug report says that "power button has
      to be pressed twice to wake the machine" when he or she enabled the mode
      manually using the SABI command. Therefore, it is enabled by default
      only for the single laptop that I have tested.
      Signed-off-by: NJulijonas Kikutis <julijonas.kikutis@gmail.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      b0dcaf4f
  20. 06 2月, 2015 1 次提交
    • I
      cxl: Export optional AFU configuration record in sysfs · b087e619
      Ian Munsie 提交于
      An AFU may optionally contain one or more PCIe like configuration
      records, which can be used to identify the AFU.
      
      This patch adds support for exposing the raw config space and the
      vendor, device and class code under sysfs. These will appear in a
      subdirectory of the AFU device corresponding with the configuration
      record number, e.g.
      
      cat /sys/class/cxl/afu0.0/cr0/vendor
      0x1014
      
      cat /sys/class/cxl/afu0.0/cr0/device
      0x4350
      
      cat /sys/class/cxl/afu0.0/cr0/class
      0x120000
      
      hexdump -C /sys/class/cxl/afu0.0/cr0/config
      00000000  14 10 50 43 00 00 00 00  06 00 00 12 00 00 00 00  |..PC............|
      00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
      *
      00000100
      
      These files behave in much the same way as the equivalent files for PCI
      devices, with one exception being that the config file is currently
      read-only and restricted to the root user. It is not necessarily
      required to be this strict, but we currently do not have a compelling
      use-case to make it writable and/or world-readable, so I erred on the
      side of being restrictive.
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b087e619
  21. 02 2月, 2015 1 次提交
  22. 31 1月, 2015 1 次提交
  23. 30 1月, 2015 2 次提交