From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx117.postini.com [74.125.245.117]) by kanga.kvack.org (Postfix) with SMTP id 4B1166B006E for ; Fri, 8 Jun 2012 13:03:42 -0400 (EDT) Date: Fri, 8 Jun 2012 19:01:52 +0200 From: Oleg Nesterov Subject: Re: [patch 12/12] mm: correctly synchronize rss-counters at exit/exec Message-ID: <20120608170152.GA30975@redhat.com> References: <20120607212114.E4F5AA02F8@akpm.mtv.corp.google.com> <4FD1D1F7.2090503@openvz.org> <20120608122459.GB23147@redhat.com> <4FD1FE20.40600@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FD1FE20.40600@openvz.org> Sender: owner-linux-mm@kvack.org List-ID: To: Konstantin Khlebnikov Cc: Hugh Dickins , Linus Torvalds , "akpm@linux-foundation.org" , Linux Kernel Mailing List , linux-mm , "kamezawa.hiroyu@jp.fujitsu.com" , "markus@trippelsdorf.de" , "stable@vger.kernel.org" On 06/08, Konstantin Khlebnikov wrote: > > Oleg Nesterov wrote: >> On 06/08, Konstantin Khlebnikov wrote: >>> >>> As result you can see "BUG: Bad rss-counter state mm:ffff88040783a680 idx:1 val:-1" in dmesg >>> >>> There left only one problem: nobody calls sync_mm_rss() after put_user() in mm_release(). >> >> Both callers call sync_mm_rss() to make check_mm() happy. But please >> see the changelog, I think we should move it into mm_release(). See >> the patch below (on top of v2 I sent). I need to recheck. > > Patch below broken: it removes one hunk from kernel/exit.c twice. > And it does not add anything into mm_release(). Yes, sorry. But I guess you understand the intent, mm_release() should simply do sync_mm_rss() after put_user(clear_child_tid) unconditionally. If task->mm == NULL but task->rss_stat, then there is something wrong and probably OOPS makes sense. Oleg. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org