Messages in this thread | | | Date | Sun, 11 Mar 2012 12:09:46 +0800 | Subject | Re: bug in thread_group_times (+possible patch) | From | Hillf Danton <> |
| |
Hello Fawzi,
On Sun, Mar 11, 2012 at 7:11 AM, Fawzi Mohamed <fawzi@gmx.ch> wrote: > Hi, > > a friend of mine asked me about a kernel crash that he was having on a linux cluster (always after long compute intensive task). > I found the bug causing it, and patched it (in an imperfect way), and as I have seen that in the current git the bug is still there, I am writing it here. > I am not into kernel development, so I did not subscribe to the list, please CC me if you want me to answer. > Sorry if this is not the correct way, but I hope this might help to squash just another little bug. > > Now the bug is in kernel/sched/core.c in thread_group_times which if CONFIG_VIRT_CPU_ACCOUNTING is not defined looks like this > > void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st) > { > struct signal_struct *sig = p->signal; > struct task_cputime cputime; > cputime_t rtime, utime, total; > > thread_group_cputime(p, &cputime); > > total = cputime.utime + cputime.stime; > rtime = nsecs_to_cputime(cputime.sum_exec_runtime); > > if (total) { > u64 temp = (__force u64) rtime; > > temp *= (__force u64) cputime.utime;
Would you please try the tiny change?
- do_div(temp, (__force u32) total); + temp = div64_u64(temp, (__force u64) total);
> utime = (__force cputime_t) temp; > } else > utime = rtime; > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |