public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Linux Kernel Mailing List <Linux-Kernel@vger.kernel.org>
Subject: [patch 5/14] mm: set_page_refs opt
Date: Sun, 06 Nov 2005 19:23:30 +1100	[thread overview]
Message-ID: <436DBD82.2070500@yahoo.com.au> (raw)
In-Reply-To: <436DBD31.8060801@yahoo.com.au>

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

5/14

-- 
SUSE Labs, Novell Inc.


[-- Attachment #2: mm-set_page_refs-opt.patch --]
[-- Type: text/plain, Size: 2767 bytes --]

Inline set_page_refs. Remove mm/internal.h

Index: linux-2.6/mm/bootmem.c
===================================================================
--- linux-2.6.orig/mm/bootmem.c
+++ linux-2.6/mm/bootmem.c
@@ -19,7 +19,6 @@
 #include <linux/module.h>
 #include <asm/dma.h>
 #include <asm/io.h>
-#include "internal.h"
 
 /*
  * Access to this subsystem has to be serialized externally. (this is
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c
+++ linux-2.6/mm/page_alloc.c
@@ -38,7 +38,6 @@
 #include <linux/vmalloc.h>
 
 #include <asm/tlbflush.h>
-#include "internal.h"
 
 /*
  * MCD - HACK: Find somewhere to initialize this EARLY, or make this
@@ -448,23 +447,6 @@ expand(struct zone *zone, struct page *p
 	return page;
 }
 
-void set_page_refs(struct page *page, int order)
-{
-#ifdef CONFIG_MMU
-	set_page_count(page, 1);
-#else
-	int i;
-
-	/*
-	 * We need to reference all the pages for this order, otherwise if
-	 * anyone accesses one of the pages with (get/put) it will be freed.
-	 * - eg: access_process_vm()
-	 */
-	for (i = 0; i < (1 << order); i++)
-		set_page_count(page + i, 1);
-#endif /* CONFIG_MMU */
-}
-
 /*
  * This page is about to be returned from the page allocator
  */
Index: linux-2.6/mm/internal.h
===================================================================
--- linux-2.6.orig/mm/internal.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* internal.h: mm/ internal definitions
- *
- * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-/* page_alloc.c */
-extern void set_page_refs(struct page *page, int order);
Index: linux-2.6/include/linux/mm.h
===================================================================
--- linux-2.6.orig/include/linux/mm.h
+++ linux-2.6/include/linux/mm.h
@@ -315,6 +315,23 @@ struct page {
 #define set_page_count(p,v) 	atomic_set(&(p)->_count, v - 1)
 #define __put_page(p)		atomic_dec(&(p)->_count)
 
+static inline void set_page_refs(struct page *page, int order)
+{
+#ifdef CONFIG_MMU
+	set_page_count(page, 1);
+#else
+	int i;
+
+	/*
+	 * We need to reference all the pages for this order, otherwise if
+	 * anyone accesses one of the pages with (get/put) it will be freed.
+	 * - eg: access_process_vm()
+	 */
+	for (i = 0; i < (1 << order); i++)
+		set_page_count(page + i, 1);
+#endif /* CONFIG_MMU */
+}
+
 extern void FASTCALL(__page_cache_release(struct page *));
 
 #ifdef CONFIG_HUGETLB_PAGE

  reply	other threads:[~2005-11-06  8:21 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-06  8:11 [rfc][patch 0/14] mm: performance improvements Nick Piggin
2005-11-06  8:20 ` [patch 1/14] mm: opt rmqueue Nick Piggin
2005-11-06  8:20   ` [patch 2/14] mm: Nick Piggin
2005-11-06  8:20   ` [patch 2/14] mm: pte prefetch Nick Piggin
2005-11-06  8:21     ` [patch 3/14] mm: release opt Nick Piggin
2005-11-06  8:22       ` [patch 4/14] mm: rmap opt Nick Piggin
2005-11-06  8:23         ` Nick Piggin [this message]
2005-11-06  8:24           ` [patch 6/14] mm: microopt conditions Nick Piggin
2005-11-06  8:24             ` [patch 7/14] mm: remove bad_range Nick Piggin
2005-11-06  8:25               ` [patch 8/14] mm: remove pcp_low Nick Piggin
2005-11-06  8:25                 ` [patch 9/14] mm: page_state opt Nick Piggin
2005-11-06  8:26                   ` [patch 10/14] mm: single pcp list Nick Piggin
2005-11-06  8:26                     ` [patch 11/14] mm: increase pcp size Nick Piggin
2005-11-06  8:27                       ` [patch 12/14] mm: variable " Nick Piggin
2005-11-06  8:27                         ` [patch 13/14] mm: cleanup zone_pcp Nick Piggin
2005-11-06  8:28                           ` [patch 14/14] mm: page_alloc cleanups Nick Piggin
2005-11-13  2:38                   ` [patch 9/14] mm: page_state opt Andi Kleen
2005-11-06 17:37               ` [patch 7/14] mm: remove bad_range Bob Picco
2005-11-07  0:58                 ` Nick Piggin
2005-11-07  3:00                   ` Bob Picco
2005-11-07  3:05                     ` Nick Piggin
2005-11-07  1:40           ` [patch 5/14] mm: set_page_refs opt Christoph Hellwig
2005-11-07  1:45             ` Nick Piggin
2005-11-06  8:35     ` [patch 2/14] mm: pte prefetch Arjan van de Ven
2005-11-06  8:51       ` Nick Piggin
2005-11-06 17:37   ` [patch 1/14] mm: opt rmqueue Andi Kleen
2005-11-07  1:06     ` Nick Piggin
2005-11-07  3:23       ` Andi Kleen
2005-11-07  3:43         ` Nick Piggin
2005-11-07  1:39 ` [rfc][patch 0/14] mm: performance improvements Christoph Hellwig
2005-11-07  1:51   ` Nick Piggin
2005-11-07  3:57     ` Paul Jackson
2005-11-07  4:51       ` Nick Piggin

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=436DBD82.2070500@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=Linux-Kernel@vger.kernel.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