Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261241AbVEKQIY (ORCPT ); Wed, 11 May 2005 12:08:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261914AbVEKQIY (ORCPT ); Wed, 11 May 2005 12:08:24 -0400 Received: from bay-bridge.veritas.com ([143.127.3.10]:15533 "EHLO MTVMIME01.enterprise.veritas.com") by vger.kernel.org with ESMTP id S261241AbVEKQIU (ORCPT ); Wed, 11 May 2005 12:08:20 -0400 Date: Wed, 11 May 2005 17:08:56 +0100 (BST) From: Hugh Dickins X-X-Sender: hugh@goblin.wat.veritas.com To: Kirill Korotaev cc: Andrew Morton , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm acct accounting fix In-Reply-To: <428223E0.2070200@sw.ru> Message-ID: References: <428223E0.2070200@sw.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-OriginalArrivalTime: 11 May 2005 16:08:18.0395 (UTC) FILETIME=[A52D8AB0:01C55643] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1196 Lines: 33 On Wed, 11 May 2005, Kirill Korotaev wrote: > Sorry, forgot to write that all these patches are against 2.6.12-rc4... > > This patch fixes mm->total_vm and mm->locked_vm acctounting in case > when move_page_tables() fails inside move_vma(). > > Signed-Off-By: Kirill Korotaev > > --- ./mm/mremap.c.mmacct 2005-05-10 16:10:40.000000000 +0400 > +++ ./mm/mremap.c 2005-05-10 18:12:13.000000000 +0400 > @@ -213,6 +213,7 @@ static unsigned long move_vma(struct vm_ > old_len = new_len; > old_addr = new_addr; > new_addr = -ENOMEM; > + new_len = 0; > } > > /* Conceal VM_ACCOUNT so old reservation is not undone */ Are you sure? The way it's supposed to work is that the do_munmap(,,old_len) which follows, which normally unmaps the area moved from, when unsuccessful unmaps the area moved to: which will "mistakenly" decrement total_vm etc. by old_len, which needs to be bumped back up by that amount before leaving. Hugh - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/