[PATCH 4/5] cputime: Rename account_system_vtime to account_vtime
account_system_vtime() can be called from random places: hard/softirq entry/exit, kvm guest entry/exit, and even context switches on powerpc. Rename it to the even more generic account_vtime() name, this reflect well that we are in a random place in the kernel where we have either system, idle or user time to account. This way we can reuse the "system" version and expand it with other domains such as "user" or "idle" to prepare for the user hooks based virtual cputime accounting that knows better when to flush the time for which domain of execution. Signed-off-by: Frederic Weisbecker Cc: Alessio Igor Bogani Cc: Andrew Morton Cc: Avi Kivity Cc: Chris Metcalf Cc: Christoph Lameter Cc: Geoff Levand Cc: Gilad Ben Yossef Cc: Hakan Akkan Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Kevin Hilman Cc: Max Krasnyansky Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Stephen Hemminger Cc: Steven Rostedt Cc: Sven-Thorsten Dietrich Cc: Thomas Gleixner --- arch/ia64/kernel/time.c|4 ++-- arch/powerpc/kernel/time.c |8 arch/s390/kernel/vtime.c |4 ++-- include/linux/hardirq.h|8 include/linux/kvm_host.h |4 ++-- kernel/sched/cputime.c |8 kernel/softirq.c |6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 7afcf93..03de550 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -116,7 +116,7 @@ void account_switch_vtime(struct task_struct *prev) * Account time for a transition between system, hard irq or soft irq state. * Note that this function is called with interrupts enabled. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); unsigned long flags; @@ -138,7 +138,7 @@ void account_system_vtime(struct task_struct *tsk) local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Called from the timer interrupt handler to charge accumulated user time diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 3f1918a..fba763d 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -291,7 +291,7 @@ static inline u64 calculate_stolen_time(u64 stop_tb) * Account time for a transition between system, hard irq * or soft irq state. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { u64 now, nowscaled, delta, deltascaled; unsigned long flags; @@ -343,14 +343,14 @@ void account_system_vtime(struct task_struct *tsk) } local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Transfer the user and system times accumulated in the paca * by the exception entry and exit code to the generic process * user and system time records. * Must be called with interrupts disabled. - * Assumes that account_system_vtime() has been called recently + * Assumes that account_vtime() has been called recently * (i.e. since the last entry from usermode) so that * get_paca()->user_time_scaled is up to date. */ @@ -368,7 +368,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) void account_switch_vtime(struct task_struct *prev) { - account_system_vtime(prev); + account_vtime(prev); account_process_tick(prev, 0); } diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 29f20fc..95f8105 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -108,7 +108,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) * Update process times based on virtual cpu times stored by entry.S * to the lowcore fields user_timer, system_timer & steal_clock. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); __u64 timer, system; @@ -122,7 +122,7 @@ void account_system_vtime(struct task_struct *tsk) ti->system_timer = S390_lowcore.system_timer; account_system_time(tsk, 0, system, system); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); void __kprobes vtime_stop_cpu(void) { diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index bb7f309..6432e33 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -132,11 +132,11 @@ extern void synchronize_irq(unsigned int irq); struct task_struct; #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) -static inline void account_system_vtime(struct task_struct *tsk) +static inline void account_vtime(struct task_struct *tsk) { } #else -extern void account_system_vtime(struct task_struct *tsk); +extern void account_vtime(struct task_struct *tsk);
[PATCH 4/5] cputime: Rename account_system_vtime to account_vtime
account_system_vtime() can be called from random places: hard/softirq entry/exit, kvm guest entry/exit, and even context switches on powerpc. Rename it to the even more generic account_vtime() name, this reflect well that we are in a random place in the kernel where we have either system, idle or user time to account. This way we can reuse the system version and expand it with other domains such as user or idle to prepare for the user hooks based virtual cputime accounting that knows better when to flush the time for which domain of execution. Signed-off-by: Frederic Weisbecker fweis...@gmail.com Cc: Alessio Igor Bogani abog...@kernel.org Cc: Andrew Morton a...@linux-foundation.org Cc: Avi Kivity a...@redhat.com Cc: Chris Metcalf cmetc...@tilera.com Cc: Christoph Lameter c...@linux.com Cc: Geoff Levand ge...@infradead.org Cc: Gilad Ben Yossef gi...@benyossef.com Cc: Hakan Akkan hakanak...@gmail.com Cc: H. Peter Anvin h...@zytor.com Cc: Ingo Molnar mi...@kernel.org Cc: Kevin Hilman khil...@ti.com Cc: Max Krasnyansky m...@qualcomm.com Cc: Paul E. McKenney paul...@linux.vnet.ibm.com Cc: Peter Zijlstra pet...@infradead.org Cc: Stephen Hemminger shemmin...@vyatta.com Cc: Steven Rostedt rost...@goodmis.org Cc: Sven-Thorsten Dietrich thebigcorporat...@gmail.com Cc: Thomas Gleixner t...@linutronix.de --- arch/ia64/kernel/time.c|4 ++-- arch/powerpc/kernel/time.c |8 arch/s390/kernel/vtime.c |4 ++-- include/linux/hardirq.h|8 include/linux/kvm_host.h |4 ++-- kernel/sched/cputime.c |8 kernel/softirq.c |6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 7afcf93..03de550 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -116,7 +116,7 @@ void account_switch_vtime(struct task_struct *prev) * Account time for a transition between system, hard irq or soft irq state. * Note that this function is called with interrupts enabled. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); unsigned long flags; @@ -138,7 +138,7 @@ void account_system_vtime(struct task_struct *tsk) local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Called from the timer interrupt handler to charge accumulated user time diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 3f1918a..fba763d 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -291,7 +291,7 @@ static inline u64 calculate_stolen_time(u64 stop_tb) * Account time for a transition between system, hard irq * or soft irq state. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { u64 now, nowscaled, delta, deltascaled; unsigned long flags; @@ -343,14 +343,14 @@ void account_system_vtime(struct task_struct *tsk) } local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Transfer the user and system times accumulated in the paca * by the exception entry and exit code to the generic process * user and system time records. * Must be called with interrupts disabled. - * Assumes that account_system_vtime() has been called recently + * Assumes that account_vtime() has been called recently * (i.e. since the last entry from usermode) so that * get_paca()-user_time_scaled is up to date. */ @@ -368,7 +368,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) void account_switch_vtime(struct task_struct *prev) { - account_system_vtime(prev); + account_vtime(prev); account_process_tick(prev, 0); } diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 29f20fc..95f8105 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -108,7 +108,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) * Update process times based on virtual cpu times stored by entry.S * to the lowcore fields user_timer, system_timer steal_clock. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); __u64 timer, system; @@ -122,7 +122,7 @@ void account_system_vtime(struct task_struct *tsk) ti-system_timer = S390_lowcore.system_timer; account_system_time(tsk, 0, system, system); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); void __kprobes vtime_stop_cpu(void) { diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index bb7f309..6432e33 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -132,11 +132,11 @@ extern void synchronize_irq(unsigned int irq); struct
[PATCH 4/5] cputime: Rename account_system_vtime to account_vtime
account_system_vtime() can be called from random places: hard/softirq entry/exit, kvm guest entry/exit, and even context switches on powerpc. Rename it to the even more generic account_vtime() name, this reflect well that we are in a random place in the kernel where we have either system, idle or user time to account. This way we can reuse the "system" version and expand it with other domains such as "user" or "idle" to prepare for the user hooks based virtual cputime accounting that knows better when to flush the time for which domain of execution. Signed-off-by: Frederic Weisbecker Cc: Alessio Igor Bogani Cc: Andrew Morton Cc: Avi Kivity Cc: Chris Metcalf Cc: Christoph Lameter Cc: Geoff Levand Cc: Gilad Ben Yossef Cc: Hakan Akkan Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Kevin Hilman Cc: Max Krasnyansky Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Stephen Hemminger Cc: Steven Rostedt Cc: Sven-Thorsten Dietrich Cc: Thomas Gleixner --- arch/ia64/kernel/time.c|4 ++-- arch/powerpc/kernel/time.c |8 arch/s390/kernel/vtime.c |4 ++-- include/linux/hardirq.h|8 include/linux/kvm_host.h |4 ++-- kernel/sched/cputime.c |8 kernel/softirq.c |6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 7afcf93..03de550 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -116,7 +116,7 @@ void account_switch_vtime(struct task_struct *prev) * Account time for a transition between system, hard irq or soft irq state. * Note that this function is called with interrupts enabled. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); unsigned long flags; @@ -138,7 +138,7 @@ void account_system_vtime(struct task_struct *tsk) local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Called from the timer interrupt handler to charge accumulated user time diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 3f1918a..fba763d 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -291,7 +291,7 @@ static inline u64 calculate_stolen_time(u64 stop_tb) * Account time for a transition between system, hard irq * or soft irq state. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { u64 now, nowscaled, delta, deltascaled; unsigned long flags; @@ -343,14 +343,14 @@ void account_system_vtime(struct task_struct *tsk) } local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Transfer the user and system times accumulated in the paca * by the exception entry and exit code to the generic process * user and system time records. * Must be called with interrupts disabled. - * Assumes that account_system_vtime() has been called recently + * Assumes that account_vtime() has been called recently * (i.e. since the last entry from usermode) so that * get_paca()->user_time_scaled is up to date. */ @@ -368,7 +368,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) void account_switch_vtime(struct task_struct *prev) { - account_system_vtime(prev); + account_vtime(prev); account_process_tick(prev, 0); } diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 29f20fc..95f8105 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -108,7 +108,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) * Update process times based on virtual cpu times stored by entry.S * to the lowcore fields user_timer, system_timer & steal_clock. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); __u64 timer, system; @@ -122,7 +122,7 @@ void account_system_vtime(struct task_struct *tsk) ti->system_timer = S390_lowcore.system_timer; account_system_time(tsk, 0, system, system); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); void __kprobes vtime_stop_cpu(void) { diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index bb7f309..6432e33 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -132,11 +132,11 @@ extern void synchronize_irq(unsigned int irq); struct task_struct; #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) -static inline void account_system_vtime(struct task_struct *tsk) +static inline void account_vtime(struct task_struct *tsk) { } #else -extern void account_system_vtime(struct task_struct *tsk); +extern void account_vtime(struct task_struct *tsk);
[PATCH 4/5] cputime: Rename account_system_vtime to account_vtime
account_system_vtime() can be called from random places: hard/softirq entry/exit, kvm guest entry/exit, and even context switches on powerpc. Rename it to the even more generic account_vtime() name, this reflect well that we are in a random place in the kernel where we have either system, idle or user time to account. This way we can reuse the system version and expand it with other domains such as user or idle to prepare for the user hooks based virtual cputime accounting that knows better when to flush the time for which domain of execution. Signed-off-by: Frederic Weisbecker fweis...@gmail.com Cc: Alessio Igor Bogani abog...@kernel.org Cc: Andrew Morton a...@linux-foundation.org Cc: Avi Kivity a...@redhat.com Cc: Chris Metcalf cmetc...@tilera.com Cc: Christoph Lameter c...@linux.com Cc: Geoff Levand ge...@infradead.org Cc: Gilad Ben Yossef gi...@benyossef.com Cc: Hakan Akkan hakanak...@gmail.com Cc: H. Peter Anvin h...@zytor.com Cc: Ingo Molnar mi...@kernel.org Cc: Kevin Hilman khil...@ti.com Cc: Max Krasnyansky m...@qualcomm.com Cc: Paul E. McKenney paul...@linux.vnet.ibm.com Cc: Peter Zijlstra pet...@infradead.org Cc: Stephen Hemminger shemmin...@vyatta.com Cc: Steven Rostedt rost...@goodmis.org Cc: Sven-Thorsten Dietrich thebigcorporat...@gmail.com Cc: Thomas Gleixner t...@linutronix.de --- arch/ia64/kernel/time.c|4 ++-- arch/powerpc/kernel/time.c |8 arch/s390/kernel/vtime.c |4 ++-- include/linux/hardirq.h|8 include/linux/kvm_host.h |4 ++-- kernel/sched/cputime.c |8 kernel/softirq.c |6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 7afcf93..03de550 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -116,7 +116,7 @@ void account_switch_vtime(struct task_struct *prev) * Account time for a transition between system, hard irq or soft irq state. * Note that this function is called with interrupts enabled. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); unsigned long flags; @@ -138,7 +138,7 @@ void account_system_vtime(struct task_struct *tsk) local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Called from the timer interrupt handler to charge accumulated user time diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 3f1918a..fba763d 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -291,7 +291,7 @@ static inline u64 calculate_stolen_time(u64 stop_tb) * Account time for a transition between system, hard irq * or soft irq state. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { u64 now, nowscaled, delta, deltascaled; unsigned long flags; @@ -343,14 +343,14 @@ void account_system_vtime(struct task_struct *tsk) } local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Transfer the user and system times accumulated in the paca * by the exception entry and exit code to the generic process * user and system time records. * Must be called with interrupts disabled. - * Assumes that account_system_vtime() has been called recently + * Assumes that account_vtime() has been called recently * (i.e. since the last entry from usermode) so that * get_paca()-user_time_scaled is up to date. */ @@ -368,7 +368,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) void account_switch_vtime(struct task_struct *prev) { - account_system_vtime(prev); + account_vtime(prev); account_process_tick(prev, 0); } diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 29f20fc..95f8105 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -108,7 +108,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) * Update process times based on virtual cpu times stored by entry.S * to the lowcore fields user_timer, system_timer steal_clock. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); __u64 timer, system; @@ -122,7 +122,7 @@ void account_system_vtime(struct task_struct *tsk) ti-system_timer = S390_lowcore.system_timer; account_system_time(tsk, 0, system, system); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); void __kprobes vtime_stop_cpu(void) { diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index bb7f309..6432e33 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -132,11 +132,11 @@ extern void synchronize_irq(unsigned int irq); struct
[PATCH 4/5] cputime: Rename account_system_vtime to account_vtime
account_system_vtime() can be called from random places: hard/softirq entry/exit, kvm guest entry/exit, and even context switches on powerpc. Rename it to the even more generic account_vtime() name, this reflect well that we are in a random place in the kernel where we have either system, idle or user time to account. This way we can reuse the "system" version and expand it with other domains such as "user" or "idle" to prepare for the user hooks based virtual cputime accounting that knows better when to flush the time for which domain of execution. Signed-off-by: Frederic Weisbecker Cc: Alessio Igor Bogani Cc: Andrew Morton Cc: Avi Kivity Cc: Chris Metcalf Cc: Christoph Lameter Cc: Geoff Levand Cc: Gilad Ben Yossef Cc: Hakan Akkan Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Kevin Hilman Cc: Max Krasnyansky Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Stephen Hemminger Cc: Steven Rostedt Cc: Sven-Thorsten Dietrich Cc: Thomas Gleixner --- arch/ia64/kernel/time.c|4 ++-- arch/powerpc/kernel/time.c |8 arch/s390/kernel/vtime.c |4 ++-- include/linux/hardirq.h|8 include/linux/kvm_host.h |4 ++-- kernel/sched/cputime.c |8 kernel/softirq.c |6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 7afcf93..03de550 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -116,7 +116,7 @@ void account_switch_vtime(struct task_struct *prev) * Account time for a transition between system, hard irq or soft irq state. * Note that this function is called with interrupts enabled. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); unsigned long flags; @@ -138,7 +138,7 @@ void account_system_vtime(struct task_struct *tsk) local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Called from the timer interrupt handler to charge accumulated user time diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 3f1918a..fba763d 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -291,7 +291,7 @@ static inline u64 calculate_stolen_time(u64 stop_tb) * Account time for a transition between system, hard irq * or soft irq state. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { u64 now, nowscaled, delta, deltascaled; unsigned long flags; @@ -343,14 +343,14 @@ void account_system_vtime(struct task_struct *tsk) } local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Transfer the user and system times accumulated in the paca * by the exception entry and exit code to the generic process * user and system time records. * Must be called with interrupts disabled. - * Assumes that account_system_vtime() has been called recently + * Assumes that account_vtime() has been called recently * (i.e. since the last entry from usermode) so that * get_paca()->user_time_scaled is up to date. */ @@ -368,7 +368,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) void account_switch_vtime(struct task_struct *prev) { - account_system_vtime(prev); + account_vtime(prev); account_process_tick(prev, 0); } diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 29f20fc..95f8105 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -108,7 +108,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) * Update process times based on virtual cpu times stored by entry.S * to the lowcore fields user_timer, system_timer & steal_clock. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); __u64 timer, system; @@ -122,7 +122,7 @@ void account_system_vtime(struct task_struct *tsk) ti->system_timer = S390_lowcore.system_timer; account_system_time(tsk, 0, system, system); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); void __kprobes vtime_stop_cpu(void) { diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index bb7f309..6432e33 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -132,11 +132,11 @@ extern void synchronize_irq(unsigned int irq); struct task_struct; #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) -static inline void account_system_vtime(struct task_struct *tsk) +static inline void account_vtime(struct task_struct *tsk) { } #else -extern void account_system_vtime(struct task_struct *tsk); +extern void account_vtime(struct task_struct *tsk);
[PATCH 4/5] cputime: Rename account_system_vtime to account_vtime
account_system_vtime() can be called from random places: hard/softirq entry/exit, kvm guest entry/exit, and even context switches on powerpc. Rename it to the even more generic account_vtime() name, this reflect well that we are in a random place in the kernel where we have either system, idle or user time to account. This way we can reuse the system version and expand it with other domains such as user or idle to prepare for the user hooks based virtual cputime accounting that knows better when to flush the time for which domain of execution. Signed-off-by: Frederic Weisbecker fweis...@gmail.com Cc: Alessio Igor Bogani abog...@kernel.org Cc: Andrew Morton a...@linux-foundation.org Cc: Avi Kivity a...@redhat.com Cc: Chris Metcalf cmetc...@tilera.com Cc: Christoph Lameter c...@linux.com Cc: Geoff Levand ge...@infradead.org Cc: Gilad Ben Yossef gi...@benyossef.com Cc: Hakan Akkan hakanak...@gmail.com Cc: H. Peter Anvin h...@zytor.com Cc: Ingo Molnar mi...@kernel.org Cc: Kevin Hilman khil...@ti.com Cc: Max Krasnyansky m...@qualcomm.com Cc: Paul E. McKenney paul...@linux.vnet.ibm.com Cc: Peter Zijlstra pet...@infradead.org Cc: Stephen Hemminger shemmin...@vyatta.com Cc: Steven Rostedt rost...@goodmis.org Cc: Sven-Thorsten Dietrich thebigcorporat...@gmail.com Cc: Thomas Gleixner t...@linutronix.de --- arch/ia64/kernel/time.c|4 ++-- arch/powerpc/kernel/time.c |8 arch/s390/kernel/vtime.c |4 ++-- include/linux/hardirq.h|8 include/linux/kvm_host.h |4 ++-- kernel/sched/cputime.c |8 kernel/softirq.c |6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 7afcf93..03de550 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -116,7 +116,7 @@ void account_switch_vtime(struct task_struct *prev) * Account time for a transition between system, hard irq or soft irq state. * Note that this function is called with interrupts enabled. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); unsigned long flags; @@ -138,7 +138,7 @@ void account_system_vtime(struct task_struct *tsk) local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Called from the timer interrupt handler to charge accumulated user time diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 3f1918a..fba763d 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -291,7 +291,7 @@ static inline u64 calculate_stolen_time(u64 stop_tb) * Account time for a transition between system, hard irq * or soft irq state. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { u64 now, nowscaled, delta, deltascaled; unsigned long flags; @@ -343,14 +343,14 @@ void account_system_vtime(struct task_struct *tsk) } local_irq_restore(flags); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); /* * Transfer the user and system times accumulated in the paca * by the exception entry and exit code to the generic process * user and system time records. * Must be called with interrupts disabled. - * Assumes that account_system_vtime() has been called recently + * Assumes that account_vtime() has been called recently * (i.e. since the last entry from usermode) so that * get_paca()-user_time_scaled is up to date. */ @@ -368,7 +368,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) void account_switch_vtime(struct task_struct *prev) { - account_system_vtime(prev); + account_vtime(prev); account_process_tick(prev, 0); } diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 29f20fc..95f8105 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -108,7 +108,7 @@ void account_process_tick_vtime(struct task_struct *tsk, int user_tick) * Update process times based on virtual cpu times stored by entry.S * to the lowcore fields user_timer, system_timer steal_clock. */ -void account_system_vtime(struct task_struct *tsk) +void account_vtime(struct task_struct *tsk) { struct thread_info *ti = task_thread_info(tsk); __u64 timer, system; @@ -122,7 +122,7 @@ void account_system_vtime(struct task_struct *tsk) ti-system_timer = S390_lowcore.system_timer; account_system_time(tsk, 0, system, system); } -EXPORT_SYMBOL_GPL(account_system_vtime); +EXPORT_SYMBOL_GPL(account_vtime); void __kprobes vtime_stop_cpu(void) { diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index bb7f309..6432e33 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -132,11 +132,11 @@ extern void synchronize_irq(unsigned int irq); struct