All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, schwidefsky@de.ibm.com,
	heiko.carstens@de.ibm.com, y-goto@jp.fujitsu.com
Subject: Re: [PATCH] memory hotplug: fix page_zone() calculation in test_pages_isolated()
Date: Tue, 28 Oct 2008 14:00:01 +0100	[thread overview]
Message-ID: <1225198802.10037.7.camel@localhost.localdomain> (raw)
In-Reply-To: <20081028093224.a0de9f64.kamezawa.hiroyu@jp.fujitsu.com>

On Tue, 2008-10-28 at 09:32 +0900, KAMEZAWA Hiroyuki wrote:
> But
>  - "pfn" and "end_pfn" (and pfn in the middle of them) can be in different zone on strange machine.
> 
> Now: test_pages_isolated() is called in following sequence.
>   
>   check_page_isolated()
>      walk_memory_resource()			# read resource range and get start/end of pfn
>          -> chcek_page_isolated_cb()
> 		-> test_page_isolated().
> 
> I think all pages within [start, end) passed to test_pages_isolated() should be in the same zone.
> 
> please change this to
>   check_page_isolated()
>      walk_memory_resource()
>          -> check_page_isolated_cb()
>                  -> walk_page_range_in_same_zone()  # get page range in the same zone.
>                         -> test_page_isolated().
> 
> Could you try ?

There is already a "same zone" check at the beginning of offline_pages():

>	if (!test_pages_in_a_zone(start_pfn, end_pfn))
>		return -EINVAL;

So we should be safe here, the only problem that I see is that my
zone->lock patch in test_pages_isolated() is broken. As explained,
the pfn used in my page_zone(pfn_to_page(pfn)) is >= end_pfn.

I'll send a new patch to fix this, using __first_valid_page() again,
as described in my reply to Daves mail. The only other solution that
I see would be to remember the first/last !NULL page that was found
inside the for() loop. Not sure which is better, but I think I like
the first one more. Any other ideas?

Thanks,
Gerald



WARNING: multiple messages have this Message-ID (diff)
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, schwidefsky@de.ibm.com,
	heiko.carstens@de.ibm.com, y-goto@jp.fujitsu.com
Subject: Re: [PATCH] memory hotplug: fix page_zone() calculation in test_pages_isolated()
Date: Tue, 28 Oct 2008 14:00:01 +0100	[thread overview]
Message-ID: <1225198802.10037.7.camel@localhost.localdomain> (raw)
In-Reply-To: <20081028093224.a0de9f64.kamezawa.hiroyu@jp.fujitsu.com>

On Tue, 2008-10-28 at 09:32 +0900, KAMEZAWA Hiroyuki wrote:
> But
>  - "pfn" and "end_pfn" (and pfn in the middle of them) can be in different zone on strange machine.
> 
> Now: test_pages_isolated() is called in following sequence.
>   
>   check_page_isolated()
>      walk_memory_resource()			# read resource range and get start/end of pfn
>          -> chcek_page_isolated_cb()
> 		-> test_page_isolated().
> 
> I think all pages within [start, end) passed to test_pages_isolated() should be in the same zone.
> 
> please change this to
>   check_page_isolated()
>      walk_memory_resource()
>          -> check_page_isolated_cb()
>                  -> walk_page_range_in_same_zone()  # get page range in the same zone.
>                         -> test_page_isolated().
> 
> Could you try ?

There is already a "same zone" check at the beginning of offline_pages():

>	if (!test_pages_in_a_zone(start_pfn, end_pfn))
>		return -EINVAL;

So we should be safe here, the only problem that I see is that my
zone->lock patch in test_pages_isolated() is broken. As explained,
the pfn used in my page_zone(pfn_to_page(pfn)) is >= end_pfn.

I'll send a new patch to fix this, using __first_valid_page() again,
as described in my reply to Daves mail. The only other solution that
I see would be to remember the first/last !NULL page that was found
inside the for() loop. Not sure which is better, but I think I like
the first one more. Any other ideas?

Thanks,
Gerald


--
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:[~2008-10-28 13:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-27 16:49 [PATCH] memory hotplug: fix page_zone() calculation in test_pages_isolated() Gerald Schaefer
2008-10-27 16:49 ` Gerald Schaefer, Gerald Schaefer
2008-10-27 17:17 ` Gerald Schaefer
2008-10-27 17:17   ` Gerald Schaefer
2008-10-27 17:19 ` Gerald Schaefer
2008-10-27 17:19   ` Gerald Schaefer, Gerald Schaefer
2008-10-27 17:25 ` Dave Hansen
2008-10-27 17:25   ` Dave Hansen
2008-10-27 17:59   ` Gerald Schaefer
2008-10-27 17:59     ` Gerald Schaefer
2008-10-28  0:32     ` KAMEZAWA Hiroyuki
2008-10-28  0:32       ` KAMEZAWA Hiroyuki
2008-10-28 13:00       ` Gerald Schaefer [this message]
2008-10-28 13:00         ` Gerald Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2008-10-29 14:25 Gerald Schaefer
2008-10-29 14:25 ` Gerald Schaefer, Gerald Schaefer
2008-10-29 18:00 ` Nathan Fontenot
2008-10-29 18:00   ` Nathan Fontenot
2008-10-30  0:09 ` KAMEZAWA Hiroyuki
2008-10-30  0:09   ` KAMEZAWA Hiroyuki

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=1225198802.10037.7.camel@localhost.localdomain \
    --to=gerald.schaefer@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=y-goto@jp.fujitsu.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.