1. 13 10月, 2012 1 次提交
  2. 23 12月, 2010 1 次提交
    • J
      taskstats: pad taskstats netlink response for aligment issues on ia64 · 4be2c95d
      Jeff Mahoney 提交于
      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: NJeff Mahoney <jeffm@suse.com>
      Reported-by: NBrian 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: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4be2c95d
  3. 31 1月, 2009 1 次提交
  4. 26 7月, 2008 1 次提交
  5. 19 10月, 2007 2 次提交
  6. 17 7月, 2007 1 次提交
    • M
      taskstats: add context-switch counters · b663a79c
      Maxim Uvarov 提交于
      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: NMaxim 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: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b663a79c
  7. 24 4月, 2007 1 次提交
    • B
      Taskstats fix the structure members alignment issue · 7e40f2ab
      Balbir Singh 提交于
      We broke the the alignment of members of taskstats to the 8 byte boundary
      with the CSA patches.  In the current kernel, the taskstats structure is
      not suitable for use by 32 bit applications in a 64 bit kernel.
      
      On x86_64
      
      Offsets of taskstats' members (64 bit kernel, 64 bit application)
      
      @taskstats'offsetof[@taskstats'indices] = (
              0,      # version
              4,      # ac_exitcode
              8,      # ac_flag
              9,      # ac_nice
              16,     # cpu_count
              24,     # cpu_delay_total
              32,     # blkio_count
              40,     # blkio_delay_total
              48,     # swapin_count
              56,     # swapin_delay_total
              64,     # cpu_run_real_total
              72,     # cpu_run_virtual_total
              80,     # ac_comm
              112,    # ac_sched
              113,    # ac_pad
              116,    # ac_uid
              120,    # ac_gid
              124,    # ac_pid
              128,    # ac_ppid
              132,    # ac_btime
              136,    # ac_etime
              144,    # ac_utime
              152,    # ac_stime
              160,    # ac_minflt
              168,    # ac_majflt
              176,    # coremem
              184,    # virtmem
              192,    # hiwater_rss
              200,    # hiwater_vm
              208,    # read_char
              216,    # write_char
              224,    # read_syscalls
              232,    # write_syscalls
              240,    # read_bytes
              248,    # write_bytes
              256,    # cancelled_write_bytes
          );
      
      Offsets of taskstats' members (64 bit kernel, 32 bit application)
      
      @taskstats'offsetof[@taskstats'indices] = (
              0,      # version
              4,      # ac_exitcode
              8,      # ac_flag
              9,      # ac_nice
              12,     # cpu_count
              20,     # cpu_delay_total
              28,     # blkio_count
              36,     # blkio_delay_total
              44,     # swapin_count
              52,     # swapin_delay_total
              60,     # cpu_run_real_total
              68,     # cpu_run_virtual_total
              76,     # ac_comm
              108,    # ac_sched
              109,    # ac_pad
              112,    # ac_uid
              116,    # ac_gid
              120,    # ac_pid
              124,    # ac_ppid
              128,    # ac_btime
              132,    # ac_etime
              140,    # ac_utime
              148,    # ac_stime
              156,    # ac_minflt
              164,    # ac_majflt
              172,    # coremem
              180,    # virtmem
              188,    # hiwater_rss
              196,    # hiwater_vm
              204,    # read_char
              212,    # write_char
              220,    # read_syscalls
              228,    # write_syscalls
              236,    # read_bytes
              244,    # write_bytes
              252,    # cancelled_write_bytes
          );
      
      This is one way to solve the problem without re-arranging structure members
      is to pack the structure.  The patch adds an __attribute__((aligned(8))) to
      the taskstats structure members so that 32 bit applications using taskstats
      can work with a 64 bit kernel.
      
      Using __attribute__((packed)) would break the 64 bit alignment of members.
      
      The fix was tested on x86_64. After the fix, we got
      
      Offsets of taskstats' members (64 bit kernel, 64 bit application)
      
      @taskstats'offsetof[@taskstats'indices] = (
              0,      # version
              4,      # ac_exitcode
              8,      # ac_flag
              9,      # ac_nice
              16,     # cpu_count
              24,     # cpu_delay_total
              32,     # blkio_count
              40,     # blkio_delay_total
              48,     # swapin_count
              56,     # swapin_delay_total
              64,     # cpu_run_real_total
              72,     # cpu_run_virtual_total
              80,     # ac_comm
              112,    # ac_sched
              113,    # ac_pad
              120,    # ac_uid
              124,    # ac_gid
              128,    # ac_pid
              132,    # ac_ppid
              136,    # ac_btime
              144,    # ac_etime
              152,    # ac_utime
              160,    # ac_stime
              168,    # ac_minflt
              176,    # ac_majflt
              184,    # coremem
              192,    # virtmem
              200,    # hiwater_rss
              208,    # hiwater_vm
              216,    # read_char
              224,    # write_char
              232,    # read_syscalls
              240,    # write_syscalls
              248,    # read_bytes
              256,    # write_bytes
              264,    # cancelled_write_bytes
          );
      
      Offsets of taskstats' members (64 bit kernel, 32 bit application)
      
      @taskstats'offsetof[@taskstats'indices] = (
              0,      # version
              4,      # ac_exitcode
              8,      # ac_flag
              9,      # ac_nice
              16,     # cpu_count
              24,     # cpu_delay_total
              32,     # blkio_count
              40,     # blkio_delay_total
              48,     # swapin_count
              56,     # swapin_delay_total
              64,     # cpu_run_real_total
              72,     # cpu_run_virtual_total
              80,     # ac_comm
              112,    # ac_sched
              113,    # ac_pad
              120,    # ac_uid
              124,    # ac_gid
              128,    # ac_pid
              132,    # ac_ppid
              136,    # ac_btime
              144,    # ac_etime
              152,    # ac_utime
              160,    # ac_stime
              168,    # ac_minflt
              176,    # ac_majflt
              184,    # coremem
              192,    # virtmem
              200,    # hiwater_rss
              208,    # hiwater_vm
              216,    # read_char
              224,    # write_char
              232,    # read_syscalls
              240,    # write_syscalls
              248,    # read_bytes
              256,    # write_bytes
              264,    # cancelled_write_bytes
          );
      Signed-off-by: NBalbir Singh <balbir@linux.vnet.ibm.com>
      Cc: Jay Lan <jlan@engr.sgi.com>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7e40f2ab
  8. 11 12月, 2006 2 次提交
  9. 01 10月, 2006 3 次提交
    • J
      [PATCH] csa accounting taskstats update · db5fed26
      Jay Lan 提交于
      ChangeLog:
         Feedbacks from Andrew Morton:
         - define TS_COMM_LEN to 32
         - change acct_stimexpd field of task_struct to be of
           cputime_t, which is to be used to save the tsk->stime
           of last timer interrupt update.
         - a new Documentation/accounting/taskstats-struct.txt
           to describe fields of taskstats struct.
      
         Feedback from Balbir Singh:
         - keep the stime of a task to be zero when both stime
           and utime are zero as recoreded in task_struct.
      
         Misc:
         - convert accumulated RSS/VM from platform dependent
           pages-ticks to MBytes-usecs in the kernel
      
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Jes Sorensen <jes@sgi.com>
      Cc: Chris Sturtivant <csturtiv@sgi.com>
      Cc: Tony Ernst <tee@sgi.com>
      Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      db5fed26
    • J
      [PATCH] csa: Extended system accounting over taskstats · 9acc1853
      Jay Lan 提交于
      Add extended system accounting handling over taskstats interface.  A
      CONFIG_TASK_XACCT flag is created to enable the extended accounting code.
      Signed-off-by: NJay Lan <jlan@sgi.com>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Jes Sorensen <jes@sgi.com>
      Cc: Chris Sturtivant <csturtiv@sgi.com>
      Cc: Tony Ernst <tee@sgi.com>
      Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9acc1853
    • J
      [PATCH] csa: basic accounting over taskstats · f3cef7a9
      Jay Lan 提交于
      Add some basic accounting fields to the taskstats struct, add a new
      kernel/tsacct.c to handle basic accounting data handling upon exit.  A handle
      is added to taskstats.c to invoke the basic accounting data handling.
      Signed-off-by: NJay Lan <jlan@sgi.com>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Jes Sorensen <jes@sgi.com>
      Cc: Chris Sturtivant <csturtiv@sgi.com>
      Cc: Tony Ernst <tee@sgi.com>
      Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
      Cc: "Michal Piotrowski" <michal.k.k.piotrowski@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f3cef7a9
  10. 15 7月, 2006 3 次提交