[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20090309150111.c36c54f7.akpm@linux-foundation.org>
Date: Mon, 9 Mar 2009 15:01:11 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Heiko Carstens <heiko.carstens@...ibm.com>
Cc: torvalds@...ux-foundation.org, elendil@...net.nl,
schwidefsky@...ibm.com, linux-kernel@...r.kernel.org,
stable@...nel.org
Subject: Re: [PATCH] Fix fixpoint divide exception in acct_update_integrals
On Mon, 9 Mar 2009 13:31:59 +0100
Heiko Carstens <heiko.carstens@...ibm.com> wrote:
> ...
>
> --- linux-2.6.orig/kernel/tsacct.c
> +++ linux-2.6/kernel/tsacct.c
> @@ -122,8 +122,10 @@ void acct_update_integrals(struct task_s
> if (likely(tsk->mm)) {
> cputime_t time, dtime;
> struct timeval value;
> + unsigned long flags;
> u64 delta;
>
> + local_irq_save(flags);
> time = tsk->stime + tsk->utime;
> dtime = cputime_sub(time, tsk->acct_timexpd);
> jiffies_to_timeval(cputime_to_jiffies(dtime), &value);
> @@ -131,10 +133,12 @@ void acct_update_integrals(struct task_s
> delta = delta * USEC_PER_SEC + value.tv_usec;
>
> if (delta == 0)
> - return;
> + goto out;
> tsk->acct_timexpd = time;
> tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm);
> tsk->acct_vm_mem1 += delta * tsk->mm->total_vm;
> + out:
> + local_irq_restore(flags);
> }
> }
>
hrm, so we use local-interrupt protection for <something>.
I wonder what we can do to reduce the probability of bugs of this
nature being introduced in the future?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists