xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] mm: Enable set_page_section() only if CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP
@ 2011-05-02 21:20 Daniel Kiper
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Kiper @ 2011-05-02 21:20 UTC (permalink / raw)
  To: ian.campbell, akpm, andi.kleen, haicheng.li, fengguang.wu, jeremy,
	konrad.wilk, dan.magenheimer

set_page_section() is valid only in CONFIG_SPARSEMEM and
!CONFIG_SPARSEMEM_VMEMMAP context. Move it to proper place
and amend accordingly functions which are using it.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
---
 include/linux/mm.h |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 692dbae..23465e1 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -680,6 +680,12 @@ static inline struct zone *page_zone(struct page *page)
 }
 
 #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
+static inline void set_page_section(struct page *page, unsigned long section)
+{
+	page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT);
+	page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
+}
+
 static inline unsigned long page_to_section(struct page *page)
 {
 	return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
@@ -698,18 +704,14 @@ static inline void set_page_node(struct page *page, unsigned long node)
 	page->flags |= (node & NODES_MASK) << NODES_PGSHIFT;
 }
 
-static inline void set_page_section(struct page *page, unsigned long section)
-{
-	page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT);
-	page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
-}
-
 static inline void set_page_links(struct page *page, enum zone_type zone,
 	unsigned long node, unsigned long pfn)
 {
 	set_page_zone(page, zone);
 	set_page_node(page, node);
+#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
 	set_page_section(page, pfn_to_section_nr(pfn));
+#endif
 }
 
 /*
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/4] mm: Enable set_page_section() only if CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP
       [not found] <20110502212012.GC4623@router-fw-old.local.net-space.pl>
@ 2011-05-02 22:50 ` Dave Hansen
  2011-05-11 23:10 ` David Rientjes
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Hansen @ 2011-05-02 22:50 UTC (permalink / raw)
  To: Daniel Kiper
  Cc: ian.campbell, akpm, andi.kleen, haicheng.li, fengguang.wu, jeremy,
	konrad.wilk, dan.magenheimer, v.tolstov, pasik, wdauchy, rientjes,
	xen-devel, linux-kernel, linux-mm

On Mon, 2011-05-02 at 23:20 +0200, Daniel Kiper wrote:
> set_page_section() is valid only in CONFIG_SPARSEMEM and
> !CONFIG_SPARSEMEM_VMEMMAP context. Move it to proper place
> and amend accordingly functions which are using it.

I guess we've been wasting all that time setting section bits in
page->flags that we'll never use.  Looks sane to me.

Acked-by: Dave Hansen <dave@linux.vnet.ibm.com>

-- Dave

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/4] mm: Enable set_page_section() only if CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP
       [not found] <20110502212012.GC4623@router-fw-old.local.net-space.pl>
  2011-05-02 22:50 ` [PATCH 2/4] mm: Enable set_page_section() only if CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP Dave Hansen
@ 2011-05-11 23:10 ` David Rientjes
  1 sibling, 0 replies; 3+ messages in thread
From: David Rientjes @ 2011-05-11 23:10 UTC (permalink / raw)
  To: Daniel Kiper
  Cc: ian.campbell, akpm, andi.kleen, haicheng.li, fengguang.wu, jeremy,
	konrad.wilk, dan.magenheimer, v.tolstov, pasik, dave, wdauchy,
	xen-devel, linux-kernel, linux-mm

On Mon, 2 May 2011, Daniel Kiper wrote:

> set_page_section() is valid only in CONFIG_SPARSEMEM and
> !CONFIG_SPARSEMEM_VMEMMAP context.

s/valid/needed/.  set_page_section() _is_ valid in all contexts since 
SECTIONS_MASK and SECTIONS_PGSHIFT is defined in all contexts.  

> Move it to proper place
> and amend accordingly functions which are using it.
> 
> Signed-off-by: Daniel Kiper <dkiper@net-space.pl>

After the changelog is fixed:

	Acked-by: David Rientjes <rientjes@google.com>

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-11 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20110502212012.GC4623@router-fw-old.local.net-space.pl>
2011-05-02 22:50 ` [PATCH 2/4] mm: Enable set_page_section() only if CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP Dave Hansen
2011-05-11 23:10 ` David Rientjes
2011-05-02 21:20 Daniel Kiper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).