Skip to content

Commit

Permalink
LoongArch: Reduce min_delta for the arch clockevent device
Browse files Browse the repository at this point in the history
Now the min_delta is 0x600 (1536) for LoongArch's constant clockevent
device. For a 100MHz hardware timer this means ~15us. This is a little
big, especially for PREEMPT_RT enabled kernels. So reduce it to 100 for
PREEMPT_RT kernel, and 1000 for others (we don't want too small values
to affect performance).

Signed-off-by: Huacai Chen <[email protected]>
  • Loading branch information
chenhuacai committed Nov 26, 2024
1 parent 73c359d commit af4b67d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/loongarch/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ void sync_counter(void)
int constant_clockevent_init(void)
{
unsigned int cpu = smp_processor_id();
unsigned long min_delta = 0x600;
#ifdef CONFIG_PREEMPT_RT
unsigned long min_delta = 100;
#else
unsigned long min_delta = 1000;
#endif
unsigned long max_delta = (1UL << 48) - 1;
struct clock_event_device *cd;
static int irq = 0, timer_irq_installed = 0;
Expand Down

0 comments on commit af4b67d

Please sign in to comment.