linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Badari Pulavarty <pbadari@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Andy Whitcroft <apw@shadowen.org>,
	linux-mm@kvack.org, linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: page flags ?
Date: 19 May 2005 11:29:11 -0700	[thread overview]
Message-ID: <1116527349.26913.1353.camel@dyn318077bld.beaverton.ibm.com> (raw)
In-Reply-To: <20050519041116.1e3a6d29.akpm@osdl.org>

[-- Attachment #1: Type: text/plain, Size: 629 bytes --]

On Thu, 2005-05-19 at 04:11, Andrew Morton wrote:
> Andy Whitcroft <apw@shadowen.org> wrote:
> >
> >  > How many bits are spare now?  ZONETABLE_PGSHIFT hurts my brain.
> > 
> >  The short answer is that on 32 bit architectures there are 24 bits
> >  allocated to general page flags, page-flags.h indicates that 21 are
> >  currently assigned so assuming it is accurate there are currently 3 bits
> >  free.
> 
> Yipes, I didn't realise we were that close.
> 
> We can reclaim PG_highmem, use page_zone(page)->highmem

Your wish is my command :)

I am worried about the overhead this might add to kmap/kunmap().

Thanks,
Badari



[-- Attachment #2: PG_highmem-remove.patch --]
[-- Type: text/plain, Size: 5454 bytes --]

Patch to remove PG_highmem from page->flags.

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
 arch/frv/mm/init.c         |    1 -
 arch/i386/mm/init.c        |    1 -
 arch/mips/mm/init.c        |    1 -
 arch/ppc/mm/init.c         |    1 -
 arch/sparc/mm/init.c       |    1 -
 arch/um/kernel/mem.c       |    1 -
 fs/reiser4/page_cache.c    |    3 +--
 include/linux/page-flags.h |    4 ++--
 8 files changed, 3 insertions(+), 10 deletions(-)
diff -X dontdiff -Narup linux-2.6.12-rc4.org/arch/frv/mm/init.c linux-2.6.12-rc4/arch/frv/mm/init.c
--- linux-2.6.12-rc4.org/arch/frv/mm/init.c	2005-05-06 22:20:31.000000000 -0700
+++ linux-2.6.12-rc4/arch/frv/mm/init.c	2005-05-19 03:43:27.266433184 -0700
@@ -169,7 +169,6 @@ void __init mem_init(void)
 		struct page *page = &mem_map[pfn];
 
 		ClearPageReserved(page);
-		set_bit(PG_highmem, &page->flags);
 		set_page_count(page, 1);
 		__free_page(page);
 		totalram_pages++;
diff -X dontdiff -Narup linux-2.6.12-rc4.org/arch/i386/mm/init.c linux-2.6.12-rc4/arch/i386/mm/init.c
--- linux-2.6.12-rc4.org/arch/i386/mm/init.c	2005-05-17 02:27:11.350562312 -0700
+++ linux-2.6.12-rc4/arch/i386/mm/init.c	2005-05-19 03:43:43.178014256 -0700
@@ -269,7 +269,6 @@ void __init one_highpage_init(struct pag
 {
 	if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) {
 		ClearPageReserved(page);
-		set_bit(PG_highmem, &page->flags);
 		set_page_count(page, 1);
 		__free_page(page);
 		totalhigh_pages++;
diff -X dontdiff -Narup linux-2.6.12-rc4.org/arch/mips/mm/init.c linux-2.6.12-rc4/arch/mips/mm/init.c
--- linux-2.6.12-rc4.org/arch/mips/mm/init.c	2005-05-06 22:20:31.000000000 -0700
+++ linux-2.6.12-rc4/arch/mips/mm/init.c	2005-05-19 03:43:57.457843392 -0700
@@ -232,7 +232,6 @@ void __init mem_init(void)
 #ifdef CONFIG_LIMITED_DMA
 		set_page_address(page, lowmem_page_address(page));
 #endif
-		set_bit(PG_highmem, &page->flags);
 		set_page_count(page, 1);
 		__free_page(page);
 		totalhigh_pages++;
diff -X dontdiff -Narup linux-2.6.12-rc4.org/arch/ppc/mm/init.c linux-2.6.12-rc4/arch/ppc/mm/init.c
--- linux-2.6.12-rc4.org/arch/ppc/mm/init.c	2005-05-17 02:27:11.400554712 -0700
+++ linux-2.6.12-rc4/arch/ppc/mm/init.c	2005-05-19 03:44:18.800598800 -0700
@@ -459,7 +459,6 @@ void __init mem_init(void)
 			struct page *page = mem_map + pfn;
 
 			ClearPageReserved(page);
-			set_bit(PG_highmem, &page->flags);
 			set_page_count(page, 1);
 			__free_page(page);
 			totalhigh_pages++;
diff -X dontdiff -Narup linux-2.6.12-rc4.org/arch/sparc/mm/init.c linux-2.6.12-rc4/arch/sparc/mm/init.c
--- linux-2.6.12-rc4.org/arch/sparc/mm/init.c	2005-05-06 22:20:31.000000000 -0700
+++ linux-2.6.12-rc4/arch/sparc/mm/init.c	2005-05-19 03:44:40.526295992 -0700
@@ -384,7 +384,6 @@ void map_high_region(unsigned long start
 		struct page *page = pfn_to_page(tmp);
 
 		ClearPageReserved(page);
-		set_bit(PG_highmem, &page->flags);
 		set_page_count(page, 1);
 		__free_page(page);
 		totalhigh_pages++;
diff -X dontdiff -Narup linux-2.6.12-rc4.org/arch/um/kernel/mem.c linux-2.6.12-rc4/arch/um/kernel/mem.c
--- linux-2.6.12-rc4.org/arch/um/kernel/mem.c	2005-05-06 22:20:31.000000000 -0700
+++ linux-2.6.12-rc4/arch/um/kernel/mem.c	2005-05-19 03:45:00.200305088 -0700
@@ -53,7 +53,6 @@ static void setup_highmem(unsigned long 
 	for(i = 0; i < highmem_len >> PAGE_SHIFT; i++){
 		page = &mem_map[highmem_pfn + i];
 		ClearPageReserved(page);
-		set_bit(PG_highmem, &page->flags);
 		set_page_count(page, 1);
 		__free_page(page);
 	}
diff -X dontdiff -Narup linux-2.6.12-rc4.org/fs/reiser4/page_cache.c linux-2.6.12-rc4/fs/reiser4/page_cache.c
--- linux-2.6.12-rc4.org/fs/reiser4/page_cache.c	2005-05-17 02:27:19.258360144 -0700
+++ linux-2.6.12-rc4/fs/reiser4/page_cache.c	2005-05-19 03:45:38.432492912 -0700
@@ -744,7 +744,7 @@ print_page(const char *prefix, struct pa
 	}
 	printk("%s: page index: %lu mapping: %p count: %i private: %lx\n",
 	       prefix, page->index, page->mapping, page_count(page), page->private);
-	printk("\tflags: %s%s%s%s %s%s%s %s%s%s %s%s%s\n",
+	printk("\tflags: %s%s%s%s %s%s%s %s%s %s%s%s\n",
 	       page_flag_name(page, PG_locked),
 	       page_flag_name(page, PG_error),
 	       page_flag_name(page, PG_referenced),
@@ -754,7 +754,6 @@ print_page(const char *prefix, struct pa
 	       page_flag_name(page, PG_lru),
 	       page_flag_name(page, PG_slab),
 
-	       page_flag_name(page, PG_highmem),
 	       page_flag_name(page, PG_checked),
 	       page_flag_name(page, PG_reserved),
 
diff -X dontdiff -Narup linux-2.6.12-rc4.org/include/linux/page-flags.h linux-2.6.12-rc4/include/linux/page-flags.h
--- linux-2.6.12-rc4.org/include/linux/page-flags.h	2005-05-17 02:27:20.248209664 -0700
+++ linux-2.6.12-rc4/include/linux/page-flags.h	2005-05-19 03:46:57.214516224 -0700
@@ -61,7 +61,7 @@
 #define PG_active		 6
 #define PG_slab			 7	/* slab debug (Suparna wants this) */
 
-#define PG_highmem		 8
+#define PG_highmem_removed	 8	/* Trying to kill this */
 #define PG_fs_misc		 9	/* Filesystem specific bit */
 #define PG_checked		 9	/* kill me in 2.5.<early>. */
 #define PG_arch_1		10
@@ -216,7 +216,7 @@ extern void __mod_page_state(unsigned of
 #define TestSetPageSlab(page)	test_and_set_bit(PG_slab, &(page)->flags)
 
 #ifdef CONFIG_HIGHMEM
-#define PageHighMem(page)	test_bit(PG_highmem, &(page)->flags)
+#define PageHighMem(page)	is_highmem(page_zone(page))
 #else
 #define PageHighMem(page)	0 /* needed to optimize away at compile time */
 #endif

  parent reply	other threads:[~2005-05-19 18:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-18 21:13 page flags ? Badari Pulavarty
2005-05-18 21:56 ` Andrew Morton
2005-05-18 22:42   ` Badari Pulavarty
2005-05-18 23:23     ` Andrew Morton
2005-05-19  0:09       ` Badari Pulavarty
2005-05-19  0:26         ` Chandra Seetharaman
2005-05-19  1:36         ` Dave Hansen
2005-05-19 10:51       ` Andy Whitcroft
2005-05-19 11:11         ` Andrew Morton
2005-05-19 14:37           ` Nikita Danilov
2005-05-19 18:29           ` Badari Pulavarty [this message]
2005-05-19 22:53             ` Andrew Morton
2005-05-19 23:34               ` Badari Pulavarty
2005-05-20  0:03                 ` Martin J. Bligh
2005-05-19 23:55                   ` Badari Pulavarty
2005-05-20  0:20                     ` Martin J. Bligh
2005-05-18 23:57     ` Bryan Henderson

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=1116527349.26913.1353.camel@dyn318077bld.beaverton.ibm.com \
    --to=pbadari@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=apw@shadowen.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).