public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] hugetlb: Fix clear_user_highpage arguments
Date: Fri, 28 Sep 2007 12:23:18 -0700	[thread overview]
Message-ID: <20070928122318.57b99a0a.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070928185335.GA10976@linux-mips.org>

On Fri, 28 Sep 2007 19:53:35 +0100 Ralf Baechle <ralf@linux-mips.org> wrote:

> On Fri, Sep 28, 2007 at 11:45:26AM -0700, Andrew Morton 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 ;)
> 
> I guess once I convinced your employer that weird CPU architectures
> deliver more punch for the watt they stop being so weird ;-)

<wonders what you've gone and done this time>

> > > 
> > > 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?
> 
> It's totally theoretical atm, MIPS doesn't support hugetlb and I'm not
> even working on it.  I just happened to spot the issue.

sparc64 might care about this bug.

Anyway, I'll plop it in 2.6.23.

      reply	other threads:[~2007-09-28 19:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-28 16:35 [PATCH] hugetlb: Fix clear_user_highpage arguments Ralf Baechle
2007-09-28 18:45 ` Andrew Morton
2007-09-28 18:53   ` Ralf Baechle
2007-09-28 19:23     ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070928122318.57b99a0a.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox