mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>, linux-kernel@vger.kernel.org
Subject: [PATCH 04/11] unpaged: unifdefed PageCompound
Date: Thu, 17 Nov 2005 19:32:40 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0511171931400.4563@goblin.wat.veritas.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0511171925290.4563@goblin.wat.veritas.com>

It looks like snd_xxx is not the only nopage to be using PageReserved as
a way of holding a high-order page together: which no longer works, but
is masked by our failure to free from VM_RESERVED areas.  We cannot fix
that bug without first substituting another way to hold the high-order
page together, while farming out the 0-order pages from within it.

That's just what PageCompound is designed for, but it's been kept under
CONFIG_HUGETLB_PAGE.  Remove the #ifdefs: which saves some space (out-
of-line put_page), doesn't slow down what most needs to be fast (already
using hugetlb), and unifies the way we handle high-order pages.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---

 include/linux/mm.h         |   19 -------------------
 include/linux/page-flags.h |    4 ----
 mm/page_alloc.c            |    5 -----
 mm/swap.c                  |    3 ---
 4 files changed, 31 deletions(-)

--- unpaged03/include/linux/mm.h	2005-11-17 13:53:20.000000000 +0000
+++ unpaged04/include/linux/mm.h	2005-11-17 15:10:50.000000000 +0000
@@ -311,8 +311,6 @@ struct page {
 
 extern void FASTCALL(__page_cache_release(struct page *));
 
-#ifdef CONFIG_HUGETLB_PAGE
-
 static inline int page_count(struct page *page)
 {
 	if (PageCompound(page))
@@ -329,23 +327,6 @@ static inline void get_page(struct page 
 
 void put_page(struct page *page);
 
-#else		/* CONFIG_HUGETLB_PAGE */
-
-#define page_count(p)		(atomic_read(&(p)->_count) + 1)
-
-static inline void get_page(struct page *page)
-{
-	atomic_inc(&page->_count);
-}
-
-static inline void put_page(struct page *page)
-{
-	if (put_page_testzero(page))
-		__page_cache_release(page);
-}
-
-#endif		/* CONFIG_HUGETLB_PAGE */
-
 /*
  * Multiple processes may "see" the same page. E.g. for untouched
  * mappings of /dev/null, all processes see the same page full of
--- unpaged03/include/linux/page-flags.h	2005-10-28 01:02:08.000000000 +0100
+++ unpaged04/include/linux/page-flags.h	2005-11-17 15:10:50.000000000 +0000
@@ -287,11 +287,7 @@ extern void __mod_page_state(unsigned lo
 #define ClearPageReclaim(page)	clear_bit(PG_reclaim, &(page)->flags)
 #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags)
 
-#ifdef CONFIG_HUGETLB_PAGE
 #define PageCompound(page)	test_bit(PG_compound, &(page)->flags)
-#else
-#define PageCompound(page)	0
-#endif
 #define SetPageCompound(page)	set_bit(PG_compound, &(page)->flags)
 #define ClearPageCompound(page)	clear_bit(PG_compound, &(page)->flags)
 
--- unpaged03/mm/page_alloc.c	2005-11-17 13:53:21.000000000 +0000
+++ unpaged04/mm/page_alloc.c	2005-11-17 15:10:50.000000000 +0000
@@ -148,10 +148,6 @@ static void bad_page(const char *functio
 	add_taint(TAINT_BAD_PAGE);
 }
 
-#ifndef CONFIG_HUGETLB_PAGE
-#define prep_compound_page(page, order) do { } while (0)
-#define destroy_compound_page(page, order) do { } while (0)
-#else
 /*
  * Higher-order pages are called "compound pages".  They are structured thusly:
  *
@@ -205,7 +201,6 @@ static void destroy_compound_page(struct
 		ClearPageCompound(p);
 	}
 }
-#endif		/* CONFIG_HUGETLB_PAGE */
 
 /*
  * function for dealing with page's order in buddy system.
--- unpaged03/mm/swap.c	2005-11-12 09:01:25.000000000 +0000
+++ unpaged04/mm/swap.c	2005-11-17 15:10:50.000000000 +0000
@@ -34,8 +34,6 @@
 /* How many pages do we try to swap or page in/out together? */
 int page_cluster;
 
-#ifdef CONFIG_HUGETLB_PAGE
-
 void put_page(struct page *page)
 {
 	if (unlikely(PageCompound(page))) {
@@ -52,7 +50,6 @@ void put_page(struct page *page)
 		__page_cache_release(page);
 }
 EXPORT_SYMBOL(put_page);
-#endif
 
 /*
  * Writeback is about to end against a page which has been marked for immediate

  parent reply	other threads:[~2005-11-17 19:33 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-17 19:28 [PATCH 00/11] unpaged: PageReserved VM fixups Hugh Dickins
2005-11-17 19:29 ` [PATCH 01/11] unpaged: get_user_pages VM_RESERVED Hugh Dickins
2005-11-17 23:29   ` David S. Miller
2005-11-17 19:30 ` [PATCH 02/11] unpaged: private write VM_RESERVED Hugh Dickins
2005-11-17 19:41   ` Dave Jones
2005-11-17 20:46     ` Dominik Brodowski
2005-11-17 20:51       ` Dave Jones
2005-11-17 23:58         ` David S. Miller
2005-11-18  7:12           ` Dominik Brodowski
2005-11-18  7:59             ` David S. Miller
2005-11-17 20:59       ` Dominik Brodowski
2005-11-17 23:36   ` David S. Miller
2005-11-17 19:31 ` [PATCH 03/11] unpaged: sound nopage get_page Hugh Dickins
2005-11-17 23:41   ` David S. Miller
2005-11-17 19:32 ` Hugh Dickins [this message]
2005-11-17 23:43   ` [PATCH 04/11] unpaged: unifdefed PageCompound David S. Miller
2005-11-19 20:15     ` Hugh Dickins
2005-11-19 20:55       ` William Lee Irwin III
2005-11-19 21:41         ` David S. Miller
2005-11-19 21:58           ` William Lee Irwin III
2005-11-17 19:34 ` [PATCH 05/11] unpaged: VM_UNPAGED Hugh Dickins
2005-11-17 20:59   ` William Lee Irwin III
2005-11-17 23:46   ` David S. Miller
2005-11-17 19:36 ` [PATCH 06/11] unpaged: VM_NONLINEAR VM_RESERVED Hugh Dickins
2005-11-17 19:37 ` [PATCH 07/11] unpaged: COW on VM_UNPAGED Hugh Dickins
2005-11-17 23:52   ` David S. Miller
2005-11-18  5:46     ` Nick Piggin
2005-11-18  6:45       ` David S. Miller
2005-11-18  7:27         ` Hugh Dickins
2005-11-18  7:46           ` Andrew Morton
2005-11-18  8:04           ` David S. Miller
2005-11-18  8:12             ` Hugh Dickins
2005-11-18  8:02         ` Hugh Dickins
2005-11-18  8:08           ` David S. Miller
2005-11-18  8:13             ` Hugh Dickins
2005-11-18  8:36               ` David S. Miller
2005-11-18  9:33                 ` Hugh Dickins
2005-11-18 21:08           ` Dave Jones
2005-11-18 19:12     ` Alan Cox
2005-11-17 19:38 ` [PATCH 08/11] unpaged: anon in VM_UNPAGED Hugh Dickins
2005-11-17 19:38 ` [PATCH 09/11] unpaged: ZERO_PAGE " Hugh Dickins
2005-11-17 21:25   ` Ingo Oeser
2005-11-18 19:58     ` Hugh Dickins
2005-11-17 19:39 ` [PATCH 10/11] unpaged: PG_reserved bad_page Hugh Dickins
2005-11-17 19:40 ` [PATCH 11/11] unpaged: copy_page_range vma Hugh Dickins

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=Pine.LNX.4.61.0511171931400.4563@goblin.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /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

all inboxes | Powered by JetHome®