* Breakout struct page
@ 2002-10-05 7:18 Martin J. Bligh
2002-10-05 8:22 ` Andrew Morton
2002-10-07 18:30 ` Christoph Hellwig
0 siblings, 2 replies; 4+ messages in thread
From: Martin J. Bligh @ 2002-10-05 7:18 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mm mailing list
[-- Attachment #1: Type: text/plain, Size: 5091 bytes --]
This very boring patch breaks out struct page into it's own header
file. This should allow you to do struct page arithmetic in other
header files using static inlines instead of horribly complex macros
... by just including <linux/struct_page.h>, which avoids dependency
problems.
(inlined to read, attatched for lower probability of mangling)
Martin.
diff -purN -X /home/mbligh/.diff.exclude virgin/include/linux/mm.h struct_page/include/linux/mm.h
--- virgin/include/linux/mm.h Fri Oct 4 12:15:24 2002
+++ struct_page/include/linux/mm.h Fri Oct 4 23:10:08 2002
@@ -132,55 +132,7 @@ struct vm_operations_struct {
struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int unused);
};
-/* forward declaration; pte_chain is meant to be internal to rmap.c */
-struct pte_chain;
-
-/*
- * Each physical page in the system has a struct page associated with
- * it to keep track of whatever it is we are using the page for at the
- * moment. Note that we have no way to track which tasks are using
- * a page.
- *
- * Try to keep the most commonly accessed fields in single cache lines
-
* here (16 bytes or greater). This ordering should be particularly
- * beneficial on 32-bit processors.
- *
- * The first line is data used in page cache lookup, the second line
- * is used for linear searches (eg. clock algorithm scans).
- *
- * TODO: make this structure smaller, it could be as small as 32 bytes.
- */
-struct page {
- unsigned long flags; /* atomic flags, some possibly
- updated asynchronously */
- atomic_t count; /* Usage count, see below. */
- struct list_head list; /* ->mapping has some page lists. */
- struct address_space *mapping; /* The inode (or ...) we belong to. */
- unsigned long index; /* Our offset within mapping. */
- struct list_head lru; /* Pageout list, eg. active_list;
- protected by
zone->lru_lock !! */
- union {
- struct pte_chain *chain;/* Reverse pte mapping pointer.
- * protected by PG_chainlock */
- pte_addr_t direct;
- } pte;
- unsigned long private; /* mapping-private opaque data */
-
- /*
- * On machines where all RAM is mapped into kernel address space,
- * we can simply calculate the virtual address. On machines with
- * highmem some memory is mapped into kernel virtual memory
- * dynamically, so we need a place to store that address.
- * Note that this field could be 16 bits on x86 ... ;)
- *
- * Architectures with slow multiplication can define
- * WANT_PAGE_VIRTUAL in asm/page.h
- */
-#if defined(WANT_PAGE_VIRTUAL)
- void *virtual; /* Kernel virtual address (NULL if
- not kmapped, ie.
highmem) */
-#endif /* CONFIG_HIGMEM || WANT_PAGE_VIRTUAL */
-};
+#include <linux/struct_page.h>
/*
* FIXME: take this include out, include page-flags.h in
diff -purN -X /home/mbligh/.diff.exclude virgin/include/linux/struct_page.h struct_page/include/linux/struct_page.h
--- virgin/include/linux/struct_page.h Wed Dec 31 16:00:00 1969
+++ struct_page/include/linux/struct_page.h Fri Oct 4 23:09:15 2002
@@ -0,0 +1,54 @@
+#ifndef _LINUX_STRUCT_PAGE_H
+#define _LINUX_STRUCT_PAGE_H
+
+/* forward declaration; pte_chain is meant to be internal to rmap.c */
+struct pte_chain;
+
+/*
+ * Each physical page in the system has a struct page associated with
+ * it to keep track of whatever it is we are using the page for at the
+ * moment. Note that we have
no way to track which tasks are using
+ * a page.
+ *
+ * Try to keep the most commonly accessed fields in single cache lines
+ * here (16 bytes or greater). This ordering should be particularly
+ * beneficial on 32-bit processors.
+ *
+ * The first line is data used in page cache lookup, the second line
+ * is used for linear searches (eg. clock algorithm scans).
+ *
+ * TODO: make this structure smaller, it could be as small as 32 bytes.
+ */
+struct page {
+ unsigned long flags; /* atomic flags, some possibly
+ updated asynchronously */
+ atomic_t count; /* Usage count, see below. */
+ struct list_head list; /* ->mapping has some page lists. */
+ struct address_space *mapping; /* The inode (or ...) we belong to. */
+ unsigned long
index; /* Our offset within mapping. */
+ struct list_head lru; /* Pageout list, eg. active_list;
+ protected by zone->lru_lock !! */
+ union {
+ struct pte_chain *chain;/* Reverse pte mapping pointer.
+ * protected by PG_chainlock */
+ pte_addr_t direct;
+ } pte;
+ unsigned long private; /* mapping-private opaque data */
+
+ /*
+ * On machines where all RAM is mapped into kernel address space,
+ * we can simply calculate the virtual address. On machines with
+ * highmem some memory is mapped into kernel virtual memory
+ * dynamically, so we need a place to store that address.
+ * Note that this field could be 16 bits on x86 ... ;)
+ *
+ * Architectures with slow multiplication can define
+ * WANT_PAGE_VIRTUAL in asm/page.h
+ */
+#if defined(WANT_PAGE_VIRTUAL)
+ void *virtual; /* Kernel virtual address (NULL if
+ not kmapped, ie. highmem) */
+#endif /* CONFIG_HIGMEM || WANT_PAGE_VIRTUAL */
+};
+
+#endif
[-- Attachment #2: struct_page --]
[-- Type: application/octet-stream, Size: 4734 bytes --]
diff -purN -X /home/mbligh/.diff.exclude virgin/include/linux/mm.h struct_page/include/linux/mm.h
--- virgin/include/linux/mm.h Fri Oct 4 12:15:24 2002
+++ struct_page/include/linux/mm.h Fri Oct 4 23:10:08 2002
@@ -132,55 +132,7 @@ struct vm_operations_struct {
struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int unused);
};
-/* forward declaration; pte_chain is meant to be internal to rmap.c */
-struct pte_chain;
-
-/*
- * Each physical page in the system has a struct page associated with
- * it to keep track of whatever it is we are using the page for at the
- * moment. Note that we have no way to track which tasks are using
- * a page.
- *
- * Try to keep the most commonly accessed fields in single cache lines
- * here (16 bytes or greater). This ordering should be particularly
- * beneficial on 32-bit processors.
- *
- * The first line is data used in page cache lookup, the second line
- * is used for linear searches (eg. clock algorithm scans).
- *
- * TODO: make this structure smaller, it could be as small as 32 bytes.
- */
-struct page {
- unsigned long flags; /* atomic flags, some possibly
- updated asynchronously */
- atomic_t count; /* Usage count, see below. */
- struct list_head list; /* ->mapping has some page lists. */
- struct address_space *mapping; /* The inode (or ...) we belong to. */
- unsigned long index; /* Our offset within mapping. */
- struct list_head lru; /* Pageout list, eg. active_list;
- protected by zone->lru_lock !! */
- union {
- struct pte_chain *chain;/* Reverse pte mapping pointer.
- * protected by PG_chainlock */
- pte_addr_t direct;
- } pte;
- unsigned long private; /* mapping-private opaque data */
-
- /*
- * On machines where all RAM is mapped into kernel address space,
- * we can simply calculate the virtual address. On machines with
- * highmem some memory is mapped into kernel virtual memory
- * dynamically, so we need a place to store that address.
- * Note that this field could be 16 bits on x86 ... ;)
- *
- * Architectures with slow multiplication can define
- * WANT_PAGE_VIRTUAL in asm/page.h
- */
-#if defined(WANT_PAGE_VIRTUAL)
- void *virtual; /* Kernel virtual address (NULL if
- not kmapped, ie. highmem) */
-#endif /* CONFIG_HIGMEM || WANT_PAGE_VIRTUAL */
-};
+#include <linux/struct_page.h>
/*
* FIXME: take this include out, include page-flags.h in
diff -purN -X /home/mbligh/.diff.exclude virgin/include/linux/struct_page.h struct_page/include/linux/struct_page.h
--- virgin/include/linux/struct_page.h Wed Dec 31 16:00:00 1969
+++ struct_page/include/linux/struct_page.h Fri Oct 4 23:09:15 2002
@@ -0,0 +1,54 @@
+#ifndef _LINUX_STRUCT_PAGE_H
+#define _LINUX_STRUCT_PAGE_H
+
+/* forward declaration; pte_chain is meant to be internal to rmap.c */
+struct pte_chain;
+
+/*
+ * Each physical page in the system has a struct page associated with
+ * it to keep track of whatever it is we are using the page for at the
+ * moment. Note that we have no way to track which tasks are using
+ * a page.
+ *
+ * Try to keep the most commonly accessed fields in single cache lines
+ * here (16 bytes or greater). This ordering should be particularly
+ * beneficial on 32-bit processors.
+ *
+ * The first line is data used in page cache lookup, the second line
+ * is used for linear searches (eg. clock algorithm scans).
+ *
+ * TODO: make this structure smaller, it could be as small as 32 bytes.
+ */
+struct page {
+ unsigned long flags; /* atomic flags, some possibly
+ updated asynchronously */
+ atomic_t count; /* Usage count, see below. */
+ struct list_head list; /* ->mapping has some page lists. */
+ struct address_space *mapping; /* The inode (or ...) we belong to. */
+ unsigned long index; /* Our offset within mapping. */
+ struct list_head lru; /* Pageout list, eg. active_list;
+ protected by zone->lru_lock !! */
+ union {
+ struct pte_chain *chain;/* Reverse pte mapping pointer.
+ * protected by PG_chainlock */
+ pte_addr_t direct;
+ } pte;
+ unsigned long private; /* mapping-private opaque data */
+
+ /*
+ * On machines where all RAM is mapped into kernel address space,
+ * we can simply calculate the virtual address. On machines with
+ * highmem some memory is mapped into kernel virtual memory
+ * dynamically, so we need a place to store that address.
+ * Note that this field could be 16 bits on x86 ... ;)
+ *
+ * Architectures with slow multiplication can define
+ * WANT_PAGE_VIRTUAL in asm/page.h
+ */
+#if defined(WANT_PAGE_VIRTUAL)
+ void *virtual; /* Kernel virtual address (NULL if
+ not kmapped, ie. highmem) */
+#endif /* CONFIG_HIGMEM || WANT_PAGE_VIRTUAL */
+};
+
+#endif
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Breakout struct page
2002-10-05 7:18 Breakout struct page Martin J. Bligh
@ 2002-10-05 8:22 ` Andrew Morton
2002-10-07 18:30 ` Christoph Hellwig
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2002-10-05 8:22 UTC (permalink / raw)
To: Martin J. Bligh; +Cc: linux-mm mailing list
"Martin J. Bligh" wrote:
>
> This very boring patch breaks out struct page into it's own header
> file.
Martin, I'm rather disinclined to be pushing any more cleanup
patches now. They tend to directly subtract from the merge
rate of real stuff.
--
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/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Breakout struct page
2002-10-05 7:18 Breakout struct page Martin J. Bligh
2002-10-05 8:22 ` Andrew Morton
@ 2002-10-07 18:30 ` Christoph Hellwig
2002-10-07 18:43 ` Martin J. Bligh
1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2002-10-07 18:30 UTC (permalink / raw)
To: Martin J. Bligh; +Cc: Andrew Morton, linux-mm mailing list
On Sat, Oct 05, 2002 at 12:18:23AM -0700, Martin J. Bligh wrote:
> This very boring patch breaks out struct page into it's own header
> file. This should allow you to do struct page arithmetic in other
> header files using static inlines instead of horribly complex macros
> ... by just including <linux/struct_page.h>, which avoids dependency
> problems.
>
> (inlined to read, attatched for lower probability of mangling)
I don't like a struct_page.h in addition to page-flags.h. I had a patch
for early 2.5 that create <linux/page.h> with struct page and stuff that
depends only on it (Test/Set/etc macros). IHMO that's a nicer split,
but people may flame me for this..
I'm inclinde to resubmit that one after feature freeze.
--
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/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Breakout struct page
2002-10-07 18:30 ` Christoph Hellwig
@ 2002-10-07 18:43 ` Martin J. Bligh
0 siblings, 0 replies; 4+ messages in thread
From: Martin J. Bligh @ 2002-10-07 18:43 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Andrew Morton, linux-mm mailing list
> On Sat, Oct 05, 2002 at 12:18:23AM -0700, Martin J. Bligh wrote:
>> This very boring patch breaks out struct page into it's own header
>> file. This should allow you to do struct page arithmetic in other
>> header files using static inlines instead of horribly complex macros
>> ... by just including <linux/struct_page.h>, which avoids dependency
>> problems.
>>
>> (inlined to read, attatched for lower probability of mangling)
>
> I don't like a struct_page.h in addition to page-flags.h. I had a patch
> for early 2.5 that create <linux/page.h> with struct page and stuff that
> depends only on it (Test/Set/etc macros). IHMO that's a nicer split,
> but people may flame me for this..
I really don't care how it breaks out, as long as I can get something that
uses inlines rather than macros ... at least 4 people have run into problems
with this, and it's just getting worse.
> I'm inclinde to resubmit that one after feature freeze.
Yeah, I got my hand slapped (correctly ;-)) for that one already ;-)
Definitely a post-freeze thingy.
M.
--
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/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-10-07 18:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-05 7:18 Breakout struct page Martin J. Bligh
2002-10-05 8:22 ` Andrew Morton
2002-10-07 18:30 ` Christoph Hellwig
2002-10-07 18:43 ` Martin J. Bligh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox