Skip to content
Snippets Groups Projects
  1. May 15, 2019
    • Suren Baghdasaryan's avatar
      psi: introduce psi monitor · 0e94682b
      Suren Baghdasaryan authored
      Psi monitor aims to provide a low-latency short-term pressure detection
      mechanism configurable by users.  It allows users to monitor psi metrics
      growth and trigger events whenever a metric raises above user-defined
      threshold within user-defined time window.
      
      Time window and threshold are both expressed in usecs.  Multiple psi
      resources with different thresholds and window sizes can be monitored
      concurrently.
      
      Psi monitors activate when system enters stall state for the monitored
      psi metric and deactivate upon exit from the stall state.  While system
      is in the stall state psi signal growth is monitored at a rate of 10
      times per tracking window.  Min window size is 500ms, therefore the min
      monitoring interval is 50ms.  Max window size is 10s with monitoring
      interval of 1s.
      
      When activated psi monitor stays active for at least the duration of one
      tracking window to avoid repeated activations/deactivations when psi
      signal is bouncing.
      
      Notifications to the users are rate-limited to one per tracking window.
      
      Link: http://lkml.kernel.org/r/20190319235619.260832-8-surenb@google.com
      
      
      Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Dennis Zhou <dennis@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0e94682b
  2. Apr 06, 2019
  3. Oct 26, 2018
  4. Sep 23, 2016
  5. Apr 27, 2016
  6. Dec 24, 2015
  7. Sep 26, 2014
  8. Jun 23, 2014
  9. Jul 03, 2013
  10. Nov 26, 2012
  11. Sep 01, 2012
  12. Jun 16, 2011
  13. May 27, 2011
  14. Dec 23, 2010
    • Jeff Mahoney's avatar
      taskstats: pad taskstats netlink response for aligment issues on ia64 · 4be2c95d
      Jeff Mahoney authored
      
      The taskstats structure is internally aligned on 8 byte boundaries but the
      layout of the aggregrate reply, with two NLA headers and the pid (each 4
      bytes), actually force the entire structure to be unaligned.  This causes
      the kernel to issue unaligned access warnings on some architectures like
      ia64.  Unfortunately, some software out there doesn't properly unroll the
      NLA packet and assumes that the start of the taskstats structure will
      always be 20 bytes from the start of the netlink payload.  Aligning the
      start of the taskstats structure breaks this software, which we don't
      want.  So, for now the alignment only happens on architectures that
      require it and those users will have to update to fixed versions of those
      packages.  Space is reserved in the packet only when needed.  This ifdef
      should be removed in several years e.g.  2012 once we can be confident
      that fixed versions are installed on most systems.  We add the padding
      before the aggregate since the aggregate is already a defined type.
      
      Commit 85893120 ("delayacct: align to 8 byte boundary on 64-bit systems")
      previously addressed the alignment issues by padding out the pid field.
      This was supposed to be a compatible change but the circumstances
      described above mean that it wasn't.  This patch backs out that change,
      since it was a hack, and introduces a new NULL attribute type to provide
      the padding.  Padding the response with 4 bytes avoids allocating an
      aligned taskstats structure and copying it back.  Since the structure
      weighs in at 328 bytes, it's too big to do it on the stack.
      
      Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
      Reported-by: default avatarBrian Rogers <brian@xyzw.org>
      Cc: Jeff Mahoney <jeffm@suse.com>
      Cc: Guillaume Chazarain <guichaz@gmail.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4be2c95d
  15. Oct 28, 2010
    • Mel Gorman's avatar
      delay-accounting: reimplement -c for getdelays.c to report information on a target command · db9e5679
      Mel Gorman authored
      
      Task delay-accounting was identified as one means of determining how long
      a process spends in congestion_wait() without adding new statistics.  For
      example, if the workload should not be doing IO, delay-accounting could
      reveal how long it was spending in unexpected IO or delays.
      Unfortunately, on closer examination it was clear that getdelays does not
      act as documented.
      
      Commit a3baf649 ("per-task-delay-accounting: documentation") added
      Documentation/accounting/getdelays.c with a -c switch that was documented
      to fork/exec a child and report statistics on it but for reasons that are
      unclear to me, commit 9e06d3f9 deleted support for this switch but did not
      update the documentation.  It might be an oversight or it might be because
      the control flow of the program meant that accounting information would be
      printed once early in the lifetime of the program making it of limited
      use.
      
      This patch reimplements -c for getdelays.c to act as documented.  Unlike
      the original version, it waits until the command completes before printing
      any information on it.  An example of it being used looks like
      
      $ ./getdelays -d -c find /home/mel -name mel
      print delayacct stats ON
      /home/mel
      /home/mel/.notes-wine/drive_c/windows/profiles/mel
      /home/mel/.wine/drive_c/windows/profiles/mel
      /home/mel/git-configs/dot.kde/share/apps/konqueror/home/mel
      PID	5923
      
      CPU             count     real total  virtual total    delay total
                      42779     5051232096     5164722692      564207988
      IO              count    delay total
                      41727    97804147758
      SWAP            count    delay total
                          0              0
      RECLAIM         count    delay total
                          0              0
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: default avatarMel Gorman <mel@csn.ul.ie>
      Acked-by: default avatarBalbir Singh <balbir@in.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      db9e5679
  16. Sep 23, 2009
  17. Jun 17, 2009
  18. Jan 16, 2009
  19. Oct 30, 2008
  20. Aug 12, 2008
    • Randy Dunlap's avatar
      docsrc: fix getdelays printk formats · 66659313
      Randy Dunlap authored
      
      Fix printf format type warnings (seen on alpha & ia64):
      
      Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 6 has type '__u64'
      Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 7 has type '__u64'
      Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 8 has type '__u64'
      Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 9 has type '__u64'
      Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 12 has type '__u64'
      Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 13 has type '__u64'
      Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 16 has type '__u64'
      Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 17 has type '__u64'
      Documentation/accounting/getdelays.c:214: warning: format '%15llu' expects type 'long long unsigned int', but argument 4 has type '__u64'
      Documentation/accounting/getdelays.c:214: warning: format '%15llu' expects type 'long long unsigned int', but argument 5 has type '__u64'
      Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 2 has type '__u64'
      Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type '__u64'
      Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 4 has type '__u64'
      Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 5 has type '__u64'
      Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 6 has type '__u64'
      Documentation/accounting/getdelays.c:236: warning: 'cmd_type' may be used uninitialized in this function
      
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      66659313
    • Randy Dunlap's avatar
      docsrc: build Documentation/ sources · 3794f3e8
      Randy Dunlap authored
      
      Currently source files in the Documentation/ sub-dir can easily bit-rot
      since they are not generally buildable, either because they are hidden in
      text files or because there are no Makefile rules for them.  This needs to
      be fixed so that the source files remain usable and good examples of code
      instead of bad examples.
      
      Add the ability to build source files that are in the Documentation/ dir.
      Add to Kconfig as "BUILD_DOCSRC" config symbol.
      
      Use "CONFIG_BUILD_DOCSRC=1 make ..." to build objects from the
      Documentation/ sources.  Or enable BUILD_DOCSRC in the *config system.
      However, this symbol depends on HEADERS_CHECK since the header files need
      to be installed (for userspace builds).
      
      Built (using cross-tools) for x86-64, i386, alpha, ia64, sparc32,
      sparc64, powerpc, sh, m68k, & mips.
      
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3794f3e8
  21. Jul 26, 2008
  22. Jul 25, 2008
  23. Jul 04, 2008
  24. Feb 08, 2008
    • Randy Dunlap's avatar
      getdelays: fix gcc warnings · 10e6f32b
      Randy Dunlap authored
      
      Fix gcc warnings in getdelays.c:
      
      Documentation/accounting/getdelays.c: In function 'task_context_switch_counts':
      Documentation/accounting/getdelays.c:214: warning: format '%15lu' expects type 'long unsigned int', but argument 4 has type '__u64'
      Documentation/accounting/getdelays.c:214: warning: format '%15lu' expects type 'long unsigned int', but argument 5 has type '__u64'
      Documentation/accounting/getdelays.c: In function 'main':
      Documentation/accounting/getdelays.c:402: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
      Documentation/accounting/getdelays.c: In function 'get_family_id':
      Documentation/accounting/getdelays.c:171: warning: 'id' may be used uninitialized in this function
      
      One warning is not a problem and can be dismissed:
      Documentation/accounting/getdelays.c: In function 'main':
      Documentation/accounting/getdelays.c:236: warning: 'cmd_type' may be used uninitialized in this function
      
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Acked-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      10e6f32b
  25. Nov 15, 2007
  26. Oct 19, 2007
    • Balbir Singh's avatar
      Add cgroupstats · 846c7bb0
      Balbir Singh authored
      This patch is inspired by the discussion at
      http://lkml.org/lkml/2007/4/11/187 and implements per cgroup statistics
      as suggested by Andrew Morton in http://lkml.org/lkml/2007/4/11/263
      
      .  The
      patch is on top of 2.6.21-mm1 with Paul's cgroups v9 patches (forward
      ported)
      
      This patch implements per cgroup statistics infrastructure and re-uses
      code from the taskstats interface.  A new set of cgroup operations are
      registered with commands and attributes.  It should be very easy to
      *extend* per cgroup statistics, by adding members to the cgroupstats
      structure.
      
      The current model for cgroupstats is a pull, a push model (to post
      statistics on interesting events), should be very easy to add.  Currently
      user space requests for statistics by passing the cgroup file
      descriptor.  Statistics about the state of all the tasks in the cgroup
      is returned to user space.
      
      TODO's/NOTE:
      
      This patch provides an infrastructure for implementing cgroup statistics.
      Based on the needs of each controller, we can incrementally add more statistics,
      event based support for notification of statistics, accumulation of taskstats
      into cgroup statistics in the future.
      
      Sample output
      
      # ./cgroupstats -C /cgroup/a
      sleeping 2, blocked 0, running 1, stopped 0, uninterruptible 0
      
      # ./cgroupstats -C /cgroup/
      sleeping 154, blocked 0, running 0, stopped 0, uninterruptible 0
      
      If the approach looks good, I'll enhance and post the user space utility for
      the same
      
      Feedback, comments, test results are always welcome!
      
      [akpm@linux-foundation.org: build fix]
      Signed-off-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
      Cc: Paul Menage <menage@google.com>
      Cc: Jay Lan <jlan@engr.sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      846c7bb0
  27. Oct 17, 2007
  28. Aug 23, 2007
  29. Jul 16, 2007
    • Maxim Uvarov's avatar
      taskstats: add context-switch counters · b663a79c
      Maxim Uvarov authored
      
      Make available to the user the following task and process performance
      statistics:
      
      	* Involuntary Context Switches (task_struct->nivcsw)
      	* Voluntary Context Switches (task_struct->nvcsw)
      
      Statistics information is available from:
      	1. taskstats interface (Documentation/accounting/)
      	2. /proc/PID/status (task only).
      
      This data is useful for detecting hyperactivity patterns between processes.
      
      [akpm@linux-foundation.org: cleanup]
      Signed-off-by: default avatarMaxim Uvarov <muvarov@ru.mvista.com>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Jay Lan <jlan@engr.sgi.com>
      Cc: Jonathan Lim <jlim@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b663a79c
  30. May 08, 2007
  31. Dec 10, 2006
    • Andrew Morton's avatar
      [PATCH] io-accounting: add to getdelays · cf709844
      Andrew Morton authored
      
      Wire up the IO accounting into getdelays.c.
      
      Usage:
      
      To display I/O stats for each exitting task:
      
      vmm:/home/akpm> ./getdelays -m0,1,2,3 -i -l
      cpumask 0 maskset 1
      printing IO accounting
      listen forever
      rm: read=8192, write=0, cancelled_write=0
      cvs: read=733184, write=4255744, cancelled_write=4096
      make: read=217088, write=0, cancelled_write=0
      cc1: read=4263936, write=12288, cancelled_write=0
      as: read=811008, write=8192, cancelled_write=0
      gcc: read=323584, write=0, cancelled_write=12288
      cc1: read=0, write=8192, cancelled_write=0
      as: read=4096, write=4096, cancelled_write=0
      gcc: read=16384, write=0, cancelled_write=4096
      as: read=4096, write=4096, cancelled_write=0
      gcc: read=16384, write=0, cancelled_write=8192
      ld: read=1011712, write=16384, cancelled_write=0
      collect2: read=626688, write=0, cancelled_write=0
      gcc: read=204800, write=0, cancelled_write=0
      cc1: read=0, write=8192, cancelled_write=0
      as: read=4096, write=4096, cancelled_write=0
      gcc: read=16384, write=0, cancelled_write=8192
      ld: read=8192, write=16384, cancelled_write=0
      collect2: read=49152, write=0, cancelled_write=0
      gcc: read=0, write=0, cancelled_write=0
      cc1: read=0, write=4096, cancelled_write=0
      ld: read=4096, write=12288, cancelled_write=0
      collect2: read=49152, write=0, cancelled_write=0
      gcc: read=0, write=0, cancelled_write=0
      
      To display I/O stats for a particular presently-running task:
      
      vmm:/home/akpm> ./getdelays -i -p $(pidof crond)
      printing IO accounting
      crond: read=61440, write=0, cancelled_write=0
      
      Cc: Jay Lan <jlan@sgi.com>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Chris Sturtivant <csturtiv@sgi.com>
      Cc: Tony Ernst <tee@sgi.com>
      Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
      Cc: David Wright <daw@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      cf709844
    • Andrew Morton's avatar
      [PATCH] getdelays: various fixes · d2f7bf13
      Andrew Morton authored
      
      - Various cleanups
      
      - Report errors to stderr, not stdout
      
      - A printf was missing a \n and was hiding from me.
      
      Cc: Jay Lan <jlan@sgi.com>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Chris Sturtivant <csturtiv@sgi.com>
      Cc: Tony Ernst <tee@sgi.com>
      Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
      Cc: David Wright <daw@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d2f7bf13
  32. Nov 30, 2006
Loading