@@ -125,31 +125,32 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
125125static void __acct_update_integrals (struct task_struct * tsk ,
126126 cputime_t utime , cputime_t stime )
127127{
128- if (likely (tsk -> mm )) {
129- cputime_t time , dtime ;
130- unsigned long flags ;
131- u64 delta ;
132-
133- local_irq_save (flags );
134- time = stime + utime ;
135- dtime = time - tsk -> acct_timexpd ;
136- /* Avoid division: cputime_t is often in nanoseconds already. */
137- delta = cputime_to_nsecs (dtime );
138-
139- if (delta < TICK_NSEC )
140- goto out ;
141-
142- tsk -> acct_timexpd = time ;
143- /*
144- * Divide by 1024 to avoid overflow, and to avoid division.
145- * The final unit reported to userspace is Mbyte-usecs,
146- * the rest of the math is done in xacct_add_tsk.
147- */
148- tsk -> acct_rss_mem1 += delta * get_mm_rss (tsk -> mm ) >> 10 ;
149- tsk -> acct_vm_mem1 += delta * tsk -> mm -> total_vm >> 10 ;
150- out :
151- local_irq_restore (flags );
152- }
128+ cputime_t time , dtime ;
129+ unsigned long flags ;
130+ u64 delta ;
131+
132+ if (!likely (tsk -> mm ))
133+ return ;
134+
135+ local_irq_save (flags );
136+ time = stime + utime ;
137+ dtime = time - tsk -> acct_timexpd ;
138+ /* Avoid division: cputime_t is often in nanoseconds already. */
139+ delta = cputime_to_nsecs (dtime );
140+
141+ if (delta < TICK_NSEC )
142+ goto out ;
143+
144+ tsk -> acct_timexpd = time ;
145+ /*
146+ * Divide by 1024 to avoid overflow, and to avoid division.
147+ * The final unit reported to userspace is Mbyte-usecs,
148+ * the rest of the math is done in xacct_add_tsk.
149+ */
150+ tsk -> acct_rss_mem1 += delta * get_mm_rss (tsk -> mm ) >> 10 ;
151+ tsk -> acct_vm_mem1 += delta * tsk -> mm -> total_vm >> 10 ;
152+ out :
153+ local_irq_restore (flags );
153154}
154155
155156/**
0 commit comments