Skip to content
Snippets Groups Projects
  1. Jul 31, 2023
  2. Apr 18, 2023
    • Yang Yang's avatar
      delayacct: track delays from IRQ/SOFTIRQ · a3b2aeac
      Yang Yang authored
      Delay accounting does not track the delay of IRQ/SOFTIRQ.  While
      IRQ/SOFTIRQ could have obvious impact on some workloads productivity, such
      as when workloads are running on system which is busy handling network
      IRQ/SOFTIRQ.
      
      Get the delay of IRQ/SOFTIRQ could help users to reduce such delay.  Such
      as setting interrupt affinity or task affinity, using kernel thread for
      NAPI etc.  This is inspired by "sched/psi: Add PSI_IRQ to track
      IRQ/SOFTIRQ pressure"[1].  Also fix some code indent problems of older
      code.
      
      And update tools/accounting/getdelays.c:
          / # ./getdelays -p 156 -di
          print delayacct stats ON
          printing IO accounting
          PID     156
      
          CPU             count     real total  virtual total    delay total  delay average
                             15       15836008       16218149      275700790         18.380ms
          IO              count    delay total  delay average
                              0              0          0.000ms
          SWAP            count    delay total  delay average
                              0              0          0.000ms
          RECLAIM         count    delay total  delay average
                              0              0          0.000ms
          THRASHING       count    delay total  delay average
                              0              0          0.000ms
          COMPACT         count    delay total  delay average
                              0              0          0.000ms
          WPCOPY          count    delay total  delay average
                             36        7586118          0.211ms
          IRQ             count    delay total  delay average
                             42         929161          0.022ms
      
      [1] commit 52b1364b("sched/psi: Add PSI_IRQ to track IRQ/SOFTIRQ pressure")
      
      Link: https://lkml.kernel.org/r/202304081728353557233@zte.com.cn
      
      
      Signed-off-by: default avatarYang Yang <yang.yang29@zte.com.cn>
      Cc: Jiang Xuexin <jiang.xuexin@zte.com.cn>
      Cc: wangyong <wang.yong12@zte.com.cn>
      Cc: junhua huang <huang.junhua@zte.com.cn>
      Cc: Balbir Singh <bsingharora@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      a3b2aeac
  3. Apr 08, 2023
  4. Apr 05, 2023
    • Domenico Cerasuolo's avatar
      sched/psi: Allow unprivileged polling of N*2s period · d82caa27
      Domenico Cerasuolo authored
      
      PSI offers 2 mechanisms to get information about a specific resource
      pressure. One is reading from /proc/pressure/<resource>, which gives
      average pressures aggregated every 2s. The other is creating a pollable
      fd for a specific resource and cgroup.
      
      The trigger creation requires CAP_SYS_RESOURCE, and gives the
      possibility to pick specific time window and threshold, spawing an RT
      thread to aggregate the data.
      
      Systemd would like to provide containers the option to monitor pressure
      on their own cgroup and sub-cgroups. For example, if systemd launches a
      container that itself then launches services, the container should have
      the ability to poll() for pressure in individual services. But neither
      the container nor the services are privileged.
      
      This patch implements a mechanism to allow unprivileged users to create
      pressure triggers. The difference with privileged triggers creation is
      that unprivileged ones must have a time window that's a multiple of 2s.
      This is so that we can avoid unrestricted spawning of rt threads, and
      use instead the same aggregation mechanism done for the averages, which
      runs independently of any triggers.
      
      Suggested-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Signed-off-by: default avatarDomenico Cerasuolo <cerasuolodomenico@gmail.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Link: https://lore.kernel.org/r/20230330105418.77061-5-cerasuolodomenico@gmail.com
      d82caa27
  5. Sep 27, 2022
  6. Jun 01, 2022
  7. Apr 22, 2022
  8. Jan 20, 2022
  9. Jan 18, 2022
  10. May 12, 2021
  11. Jan 11, 2021
  12. Mar 02, 2020
  13. Jul 15, 2019
  14. 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
  15. Apr 06, 2019
  16. Oct 26, 2018
  17. Sep 23, 2016
  18. Apr 27, 2016
  19. Dec 24, 2015
  20. Sep 26, 2014
  21. Jun 23, 2014
  22. Jul 03, 2013
  23. Nov 26, 2012
  24. Sep 01, 2012
  25. Jun 16, 2011
  26. May 27, 2011
  27. 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
  28. 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
  29. Sep 23, 2009
  30. Jun 17, 2009
  31. Jan 16, 2009
  32. Oct 30, 2008
  33. 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
  34. Jul 26, 2008
Loading