1. 07 3月, 2010 1 次提交
  2. 09 3月, 2009 1 次提交
    • H
      Fix fixpoint divide exception in acct_update_integrals · 6d5b5acc
      Heiko Carstens 提交于
      Frans Pop reported the crash below when running an s390 kernel under Hercules:
      
        Kernel BUG at 000738b4  verbose debug info unavailable!
        fixpoint divide exception: 0009  #1! SMP
        Modules linked in: nfs lockd nfs_acl sunrpc ctcm fsm tape_34xx
           cu3088 tape ccwgroup tape_class ext3 jbd mbcache dm_mirror dm_log dm_snapshot
           dm_mod dasd_eckd_mod dasd_mod
        CPU: 0 Not tainted 2.6.27.19 #13
        Process awk (pid: 2069, task: 0f9ed9b8, ksp: 0f4f7d18)
        Krnl PSW : 070c1000 800738b4 (acct_update_integrals+0x4c/0x118)
                   R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:0 CC:1 PM:0
        Krnl GPRS: 00000000 000007d0 7fffffff fffff830
                   00000000 ffffffff 00000002 0f9ed9b8
                   00000000 00008ca0 00000000 0f9ed9b8
                   0f9edda4 8007386e 0f4f7ec8 0f4f7e98
        Krnl Code: 800738aa: a71807d0         lhi     %r1,2000
                   800738ae: 8c200001         srdl    %r2,1
                   800738b2: 1d21             dr      %r2,%r1
                  >800738b4: 5810d10e         l       %r1,270(%r13)
                   800738b8: 1823             lr      %r2,%r3
                   800738ba: 4130f060         la      %r3,96(%r15)
                   800738be: 0de1             basr    %r14,%r1
                   800738c0: 5800f060         l       %r0,96(%r15)
        Call Trace:
        ( <000000000004fdea>! blocking_notifier_call_chain+0x1e/0x2c)
          <0000000000038502>! do_exit+0x106/0x7c0
          <0000000000038c36>! do_group_exit+0x7a/0xb4
          <0000000000038c8e>! SyS_exit_group+0x1e/0x30
          <0000000000021c28>! sysc_do_restart+0x12/0x16
          <0000000077e7e924>! 0x77e7e924
      
      Reason for this is that cpu time accounting usually only happens from
      interrupt context, but acct_update_integrals gets also called from
      process context with interrupts enabled.
      
      So in acct_update_integrals we may end up with the following scenario:
      
      Between reading tsk->stime/tsk->utime and tsk->acct_timexpd an interrupt
      happens which updates accouting values.  This causes acct_timexpd to be
      greater than the former stime + utime.  The subsequent calculation of
      
      	dtime = cputime_sub(time, tsk->acct_timexpd);
      
      will be negative and the division performed by
      
      	cputime_to_jiffies(dtime)
      
      will generate an exception since the result won't fit into a 32 bit
      register.
      
      In order to fix this just always disable interrupts while accessing any
      of the accounting values.
      
      Reported by: Frans Pop <elendil@planet.nl>
      Tested by: Frans Pop <elendil@planet.nl>
      Cc: stable@kernel.org
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6d5b5acc
  3. 07 1月, 2009 1 次提交
  4. 14 11月, 2008 2 次提交
  5. 28 7月, 2008 2 次提交
  6. 26 7月, 2008 2 次提交
  7. 19 10月, 2007 1 次提交
  8. 26 7月, 2007 1 次提交
    • J
      Cleanup non-arch xtime uses, use get_seconds() or current_kernel_time(). · 2c6b47de
      john stultz 提交于
      This avoids use of the kernel-internal "xtime" variable directly outside
      of the actual time-related functions.  Instead, use the helper functions
      that we already have available to us.
      
      This doesn't actually change any behaviour, but this will allow us to
      fix the fact that "xtime" isn't updated very often with CONFIG_NO_HZ
      (because much of the realtime information is maintained as separate
      offsets to 'xtime'), which has caused interfaces that use xtime directly
      to get a time that is out of sync with the real-time clock by up to a
      third of a second or so.
      Signed-off-by: NJohn Stultz <johnstul@us.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2c6b47de
  9. 17 2月, 2007 1 次提交
  10. 11 12月, 2006 1 次提交
  11. 31 10月, 2006 1 次提交
  12. 29 10月, 2006 1 次提交
    • O
      [PATCH] bacct_add_tsk: fix unsafe and wrong parent/group_leader dereference · 05d5bcd6
      Oleg Nesterov 提交于
      1. ts = timespec_sub(uptime, current->group_leader->start_time);
      
         It is possible that current != tsk. Probably it was supposed
         to be 'tsk->group_leader->start_time. But why we are reading
         group_leader's start_time ? This accounting is per thread,
         not per procees, I changed this to 'tsk->start_time.
         Please corect me.
      
      2. stats->ac_ppid = (tsk->parent) ? tsk->parent->pid : 0;
      
         tsk->parent never == NULL, and it is unsafe to dereference it.
         Both the task and it's parent may exit after the caller unlocks
         tasklist_lock, the memory could be unmapped (DEBUG_SLAB).
         (And we should use ->real_parent->tgid in fact).
      
      Q: I don't understand the 'if (thread_group_leader(tsk))' check.
      Why it is needed ?
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Acked-by: NJay Lan <jlan@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      05d5bcd6
  13. 01 10月, 2006 4 次提交
    • 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: convert CONFIG tag for extended accounting routines · 8f0ab514
      Jay Lan 提交于
      There were a few accounting data/macros that are used in CSA but are #ifdef'ed
      inside CONFIG_BSD_PROCESS_ACCT.  This patch is to change those ifdef's from
      CONFIG_BSD_PROCESS_ACCT to CONFIG_TASK_XACCT.  A few defines are moved from
      kernel/acct.c and include/linux/acct.h to kernel/tsacct.c and
      include/linux/tsacct_kern.h.
      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>
      8f0ab514
    • 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