Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90c53e65 authored by Martin Schwidefsky's avatar Martin Schwidefsky
Browse files

s390: move cputime accounting fields from thread_info to thread_struct



The user_timer and system_timer fields are used for the per-thread
cputime accounting code. The access to these values is simpler if
they are moved to the thread_struct as the task_thread_info(tsk)
indirection is not needed anymore.

Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent f8fc82b4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -110,6 +110,8 @@ typedef struct {
struct thread_struct {
	unsigned int  acrs[NUM_ACRS];
        unsigned long ksp;              /* kernel stack pointer             */
	unsigned long user_timer;	/* task cputime in user space */
	unsigned long system_timer;	/* task cputime in kernel space */
	mm_segment_t mm_segment;
	unsigned long gmap_addr;	/* address of last gmap fault. */
	unsigned int gmap_write_flag;	/* gmap fault write indication */
+0 −2
Original line number Diff line number Diff line
@@ -32,8 +32,6 @@
struct thread_info {
	unsigned long		flags;		/* low level flags */
	unsigned long		sys_call_table;	/* System call table address */
	__u64			user_timer;
	__u64			system_timer;
	unsigned long		last_break;	/* last breaking-event-address. */
};

+0 −2
Original line number Diff line number Diff line
@@ -41,8 +41,6 @@ int main(void)
	/* thread info offsets */
	OFFSET(__TI_flags, task_struct, thread_info.flags);
	OFFSET(__TI_sysc_table,  task_struct, thread_info.sys_call_table);
	OFFSET(__TI_user_timer, task_struct, thread_info.user_timer);
	OFFSET(__TI_system_timer, task_struct, thread_info.system_timer);
	OFFSET(__TI_last_break, task_struct, thread_info.last_break);
	BLANK();
	/* pt_regs offsets */
+2 −4
Original line number Diff line number Diff line
@@ -103,7 +103,6 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
		unsigned long arg, struct task_struct *p)
{
	struct thread_info *ti;
	struct fake_frame
	{
		struct stack_frame sf;
@@ -121,9 +120,8 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
	memset(&p->thread.per_event, 0, sizeof(p->thread.per_event));
	clear_tsk_thread_flag(p, TIF_SINGLE_STEP);
	/* Initialize per thread user and system timer values */
	ti = task_thread_info(p);
	ti->user_timer = 0;
	ti->system_timer = 0;
	p->thread.user_timer = 0;
	p->thread.system_timer = 0;

	frame->sf.back_chain = 0;
	/* new return point is ret_from_fork */
+2 −3
Original line number Diff line number Diff line
@@ -259,15 +259,14 @@ static void pcpu_prepare_secondary(struct pcpu *pcpu, int cpu)
static void pcpu_attach_task(struct pcpu *pcpu, struct task_struct *tsk)
{
	struct lowcore *lc = pcpu->lowcore;
	struct thread_info *ti = task_thread_info(tsk);

	lc->kernel_stack = (unsigned long) task_stack_page(tsk)
		+ THREAD_SIZE - STACK_FRAME_OVERHEAD - sizeof(struct pt_regs);
	lc->current_task = (unsigned long) tsk;
	lc->lpp = LPP_MAGIC;
	lc->current_pid = tsk->pid;
	lc->user_timer = ti->user_timer;
	lc->system_timer = ti->system_timer;
	lc->user_timer = tsk->thread.user_timer;
	lc->system_timer = tsk->thread.system_timer;
	lc->steal_timer = 0;
}

Loading