public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] hugetlb: Fix clear_user_highpage arguments
Date: Fri, 28 Sep 2007 19:53:35 +0100	[thread overview]
Message-ID: <20070928185335.GA10976@linux-mips.org> (raw)
In-Reply-To: <20070928114526.3398c462.akpm@linux-foundation.org>

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 ;-)

> > 
> > 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.

  Ralf

  reply	other threads:[~2007-09-28 18:53 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 [this message]
2007-09-28 19:23     ` Andrew Morton

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=20070928185335.GA10976@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@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