linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Kleikamp <shaggy@austin.ibm.com>
To: linux-mm <linux-mm@kvack.org>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>,
	Dave McCracken <dmccr@us.ibm.com>,
	Badari Pulavarty <pbadari@us.ibm.com>
Subject: [RFC:PATCH 003/008] Handle tail pages in kmap & kmap_atomic
Date: Mon, 17 Jul 2006 22:08:30 -0600	[thread overview]
Message-ID: <20060718040828.11926.51545.sendpatchset@kleikamp.austin.ibm.com> (raw)
In-Reply-To: <20060718040804.11926.76333.sendpatchset@kleikamp.austin.ibm.com>

Handle tail pages in kmap & kmap_atomic

TODO: possibly move to mm.h: lowmem_page_address()

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
---
diff -Nurp linux002/include/asm-powerpc/io.h linux003/include/asm-powerpc/io.h
--- linux002/include/asm-powerpc/io.h	2006-06-17 20:49:35.000000000 -0500
+++ linux003/include/asm-powerpc/io.h	2006-07-17 23:04:38.000000000 -0500
@@ -250,7 +250,9 @@ static inline void * phys_to_virt(unsign
 /*
  * Change "struct page" to physical address.
  */
-#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
+#define page_to_phys(page)	(PageTail(page) ?			\
+				__pa((page)->mapping->tail) :		\
+				page_to_pfn(page) << PAGE_SHIFT)
 
 /* We do NOT want virtual merging, it would put too much pressure on
  * our iommu allocator. Instead, we want drivers to be smart enough
diff -Nurp linux002/include/linux/highmem.h linux003/include/linux/highmem.h
--- linux002/include/linux/highmem.h	2006-06-17 20:49:35.000000000 -0500
+++ linux003/include/linux/highmem.h	2006-07-17 23:04:38.000000000 -0500
@@ -33,12 +33,21 @@ static inline unsigned int nr_free_highp
 static inline void *kmap(struct page *page)
 {
 	might_sleep();
+#ifdef CONFIG_FILE_TAILS
+	return PageTail(page) ? page->mapping->tail : page_address(page);
+#else
 	return page_address(page);
+#endif
 }
 
 #define kunmap(page) do { (void) (page); } while (0)
 
+#ifdef CONFIG_FILE_TAILS
+#define kmap_atomic(page, idx) \
+       	(PageTail(page) ? (page)->mapping->tail : page_address(page))
+#else
 #define kmap_atomic(page, idx)		page_address(page)
+#endif
 #define kunmap_atomic(addr, idx)	do { } while (0)
 #define kmap_atomic_pfn(pfn, idx)	page_address(pfn_to_page(pfn))
 #define kmap_atomic_to_page(ptr)	virt_to_page(ptr)

-- 
David Kleikamp
IBM Linux Technology Center

--
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>

  parent reply	other threads:[~2006-07-18  4:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-18  4:08 [RFC:PATCH 000/008] Tail Packing in the the Page Cache Dave Kleikamp
2006-07-18  4:08 ` [RFC:PATCH 001/008] Changes to common header files Dave Kleikamp
2006-07-18  4:08 ` [RFC:PATCH 002/008] Base file tail function Dave Kleikamp
2006-07-18  4:08 ` Dave Kleikamp [this message]
2006-07-18  4:08 ` [RFC:PATCH 004/008] Wrap i_size_write Dave Kleikamp
2006-07-18  4:08 ` [RFC:PATCH 005/008] unpack tail page to avoid memory mapping Dave Kleikamp
2006-07-18  4:08 ` [RFC:PATCH 006/008] Don't need to zero past end-of-file in file tail Dave Kleikamp
2006-07-18  4:09 ` [RFC:PATCH 007/008] Make sure tail page is freed correctly Dave Kleikamp
2006-07-18  4:09 ` [RFC:PATCH 008/008] Handle file tails in mm/filemap.c Dave Kleikamp

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=20060718040828.11926.51545.sendpatchset@kleikamp.austin.ibm.com \
    --to=shaggy@austin.ibm.com \
    --cc=dmccr@us.ibm.com \
    --cc=linux-mm@kvack.org \
    --cc=pbadari@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox