From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031103AbbDWVre (ORCPT ); Thu, 23 Apr 2015 17:47:34 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35882 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030908AbbDWVrd (ORCPT ); Thu, 23 Apr 2015 17:47:33 -0400 Date: Thu, 23 Apr 2015 14:47:31 -0700 From: Andrew Morton To: Rik van Riel Cc: linux-kernel@vger.kernel.org, Oleg Nesterov , Michal Hocko Subject: Re: [PATCH] exit,stats: /* obey this comment */ Message-Id: <20150423144731.2c591c8eb70755b54ac83917@linux-foundation.org> In-Reply-To: <20150423171759.6cdce17d@cuia.bos.redhat.com> References: <20150423171759.6cdce17d@cuia.bos.redhat.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 Apr 2015 17:17:59 -0400 Rik van Riel wrote: > There is a helpful comment in do_exit() that states we sync the > mm's RSS info before statistics gathering. > > The function that does the statistics gathering is called right > above that comment. > > Change the code to obey the comment. > > ... > > --- a/kernel/exit.c > +++ b/kernel/exit.c > @@ -711,10 +711,10 @@ void do_exit(long code) > current->comm, task_pid_nr(current), > preempt_count()); > > - acct_update_integrals(tsk); > /* sync mm's RSS info before statistics gathering */ > if (tsk->mm) > sync_mm_rss(tsk->mm); > + acct_update_integrals(tsk); > group_dead = atomic_dec_and_test(&tsk->signal->live); > if (group_dead) { > hrtimer_cancel(&tsk->signal->real_timer); I can't actually find anywhere where these counters are used in the accounting code. In fact the rss_stat counters don't get used for much at all, really - non-essential stuff in the oom killer and a bit of procfs eyecandy. What have I missed. The patch makes sense from a defensive POV, but perhaps that comment is misleading.