Skip to content

Commit fb1c3b1

Browse files
author
Fox Snowpatch
committed
1 parent 5165c17 commit fb1c3b1

File tree

9 files changed

+24
-35
lines changed

9 files changed

+24
-35
lines changed

arch/powerpc/include/asm/Kbuild

-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ generic-y += agp.h
66
generic-y += kvm_types.h
77
generic-y += mcs_spinlock.h
88
generic-y += qrwlock.h
9-
generic-y += vtime.h
109
generic-y += early_ioremap.h

arch/powerpc/include/asm/cputime.h

-13
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,10 @@
3232
#ifdef CONFIG_PPC64
3333
#define get_accounting(tsk) (&get_paca()->accounting)
3434
#define raw_get_accounting(tsk) (&local_paca->accounting)
35-
static inline void arch_vtime_task_switch(struct task_struct *tsk) { }
3635

3736
#else
3837
#define get_accounting(tsk) (&task_thread_info(tsk)->accounting)
3938
#define raw_get_accounting(tsk) get_accounting(tsk)
40-
/*
41-
* Called from the context switch with interrupts disabled, to charge all
42-
* accumulated times to the current process, and to prepare accounting on
43-
* the next process.
44-
*/
45-
static inline void arch_vtime_task_switch(struct task_struct *prev)
46-
{
47-
struct cpu_accounting_data *acct = get_accounting(current);
48-
struct cpu_accounting_data *acct0 = get_accounting(prev);
49-
50-
acct->starttime = acct0->starttime;
51-
}
5239
#endif
5340

5441
/*

arch/powerpc/kernel/time.c

+22
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,28 @@ void vtime_flush(struct task_struct *tsk)
354354
acct->hardirq_time = 0;
355355
acct->softirq_time = 0;
356356
}
357+
358+
/*
359+
* Called from the context switch with interrupts disabled, to charge all
360+
* accumulated times to the current process, and to prepare accounting on
361+
* the next process.
362+
*/
363+
void vtime_task_switch(struct task_struct *prev)
364+
{
365+
if (is_idle_task(prev))
366+
vtime_account_idle(prev);
367+
else
368+
vtime_account_kernel(prev);
369+
370+
vtime_flush(prev);
371+
372+
if (!IS_ENABLED(CONFIG_PPC64)) {
373+
struct cpu_accounting_data *acct = get_accounting(current);
374+
struct cpu_accounting_data *acct0 = get_accounting(prev);
375+
376+
acct->starttime = acct0->starttime;
377+
}
378+
}
357379
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
358380

359381
void __no_kcsan __delay(unsigned long loops)

arch/s390/include/asm/vtime.h

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef _S390_VTIME_H
33
#define _S390_VTIME_H
44

5-
#define __ARCH_HAS_VTIME_TASK_SWITCH
6-
75
static inline void update_timer_sys(void)
86
{
97
S390_lowcore.system_timer += S390_lowcore.last_update_timer - S390_lowcore.exit_timer;

arch/s390/kernel/irq.c

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <asm/hw_irq.h>
3030
#include <asm/stacktrace.h>
3131
#include <asm/softirq_stack.h>
32+
#include <asm/vtime.h>
3233
#include "entry.h"
3334

3435
DEFINE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);

arch/s390/kernel/nmi.c

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <asm/asm-offsets.h>
3333
#include <asm/pai.h>
3434
#include <asm/vx-insn.h>
35+
#include <asm/vtime.h>
3536
#include <asm/fpu/api.h>
3637

3738
struct mcck_struct {

include/asm-generic/vtime.h

-1
This file was deleted.

include/linux/vtime.h

-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
#include <linux/context_tracking_state.h>
66
#include <linux/sched.h>
77

8-
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
9-
#include <asm/vtime.h>
10-
#endif
11-
128
/*
139
* Common vtime APIs
1410
*/
@@ -18,7 +14,6 @@ extern void vtime_account_idle(struct task_struct *tsk);
1814
#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
1915

2016
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
21-
extern void arch_vtime_task_switch(struct task_struct *tsk);
2217
extern void vtime_user_enter(struct task_struct *tsk);
2318
extern void vtime_user_exit(struct task_struct *tsk);
2419
extern void vtime_guest_enter(struct task_struct *tsk);

kernel/sched/cputime.c

-13
Original file line numberDiff line numberDiff line change
@@ -424,19 +424,6 @@ static inline void irqtime_account_process_tick(struct task_struct *p, int user_
424424
*/
425425
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
426426

427-
# ifndef __ARCH_HAS_VTIME_TASK_SWITCH
428-
void vtime_task_switch(struct task_struct *prev)
429-
{
430-
if (is_idle_task(prev))
431-
vtime_account_idle(prev);
432-
else
433-
vtime_account_kernel(prev);
434-
435-
vtime_flush(prev);
436-
arch_vtime_task_switch(prev);
437-
}
438-
# endif
439-
440427
void vtime_account_irq(struct task_struct *tsk, unsigned int offset)
441428
{
442429
unsigned int pc = irq_count() - offset;

0 commit comments

Comments
 (0)