1

in kernel/sched/core.c, init_rq_hrtick(rq) is called by sched_init(). init_rq_hrtick(rq) initialize hrtick_timer and specifies the callback function to be called upon expiration.

01  static void init_rq_hrtick(struct rq *rq)
02  {
03  #ifdef CONFIG_SMP
04          rq->hrtick_csd_pending = 0;
05   
06          rq->hrtick_csd.flags = 0;
07          rq->hrtick_csd.func = __hrtick_start;
08          rq->hrtick_csd.info = rq;
09  #endif
10   
11          hrtimer_init(&rq->hrtick_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
*12         rq->hrtick_timer.function = hrtick;*
13  }

i set CONFIG_SCHED_HRTICK=y.

but hrtick function which is setted by init_rq_hrtick() as a callback function is not called periodically. can you tell me why callback function is not called?

my kernel version is 4.13.16

doosolLee
  • 43
  • 7
  • Why it should be? – Alex Hoppus Jul 18 '18 at 07:59
  • you mean that it is natural not to be called? cpu#0 initialize per run-queue hrtick timer via init_rq_hrtick() but it seems that hrtick timer doesn't start. To confirm that hrtick timer doesn't operate, I insert printk() in the hrtick timer callback function(according to code, it is 'hrtick'). But i couldn't see anything in the kernel log. To me, It looks not natural that timer call back function is not called though timer is setted. – doosolLee Jul 18 '18 at 08:29
  • It is important to me because i want to insert some code which has to be executed when local cpu timer interrupt has occured. – doosolLee Jul 18 '18 at 08:32
  • I mean that hrtimer is an abstraction and should be backed by some real hardware. Have you checked that this hardware even exists? – Alex Hoppus Jul 18 '18 at 09:03
  • I have not seen the existence of hardware through system configuration(because i don't know how to check). but I had used hrtimer api and checked timer interrupt occured in nano seconds through another module.@Alex Hoppus – doosolLee Jul 18 '18 at 09:27
  • do you know where that initialized timer is started? it will be big help to me @Alex Hoppus – doosolLee Jul 18 '18 at 09:32
  • can you specify your platform? – Alex Hoppus Jul 18 '18 at 09:34
  • DISTRIB_ID=Ubuntu , DISTRIB_RELEASE=16.04, DISTRIB_CODENAME=xenial, DISTRIB_DESCRIPTION= "Ubuntu 16.04.4 LTS", processor type: x86_64, hardware platform : x86_64, kernel release: 4.13.16..... Is there anything else you need? @Alex Hoppus – doosolLee Jul 18 '18 at 09:47

0 Answers0