From: Keir Fraser Subject: Re: [PATCH] sparse: makes dom0 boot on SMP Date: Thu, 13 Oct 2005 08:06:09 +0100 Message-ID: <459221aee20efc0c14c2d0d858c19433@cl.cam.ac.uk> References: Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ryan Grimm Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 13 Oct 2005, at 00:13, Ryan Grimm wrote: > i assume the original motivation of changing NS_PER_TICK to a 64-bit > value was for the jiffies_to_st function, since it includes a > multiply, delta * NS_PER_TICK. > > The only other function NS_PER_TICK seems to appear in is > timer_interrupt(). i do not know why the original change from signed > to unsigned would cause dom0 to fail on my smp machines. perhaps > someone with more knowledge of time.c can shed some light? Yes, that change is definitely broken. It can cause the kernel to spin in the following loops if delta is ever -ve (because s64 gets promoted to u64 by std C rules, -ve becomes *big* +ve): while ( delta > NS_PER_TICK ) ..... I'll change it back -- the main thing was to make 'delta' a 64-bit quantity in jiffies_to_st(), which is independent of whether NS_PER_TICK is signed or not. -- Keir