linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Akinobu Mita <akinobu.mita@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	linux-mm@kvack.org, mingo@elte.hu, jirislaby@gmail.com,
	rmk+lkml@arm.linux.org.uk
Subject: Re: [PATCH] generic debug pagealloc (-v2)
Date: Fri, 6 Mar 2009 12:28:14 +0900	[thread overview]
Message-ID: <20090306032814.GA9874@localhost.localdomain> (raw)
In-Reply-To: <20090305143150.136e2708.akpm@linux-foundation.org>

On Thu, Mar 05, 2009 at 02:31:50PM -0800, Andrew Morton wrote:
> > +#include <linux/kernel.h>
> > +#include <linux/mm.h>
> > +
> > +static void poison_page(struct page *page)
> > +{
> > +	void *addr;
> > +
> > +	if (PageHighMem(page))
> > +		return; /* i goofed */
> 
> heh.  A more complete comment would be needed here.
> 
> Also, as this is a kernel bug, perhaps some sort of runtime warning?

It just skips the poisoning for highmem pages.
Any page poisoning can be skipped safely if it doesn't set the page->poison
flag. So I'm going to put

/*
 * skipping the page poisoning for highmem pages
 */

> > +	page->poison = true;
> > +	addr = page_address(page);
> > +	memset(addr, PAGE_POISON, PAGE_SIZE);
> > +}

...

> > +static void unpoison_page(struct page *page)
> > +{
> > +	void *addr;
> > +
> 
> Shouldn't we check PageHighmem() here also?

It should not happen because page->poison flag is not set for highmem pages.
But it's good for sanity checking. So I'll have a BUG_ON here.

> > +	if (!page->poison)
> > +		return;
> > +

	BUG_ON(PageHighMem(page));

> > +	addr = page_address(page);
> > +	check_poison_mem(addr, PAGE_SIZE);
> > +	page->poison = false;
> > +}

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-03-06  3:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05 14:59 Akinobu Mita
2009-03-05 22:31 ` Andrew Morton
2009-03-06  3:28   ` Akinobu Mita [this message]
2009-03-06 15:39     ` [PATCH] generic debug pagealloc (-v3) Akinobu Mita
2009-03-06 20:45       ` Andrew Morton
2009-03-07 16:29         ` [PATCH] generic debug pagealloc (-v4) Akinobu Mita

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=20090306032814.GA9874@localhost.localdomain \
    --to=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jirislaby@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=rmk+lkml@arm.linux.org.uk \
    /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