All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org
Subject: [02/11] vcompound: pageflags: Add PageVcompound()
Date: Tue, 29 Apr 2008 21:42:53 -0700	[thread overview]
Message-ID: <20080430044319.309218061@sgi.com> (raw)
In-Reply-To: 20080430044251.266380837@sgi.com

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

Add a page flag that can be used to figure out if a compound page was
virtually mapped (virtualized). The mark is necessary since we have to
know when freeing pages if we have to destroy a virtual mapping and
we need to know that the pages of the compound are not in sequence.

A pageflag is only used if we have lots of available flags
(PAGEFLAGS_EXTENDED). Otherwise no additional flag is needed by
combining PG_swapcache together with PG_compound (similar to
PageHead() and PageTail()).

Overlaying flags has two bad effects:

1. The tests for PageVcompound become more expensive since multiple
   bits must be tested. There is a potential effect on hot codepaths.

2. Vcompound pages can not be on the LRU since PG_swapcache has
   another meaning for pages on the LRU.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
 include/linux/page-flags.h |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Index: linux-2.6/include/linux/page-flags.h
===================================================================
--- linux-2.6.orig/include/linux/page-flags.h	2008-04-28 14:34:39.953650145 -0700
+++ linux-2.6/include/linux/page-flags.h	2008-04-29 16:45:00.481208036 -0700
@@ -86,6 +86,7 @@ enum pageflags {
 #ifdef CONFIG_PAGEFLAGS_EXTENDED
 	PG_head,		/* A head page */
 	PG_tail,		/* A tail page */
+	PG_vcompound,		/* A virtualized compound page */
 #else
 	PG_compound,		/* A compound page */
 #endif
@@ -262,6 +263,7 @@ static inline void set_page_writeback(st
  */
 __PAGEFLAG(Head, head)
 __PAGEFLAG(Tail, tail)
+__PAGEFLAG(Vcompound, vcompound)
 
 static inline int PageCompound(struct page *page)
 {
@@ -305,6 +307,20 @@ static inline void __ClearPageTail(struc
 	page->flags &= ~PG_head_tail_mask;
 }
 
+#define PG_vcompound_mask ((1L << PG_compound) | (1L << PG_swapcache))
++#define PageVcompound(page)	((page->flags & PG_vcompound_mask) \
+					== PG_vcompound_mask)
+
+static inline void __SetPageVcompound(struct page *page)
+{
+	page->flags |= PG_vcompound_mask;
+}
+
+static inline void __ClearPageVcompound(struct page *page)
+{
+	page->flags &= ~PG_vcompound_mask;
+}
+
 #endif /* !PAGEFLAGS_EXTENDED */
 #endif /* !__GENERATING_BOUNDS_H */
 #endif	/* PAGE_FLAGS_H */

-- 

--
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:[~2008-04-30  4:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30  4:42 [00/11] Virtualizable Compound Page Support V5 Christoph Lameter
2008-04-30  4:42 ` [01/11] vmalloc: Return page array on vunmap Christoph Lameter
2008-04-30  4:42 ` Christoph Lameter [this message]
2008-04-30  4:42 ` [03/11] vmallocinfo: Support display of virtualized compound pages Christoph Lameter
2008-04-30  4:42 ` [04/11] vcompound: Core piece for virtualizable compound page allocation Christoph Lameter
2008-04-30  4:42 ` [05/11] vcompound: Debugging aid Christoph Lameter
2008-04-30  4:42 ` [06/11] sparsemem: Use virtualizable compound page Christoph Lameter
2008-04-30  4:42 ` [07/11] vcompound: bit waitqueue support Christoph Lameter
2008-04-30  4:42 ` [08/11] crypto: Use virtualizable compounds for temporary order 2 allocation Christoph Lameter
2008-04-30  4:43 ` [09/11] slub: Use virtualizable compound for buffer Christoph Lameter
2008-04-30  4:43 ` [10/11] vcompound: Fallback for zone wait table Christoph Lameter
2008-04-30  4:43 ` [11/11] e1000: Avoid vmalloc through virtualizable compound page Christoph Lameter
2008-04-30  4:43   ` Christoph Lameter

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=20080430044319.309218061@sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.