forked from torvalds/linux
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
powerpc/book3s_hv: Add new idle-hint attribute in VPA region
In lppaca region, add a new attribute idle_hint which can allow guest scheduler for better cpu selection. Hypervisor can update idle_hint attribute based on the prediction that if vCPU needs to be scheduled then can it be scheduled instantly or not. Signed-off-by: Parth Shah <parth@linux.ibm.com>
- Loading branch information
1 parent
019b3fd
commit 09b5719b7516bcf50add81162e131d53ec10aeca
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #ifndef _ASM_POWERPC_IDLEHINT_H | ||
| #define _ASM_POWERPC_IDLEHINT_H | ||
|
|
||
| #include <linux/kvm_host.h> | ||
|
|
||
| extern void kvmppc_idle_hint_set(struct kvm_vcpu *vcpu, int idle_hint); | ||
|
|
||
| extern int idle_hint_is_active; | ||
|
|
||
| extern void set_idle_hint(int cpu, int value); | ||
|
|
||
| static inline int prev_cpu_of_kvm(struct kvm_vcpu *vcpu) | ||
| { | ||
| struct pid *pid; | ||
| struct task_struct *task = NULL; | ||
|
|
||
| rcu_read_lock(); | ||
| pid = rcu_dereference(vcpu->pid); | ||
| if (pid) | ||
| task = get_pid_task(pid, PIDTYPE_PID); | ||
| rcu_read_unlock(); | ||
|
|
||
| if (!task) | ||
| return -1; | ||
|
|
||
| return task_cpu(task); | ||
| } | ||
| #endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters