From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Bauer Subject: sched_clock for arm Date: Thu, 28 Apr 2011 17:08:38 +0200 (CEST) Message-ID: <1304003318.4db982f68a671@webmail.aon.at> References: <1303296464.4daeb9d04a026@webmail.aon.at> <4DAECAEE.4020503@enseirb-matmeca.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT To: linux-rt-users@vger.kernel.org Return-path: Received: from smtpout04.highway.telekom.at ([195.3.96.117]:19687 "EHLO email.aon.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933055Ab1D1PIn (ORCPT ); Thu, 28 Apr 2011 11:08:43 -0400 Received: from warsbl214-nfs.highway.telekom.at (HELO WARSBL214.highway.telekom.at) ([172.18.96.93]) (envelope-sender ) by smarthub95.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 28 Apr 2011 15:08:39 -0000 Received: from webmail.aon.at (localhost.localdomain [127.0.0.1]) by WARSBL214.highway.telekom.at (8.13.1/8.13.1) with SMTP id p3SF8cGE007661 for ; Thu, 28 Apr 2011 17:08:38 +0200 In-Reply-To: <4DAECAEE.4020503@enseirb-matmeca.fr> Sender: linux-rt-users-owner@vger.kernel.org List-ID: Hello everybody! Again i am a little bit confused - sorry! For the lpc2478 board (arm7tdmi-s), with Patrice Kadionik\'s help, I implemented a clocksource and clock event source to achieve hrtimer resolution. I realised i have to implement a sched_clock function too, in order to achieve better scheduling resolution. I took some examples from the arch/arm directory, where totally different solution exist. Very few using a cnt32_to_63() functions, others only clocksource_cyc2ns(). Is it ok to implement a sched_clock with only clocksource_cyc2ns() with a 72MHz 32bit counter, since it wraps somehow often? It seems the newest preempt-release announced by Thomas Gleixner a few weeks ago has a new arm sched_clock support provided by Russel King, but I am using 2.6.33.7.2-rt30, where those features are not built in and i cannot update the kernel yet I found a conversation initiated by Johannes Stezenbach (http://ns.spinics.net/lists/arm-kernel/msg86383.html) having the same toopic, but actually no specific answer to that question was posted. So is it enough to use clocksource_cyc2ns(), or do I have use something else, and if yould you please point out some code that does exactly what needs to be done for arm architecture. At the moment my implemetations looks as following: unsigned long long notrace sched_clock(void) { return clocksource_cyc2ns(pit_clk.read(&pit_clk),pit_clk.mult,pit_clk.shift); } I would post the code as example here in order to give people a better Thank you again and kind regards Johannes Bauer