diff options
| author | Alex Williamson <alex.williamson@redhat.com> | 2021-02-22 10:14:24 -0700 |
|---|---|---|
| committer | Alex Williamson <alex.williamson@redhat.com> | 2021-02-22 10:14:24 -0700 |
| commit | 72d6e4871f0457dc9e498f8437ea344ee6b78075 (patch) | |
| tree | 44a6975d7f0818086e34b8e84e3164527fac36f4 /include/linux/kernel.h | |
| parent | b9abef43a08ef7faa33477cccb0c08c64eb2b8bf (diff) | |
| parent | 3e10585335b7967326ca7b4118cada0d2d00a2ab (diff) | |
Merge commit '3e10585335b7967326ca7b4118cada0d2d00a2ab' into v5.12/vfio/next
Update to new follow_pte() definition
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f7902d8c1048..5b7ed6dc99ac 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -15,7 +15,7 @@ #include <linux/typecheck.h> #include <linux/printk.h> #include <linux/build_bug.h> - +#include <linux/static_call_types.h> #include <asm/byteorder.h> #include <uapi/linux/kernel.h> @@ -81,11 +81,26 @@ struct pt_regs; struct user; #ifdef CONFIG_PREEMPT_VOLUNTARY -extern int _cond_resched(void); -# define might_resched() _cond_resched() + +extern int __cond_resched(void); +# define might_resched() __cond_resched() + +#elif defined(CONFIG_PREEMPT_DYNAMIC) + +extern int __cond_resched(void); + +DECLARE_STATIC_CALL(might_resched, __cond_resched); + +static __always_inline void might_resched(void) +{ + static_call_mod(might_resched)(); +} + #else + # define might_resched() do { } while (0) -#endif + +#endif /* CONFIG_PREEMPT_* */ #ifdef CONFIG_DEBUG_ATOMIC_SLEEP extern void ___might_sleep(const char *file, int line, int preempt_offset); |
