aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2013-02-22 19:34:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 20:50:17 -0500
commitbbeae5b05ef6e40bf54db05ceb8635824153b9e2 (patch)
tree293d8b4e4bfc06367908df1915460905a5f8408b /include/linux/mm.h
parent3c0ff4689630b280704666833e9539d84cddc373 (diff)
mm: move page flags layout to separate header
This is a preparation patch for moving page->_last_nid into page->flags that moves page flag layout information to a separate header. This patch is necessary because otherwise there would be a circular dependency between mm_types.h and mm.h. Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Simon Jeons <simon.jeons@gmail.com> Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h40
1 files changed, 0 insertions, 40 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a114b8eb7676..c2d7d5993b14 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -581,52 +581,12 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
581 * sets it, so none of the operations on it need to be atomic. 581 * sets it, so none of the operations on it need to be atomic.
582 */ 582 */
583 583
584
585/*
586 * page->flags layout:
587 *
588 * There are three possibilities for how page->flags get
589 * laid out. The first is for the normal case, without
590 * sparsemem. The second is for sparsemem when there is
591 * plenty of space for node and section. The last is when
592 * we have run out of space and have to fall back to an
593 * alternate (slower) way of determining the node.
594 *
595 * No sparsemem or sparsemem vmemmap: | NODE | ZONE | ... | FLAGS |
596 * classic sparse with space for node:| SECTION | NODE | ZONE | ... | FLAGS |
597 * classic sparse no space for node: | SECTION | ZONE | ... | FLAGS |
598 */
599#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
600#define SECTIONS_WIDTH SECTIONS_SHIFT
601#else
602#define SECTIONS_WIDTH 0
603#endif
604
605#define ZONES_WIDTH ZONES_SHIFT
606
607#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS
608#define NODES_WIDTH NODES_SHIFT
609#else
610#ifdef CONFIG_SPARSEMEM_VMEMMAP
611#error "Vmemmap: No space for nodes field in page flags"
612#endif
613#define NODES_WIDTH 0
614#endif
615
616/* Page flags: | [SECTION] | [NODE] | ZONE | ... | FLAGS | */ 584/* Page flags: | [SECTION] | [NODE] | ZONE | ... | FLAGS | */
617#define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH) 585#define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH)
618#define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) 586#define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH)
619#define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) 587#define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH)
620 588
621/* 589/*
622 * We are going to use the flags for the page to node mapping if its in
623 * there. This includes the case where there is no node, so it is implicit.
624 */
625#if !(NODES_WIDTH > 0 || NODES_SHIFT == 0)
626#define NODE_NOT_IN_PAGE_FLAGS
627#endif
628
629/*
630 * Define the bit shifts to access each section. For non-existent 590 * Define the bit shifts to access each section. For non-existent
631 * sections we define the shift as 0; that plus a 0 mask ensures 591 * sections we define the shift as 0; that plus a 0 mask ensures
632 * the compiler will optimise away reference to them. 592 * the compiler will optimise away reference to them.