From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934186AbbDXAVi (ORCPT ); Thu, 23 Apr 2015 20:21:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34690 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751565AbbDXAVd (ORCPT ); Thu, 23 Apr 2015 20:21:33 -0400 Message-ID: <55398C82.5000103@redhat.com> Date: Thu, 23 Apr 2015 20:21:22 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Andrew Morton CC: linux-kernel@vger.kernel.org, Oleg Nesterov , Michal Hocko Subject: Re: [PATCH] exit,stats: /* obey this comment */ References: <20150423171759.6cdce17d@cuia.bos.redhat.com> <20150423144731.2c591c8eb70755b54ac83917@linux-foundation.org> In-Reply-To: <20150423144731.2c591c8eb70755b54ac83917@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/23/2015 05:47 PM, Andrew Morton wrote: > 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. Don't the get reported to userspace in things like this? $ /usr/bin/time ls /dev ... 0.00user 0.00system 0:00.00elapsed 33%CPU (0avgtext+0avgdata 2652maxresident)k 0inputs+0outputs (0major+135minor)pagefaults 0swaps Though admittedly this thing only reports maxresident... I think there is some tool that reports the avg resident rss, but I cannot remember what it is. -- All rights reversed