.. | .. |
---|
2024 | 2024 | if (!timespec64_valid(&tu)) |
---|
2025 | 2025 | return -EINVAL; |
---|
2026 | 2026 | |
---|
| 2027 | + current->restart_block.fn = do_no_restart_syscall; |
---|
2027 | 2028 | current->restart_block.nanosleep.type = rmtp ? TT_NATIVE : TT_NONE; |
---|
2028 | 2029 | current->restart_block.nanosleep.rmtp = rmtp; |
---|
2029 | 2030 | return hrtimer_nanosleep(timespec64_to_ktime(tu), HRTIMER_MODE_REL, |
---|
.. | .. |
---|
2045 | 2046 | if (!timespec64_valid(&tu)) |
---|
2046 | 2047 | return -EINVAL; |
---|
2047 | 2048 | |
---|
| 2049 | + current->restart_block.fn = do_no_restart_syscall; |
---|
2048 | 2050 | current->restart_block.nanosleep.type = rmtp ? TT_COMPAT : TT_NONE; |
---|
2049 | 2051 | current->restart_block.nanosleep.compat_rmtp = rmtp; |
---|
2050 | 2052 | return hrtimer_nanosleep(timespec64_to_ktime(tu), HRTIMER_MODE_REL, |
---|
2051 | 2053 | CLOCK_MONOTONIC); |
---|
2052 | 2054 | } |
---|
2053 | | -#endif |
---|
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 | 2055 | #endif |
---|
2084 | 2056 | |
---|
2085 | 2057 | /* |
---|