Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760036AbZKLCze (ORCPT ); Wed, 11 Nov 2009 21:55:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759999AbZKLCze (ORCPT ); Wed, 11 Nov 2009 21:55:34 -0500 Received: from qw-out-2122.google.com ([74.125.92.24]:21329 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759997AbZKLCzd convert rfc822-to-8bit (ORCPT ); Wed, 11 Nov 2009 21:55:33 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=xtJWR03XJjQOAUM1t+mN5M9Tj0ebrdmnK4tEmtTQGkhLlqRDFiSFKB2q0HM9VTx//7 D7blScfL5UNNf/EGtzVvpwyX0vHRFlJo5lrYEvNZVAXy0nFULzbKGS24QLgausuRjt51 uk2D1d2bOkNuq3LPHU2v3wiTQbUtmX6rA00+w= MIME-Version: 1.0 In-Reply-To: <4AFB77C2.8080705@jp.fujitsu.com> References: <4AF0C97F.7000603@bluehost.com> <4AF123F5.50407@jp.fujitsu.com> <4AF26176.4080307@jp.fujitsu.com> <1257778154.4108.341.camel@laptop> <4AF8FD3C.2090008@jp.fujitsu.com> <4AF8FE76.406@jp.fujitsu.com> <20091111121150.GA2549@dhcp-lab-161.englab.brq.redhat.com> <4AFB5019.7030901@jp.fujitsu.com> <4AFB77C2.8080705@jp.fujitsu.com> Date: Thu, 12 Nov 2009 10:55:38 +0800 Message-ID: <2375c9f90911111855w20491a1er8d3400cf4e027855@mail.gmail.com> Subject: Re: [PATCH] fix granularity of task_u/stime() From: =?UTF-8?Q?Am=C3=A9rico_Wang?= To: Hidetoshi Seto Cc: Stanislaw Gruszka , Peter Zijlstra , Spencer Candland , linux-kernel@vger.kernel.org, Ingo Molnar , Oleg Nesterov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2014 Lines: 54 On Thu, Nov 12, 2009 at 10:49 AM, Hidetoshi Seto wrote: > Hidetoshi Seto wrote: >> Stanislaw Gruszka wrote: >>> On Tue, Nov 10, 2009 at 02:47:34PM +0900, Hidetoshi Seto wrote: >>>> Remove casting to clock_t from task_u/stime(), and keep granularity of >>>> cputime_t over the calculation. >>>> >>>> Signed-off-by: Hidetoshi Seto >>>> --- >>>>  kernel/sched.c |   21 ++++++++++++--------- >>>>  1 files changed, 12 insertions(+), 9 deletions(-) >>>> >>>> diff --git a/kernel/sched.c b/kernel/sched.c >>>> index 28dd4f4..1632e82 100644 >>>> --- a/kernel/sched.c >>>> +++ b/kernel/sched.c >>>> @@ -5171,41 +5171,44 @@ cputime_t task_stime(struct task_struct *p) >>>>     return p->stime; >>>>  } >>>>  #else >>>> + >>>> +#ifndef nsecs_to_cputime >>>> +# define nsecs_to_cputime(__nsecs) msecs_to_cputime((__nsecs) / NSEC_PER_MSEC) >>>> +#endif >>>> + >>> I would like to test, but unfortunately with the patch kernel not build >>> on my system: >>> >>> kernel/built-in.o: In function `task_utime': >>> /usr/src/rhel5/linux-2.6/kernel/sched.c:5187: undefined reference to >>> `__udivdi3' >>> kernel/built-in.o: In function `task_stime': >>> /usr/src/rhel5/linux-2.6/kernel/sched.c:5208: undefined reference to >>> `__udivdi3' >>> make: *** [.tmp_vmlinux1] Error 1 >> >> Wow, what arch? >> Could you provide your .config? > > Oh, I found I can hit this error on x86_32 (but not on x86_64). > Maybe something on dividing u64... > > I'll try to find fix/workaround for this, but would appreciate if someone > could tell me what is happening here. Yeah, this is because on 32-bit gcc tries to use libgcc to do 64-bit integer computing. You can insert inline asm to force gcc not to optimize this code. ;) -- 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/