From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965878AbbJ0VCz (ORCPT ); Tue, 27 Oct 2015 17:02:55 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:33233 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965659AbbJ0VCw (ORCPT ); Tue, 27 Oct 2015 17:02:52 -0400 Message-ID: <562FE678.2030307@gmail.com> Date: Tue, 27 Oct 2015 14:02:48 -0700 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Leonid Yegoshin CC: Ralf Baechle , Markos Chandras , linux-mips@linux-mips.org, Alex Smith , linux-kernel@vger.kernel.org Subject: Re: [v3, 3/3] MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime() References: <1445417864-31453-1-git-send-email-markos.chandras@imgtec.com> <5629904A.2070400@imgtec.com> <20151027144748.GA23785@linux-mips.org> <562FE29C.8040106@imgtec.com> In-Reply-To: <562FE29C.8040106@imgtec.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/27/2015 01:46 PM, Leonid Yegoshin wrote: [...] > > And finally. clock scaling - what we would do if there are two CPUs with > different clock ratios in system? It seems like common kernel timing > subsystem can handle that. > The code that executes in userspace must have access to a consistent clock source. If you are running on a SMP system that doesn't have synchronized CP0.Count registers, then your gettimeofday() cannot use CP0.Count (RDHWR $2). As far as I know, CP0.Count is the only available counter visible to userspace, so you would have to disable the accelerated versions of gettimeofday() where you cannot assert that the counters are always synchronized. David Daney