linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
To: linux-mm <linux-mm@kvack.org>
Subject: [RFC:PATCH 003/012] Add tail to address space and define PG_pagetail page flag
Date: Thu, 24 May 2007 08:11:46 -0400	[thread overview]
Message-ID: <20070524121146.13533.65647.sendpatchset@kleikamp.austin.ibm.com> (raw)
In-Reply-To: <20070524121130.13533.32563.sendpatchset@kleikamp.austin.ibm.com>

Add tail to address space and define PG_filetail page flag

The tail pointer in struct address_space needs to be block-aligned so that
i/o can be performed directly to/from the buffer.  The allocated buffer may
not be aligned properly, so the pointer is stored in tail_buf in order to
be freed properly.

Note: Changing from slab to slub should ensure that the allocated buffer
will be properly aligned, so only one pointer will be needed.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
---

 arch/powerpc/Kconfig       |    9 +++++++++
 include/linux/fs.h         |    4 ++++
 include/linux/page-flags.h |    9 +++++++++
 3 files changed, 22 insertions(+)

diff -Nurp linux002/arch/powerpc/Kconfig linux003/arch/powerpc/Kconfig
--- linux002/arch/powerpc/Kconfig	2007-05-21 15:14:48.000000000 -0500
+++ linux003/arch/powerpc/Kconfig	2007-05-23 22:53:11.000000000 -0500
@@ -552,6 +552,15 @@ config PPC_64K_PAGES
 	  while on hardware with such support, it will be used to map
 	  normal application pages.
 
+config VM_FILE_TAILS
+	bool "Store file tails in slab cache"
+	depends on PPC_64K_PAGES
+	help
+	  If the data at the end of a file, or the entire file, is small,
+	  the kernel will attempt to store that data in the slab cache,
+	  rather than allocate an entire page in the page cache.
+	  If unsure, say N here.
+
 config SCHED_SMT
 	bool "SMT (Hyperthreading) scheduler support"
 	depends on PPC64 && SMP
diff -Nurp linux002/include/linux/fs.h linux003/include/linux/fs.h
--- linux002/include/linux/fs.h	2007-05-23 22:53:11.000000000 -0500
+++ linux003/include/linux/fs.h	2007-05-23 22:53:11.000000000 -0500
@@ -452,6 +452,10 @@ struct address_space {
 	spinlock_t		private_lock;	/* for use by the address_space */
 	struct list_head	private_list;	/* ditto */
 	struct address_space	*assoc_mapping;	/* ditto */
+#ifdef CONFIG_VM_FILE_TAILS
+	void			*tail;		/* block-aligned, slab-packed file tail */
+	void			*tail_buf;	/* unaligned buffer holding tail */
+#endif
 } __attribute__((aligned(sizeof(long))));
 	/*
 	 * On most architectures that alignment is already the case; but
diff -Nurp linux002/include/linux/page-flags.h linux003/include/linux/page-flags.h
--- linux002/include/linux/page-flags.h	2007-05-21 15:15:44.000000000 -0500
+++ linux003/include/linux/page-flags.h	2007-05-23 22:53:11.000000000 -0500
@@ -101,6 +101,7 @@
  * 64 bit  |           FIELDS             | ??????         FLAGS         |
  *         63                            32                              0
  */
+#define PG_filetail			30	/* Pseudo-page representing tail */
 #define PG_uncached		31	/* Page has been mapped as uncached */
 #endif
 
@@ -270,6 +271,14 @@ static inline void __ClearPageTail(struc
 #define SetPageUncached(page)	set_bit(PG_uncached, &(page)->flags)
 #define ClearPageUncached(page)	clear_bit(PG_uncached, &(page)->flags)
 
+#ifdef CONFIG_VM_FILE_TAILS
+#define PageFileTail(page)	test_bit(PG_filetail, &(page)->flags)
+#else
+#define PageFileTail(page)	(0)
+#endif
+#define SetPageFileTail(page)	set_bit(PG_filetail, &(page)->flags)
+#define ClearPageFileTail(page)	clear_bit(PG_filetail, &(page)->flags)
+
 struct page;	/* forward declaration */
 
 extern void cancel_dirty_page(struct page *page, unsigned int account_size);

-- 
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:[~2007-05-24 12:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24 12:11 [RFC:PATCH 000/012] VM Page Tails Dave Kleikamp
2007-05-24 12:11 ` [RFC:PATCH 001/012] Make iommu_map_sg deal with less-than-page-aligned data Dave Kleikamp
2007-05-24 12:11 ` [RFC:PATCH 002/012] Allow file systems to specify whether to store file tails Dave Kleikamp
2007-05-24 12:11 ` Dave Kleikamp [this message]
2007-05-24 12:11 ` [RFC:PATCH 004/012] Replace PAGE_CACHE_SIZE with page_data_size() Dave Kleikamp
2007-05-24 12:11 ` [RFC:PATCH 005/012] Base file tail function Dave Kleikamp
2007-05-24 12:12 ` [RFC:PATCH 006/012] Modify lowmem_page_address() & page_to_phys() to special case tail page Dave Kleikamp
2007-05-24 12:12 ` [RFC:PATCH 007/012] Avoid page_to_pfn() on " Dave Kleikamp
2007-05-24 12:12 ` [RFC:PATCH 008/012] bh_offset needs to take page_address into consideration Dave Kleikamp
2007-05-24 12:12 ` [RFC:PATCH 009/012] Wrap i_size_write Dave Kleikamp
2007-05-24 12:12 ` [RFC:PATCH 010/012] unpack tail page to avoid memory mapping Dave Kleikamp
2007-05-24 12:12 ` [RFC:PATCH 011/012] Make sure tail page is freed correctly Dave Kleikamp
2007-05-24 12:12 ` [RFC:PATCH 012/012] Add tail hooks into file_map.c Dave Kleikamp
2007-05-24 12:45 ` [RFC:PATCH 000/012] VM File Tails 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=20070524121146.13533.65647.sendpatchset@kleikamp.austin.ibm.com \
    --to=shaggy@linux.vnet.ibm.com \
    --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