linux-mips
[Top] [All Lists]

Re: [PATCH v6] MIPS: Add a high resolution sched_clock() via cnt32_to_63

To: wuzhangjin@gmail.com
Subject: Re: [PATCH v6] MIPS: Add a high resolution sched_clock() via cnt32_to_63().
From: David Daney <ddaney@caviumnetworks.com>
Date: Mon, 18 Jan 2010 10:08:32 -0800
Cc: Ralf Baechle <ralf@linux-mips.org>, Sergei Shtylyov <sshtylyov@ru.mvista.com>, David Daney <david.s.daney@gmail.com>, Thomas Gleixner <tglx@linutronix.de>, linux-mips@linux-mips.org
In-reply-to: <1263801284.11671.50.camel@falcon>
References: <1259319110-16107-1-git-send-email-wuzhangjin@gmail.com> <1263801284.11671.50.camel@falcon>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0.0.21 (X11/20090320)
Wu Zhangjin wrote:
If the processor support dynamic cpu frequency and the support is
enabled in kernel, this sched_clock() implementation will be broken(and
If the frequency of the MIPS CP0 counter is related to the cpu's
frequency).

So, some extra resitrictions should be added to it.

arch/mips/Kconfig

config CPU_HAS_FIXED_CP0_COUNTER
        bool

config SYS_SUPPORTS_HRES_SCHED_CLOCK
        bool
        depends on CPU_HAS_FIXED_CP0_COUNTER || !CPU_FREQ

arch/mips/kernel/csrc-r4k.c

#ifdef SYS_SUPPORTS_HRES_SCHED_CLOCK

/* The high resolution version of sched_clock() */

#endif

And I'm not sure whether the cavium octeon support dynamic cpu
frequency,

Not currently...

if yes, it's high resolution version of sched_clock() also
should be wrapped with the above macro to ensure it is not broken:

arch/mips/cavium-octeon/csrc-octeon.c


... So this is not applicable.


Regards,
        Wu Zhangjin


<Prev in Thread] Current Thread [Next in Thread>