.. | .. |
---|
2052 | 2052 | } |
---|
2053 | 2053 | #endif |
---|
2054 | 2054 | |
---|
2055 | | -#ifdef CONFIG_PREEMPT_RT |
---|
2056 | | -/* |
---|
2057 | | - * Sleep for 1 ms in hope whoever holds what we want will let it go. |
---|
2058 | | - */ |
---|
2059 | | -void cpu_chill(void) |
---|
2060 | | -{ |
---|
2061 | | - unsigned int freeze_flag = current->flags & PF_NOFREEZE; |
---|
2062 | | - struct task_struct *self = current; |
---|
2063 | | - ktime_t chill_time; |
---|
2064 | | - |
---|
2065 | | - raw_spin_lock_irq(&self->pi_lock); |
---|
2066 | | - self->saved_state = self->state; |
---|
2067 | | - __set_current_state_no_track(TASK_UNINTERRUPTIBLE); |
---|
2068 | | - raw_spin_unlock_irq(&self->pi_lock); |
---|
2069 | | - |
---|
2070 | | - chill_time = ktime_set(0, NSEC_PER_MSEC); |
---|
2071 | | - |
---|
2072 | | - current->flags |= PF_NOFREEZE; |
---|
2073 | | - schedule_hrtimeout(&chill_time, HRTIMER_MODE_REL_HARD); |
---|
2074 | | - if (!freeze_flag) |
---|
2075 | | - current->flags &= ~PF_NOFREEZE; |
---|
2076 | | - |
---|
2077 | | - raw_spin_lock_irq(&self->pi_lock); |
---|
2078 | | - __set_current_state_no_track(self->saved_state); |
---|
2079 | | - self->saved_state = TASK_RUNNING; |
---|
2080 | | - raw_spin_unlock_irq(&self->pi_lock); |
---|
2081 | | -} |
---|
2082 | | -EXPORT_SYMBOL(cpu_chill); |
---|
2083 | | -#endif |
---|
2084 | | - |
---|
2085 | 2055 | /* |
---|
2086 | 2056 | * Functions related to boot-time initialization: |
---|
2087 | 2057 | */ |
---|