From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Sep 2007 19:46:19 +0100 (BST) Received: from smtp2.linux-foundation.org ([207.189.120.14]:50661 "EHLO smtp2.linux-foundation.org") by ftp.linux-mips.org with ESMTP id S20030413AbXI1SqK (ORCPT ); Fri, 28 Sep 2007 19:46:10 +0100 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [207.189.120.55]) by smtp2.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id l8SIjQQE032054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Sep 2007 11:45:27 -0700 Received: from box (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id l8SIjQJ4012244; Fri, 28 Sep 2007 11:45:26 -0700 Date: Fri, 28 Sep 2007 11:45:26 -0700 From: Andrew Morton To: Ralf Baechle Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: Re: [PATCH] hugetlb: Fix clear_user_highpage arguments Message-Id: <20070928114526.3398c462.akpm@linux-foundation.org> In-Reply-To: <20070928163545.GA5933@linux-mips.org> References: <20070928163545.GA5933@linux-mips.org> X-Mailer: Sylpheed 2.4.1 (GTK+ 2.8.17; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.185 $ X-Scanned-By: MIMEDefang 2.53 on 207.189.120.14 Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 16732 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: akpm@linux-foundation.org Precedence: bulk X-list: linux-mips On Fri, 28 Sep 2007 17:35:45 +0100 Ralf Baechle wrote: > The virtual address space argument of clear_user_highpage is supposed to > be the virtual address where the page being cleared will eventually be > mapped. This allows architectures with virtually indexed caches a few > clever tricks. That sort of trick falls over in painful ways if the > virtual address argument is wrong. yeah, but only if you're using a weird CPU architecture ;) > Signed-off-by: Ralf Baechle > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 84c795e..eab8c42 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -42,7 +42,7 @@ static void clear_huge_page(struct page *page, unsigned long addr) > might_sleep(); > for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); i++) { > cond_resched(); > - clear_user_highpage(page + i, addr); > + clear_user_highpage(page + i, addr + i * PAGE_SIZE); > } > } > I'll add this to the 2.6.23 queue. Is it needed in 2.6.22.x?