History

sched/vtime: Introduce vtime_accounting_enabled_cpu()

This allows us to check if a remote CPU runs vtime accounting (ie: is nohz_full). We'll need that to reliably support reading kcpustat on nohz_full CPUs. Also simplify a bit the condition in the local flavoured function while at it.

Frederic Weisbecker committed 7 years ago

Commit 9adbb9d1 parent e44fcb41 file · +7 −6Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/vtime.h+7−6
@@ -31,14 +31,14 @@ static inline bool vtime_accounting_enabled(void) · 30 unmodified lines
31 return context_tracking_enabled();31 return context_tracking_enabled();
32}32}
33 33
34static inline bool vtime_accounting_enabled_this_cpu(void)34static inline bool vtime_accounting_enabled_cpu(int cpu)
35{35{
36 if (vtime_accounting_enabled()) {36 return (vtime_accounting_enabled() && context_tracking_enabled_cpu(cpu));
37 if (context_tracking_enabled_this_cpu())37}
38 return true;
39 }
40 38
41 return false;39static inline bool vtime_accounting_enabled_this_cpu(void)
40{
41 return (vtime_accounting_enabled() && context_tracking_enabled_this_cpu());
42}42}
43 43
44extern void vtime_task_switch_generic(struct task_struct *prev);44extern void vtime_task_switch_generic(struct task_struct *prev);
@@ -51,6 +51,7 @@ static inline void vtime_task_switch(struct task_struct *prev) · 6 unmodified lines
51 51
52#else /* !CONFIG_VIRT_CPU_ACCOUNTING */52#else /* !CONFIG_VIRT_CPU_ACCOUNTING */
53 53
54static inline bool vtime_accounting_enabled_cpu(int cpu) {return false; }
54static inline bool vtime_accounting_enabled_this_cpu(void) { return false; }55static inline bool vtime_accounting_enabled_this_cpu(void) { return false; }
55static inline void vtime_task_switch(struct task_struct *prev) { }56static inline void vtime_task_switch(struct task_struct *prev) { }
56 57

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t