Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932859AbZKZK1Y (ORCPT ); Thu, 26 Nov 2009 05:27:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760256AbZKZK1V (ORCPT ); Thu, 26 Nov 2009 05:27:21 -0500 Received: from casper.infradead.org ([85.118.1.10]:39684 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760252AbZKZK1U convert rfc822-to-8bit (ORCPT ); Thu, 26 Nov 2009 05:27:20 -0500 Subject: Re: [PATCH -tip 3/3] define nsecs_to_jiffies() From: Peter Zijlstra To: Hidetoshi Seto Cc: linux-kernel@vger.kernel.org, Stanislaw Gruszka , Ingo Molnar , Spencer Candland , Oleg Nesterov , Balbir Singh , =?ISO-8859-1?Q?Am=E9rico?= Wang In-Reply-To: <4B0E16E7.5070307@jp.fujitsu.com> References: <4B061E9A.8040100@jp.fujitsu.com> <20091123102806.GD25978@dhcp-lab-161.englab.brq.redhat.com> <4B0B714C.9080607@jp.fujitsu.com> <4B0B8683.6020104@jp.fujitsu.com> <4B0E16E7.5070307@jp.fujitsu.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Thu, 26 Nov 2009 11:27:06 +0100 Message-ID: <1259231226.4273.29.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 897 Lines: 20 On Thu, 2009-11-26 at 14:49 +0900, Hidetoshi Seto wrote: > Use of msecs_to_jiffies() for nsecs_to_cputime() have some problems: > > - The type of msecs_to_jiffies()'s argument is unsigned int, so > it cannot convert msecs greater than UINT_MAX = about 49.7 days. > - msecs_to_jiffies() returns MAX_JIFFY_OFFSET if MSB of argument > is set, assuming that input was negative value. So it cannot > convert msecs greater than INT_MAX = about 24.8 days too. > > This patch defines a new function nsecs_to_jiffies() that can deal > greater values, and that can deal all incoming values as unsigned. This looks good too, Thanks Hidetoshi-san! -- 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/