Nick Piggin wrote:
> We initially wanted to do the whole vm_normal_page thing this way, with
> another
> pte bit, but we thought there were one or two archs with no spare bits. BTW. I
> also need this bit in order to implement my lockless get_user_pages, so I do
> hope
> to get it in. I'd like to know what architectures cannot spare a software bit
> in
> their pte_present ptes...
I've been playing with the original PAGE_SPECIAL patch a little bit, and
you can find the corresponding s390 definition below that you might want
to add to your patch queue.
It is a little unclear to me, how you'd like to proceed from here:
- with PTE_SPECIAL, do we still have VM_MIXEDMAP or similar flag to
distinguish our new type of mapping from VM_PFNMAP? Which vma flags are
we supposed to use for xip mappings?
- does VM_PFNMAP work as before, or do you intend to replace it?
- what about vm_normal_page? Do you intend to have one per arch? The one
proposed by this patch breaks Jared's pfn_valid() thing and VM_PFNMAP
for archs that don't have PAGE_SPECIAL as far as I can tell.
---
Index: linux-2.6/include/asm-s390/pgtable.h
===================================================================
--- linux-2.6.orig/include/asm-s390/pgtable.h
+++ linux-2.6/include/asm-s390/pgtable.h
@@ -228,6 +228,7 @@ extern unsigned long vmalloc_end;
/* Software bits in the page table entry */
#define _PAGE_SWT 0x001 /* SW pte type bit t */
#define _PAGE_SWX 0x002 /* SW pte type bit x */
+#define _PAGE_SPECIAL 0x004 /* SW associated with special page */
/* Six different types of pages. */
#define _PAGE_TYPE_EMPTY 0x400
@@ -504,6 +505,12 @@ static inline int pte_file(pte_t pte)
return (pte_val(pte) & mask) == _PAGE_TYPE_FILE;
}
+static inline int pte_special(pte_t pte)
+{
+ BUG_ON(!pte_present(pte));
+ return (pte_val(pte) & _PAGE_SPECIAL);
+}
+
#define __HAVE_ARCH_PTE_SAME
#define pte_same(a,b) (pte_val(a) == pte_val(b))
@@ -654,6 +661,13 @@ static inline pte_t pte_mkyoung(pte_t pt
return pte;
}
+static inline pte_t pte_mkspecial(pte_t pte)
+{
+ BUG_ON(!pte_present(pte));
+ pte_val(pte) |= _PAGE_SPECIAL;
+ return pte;
+}
+
#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep)
-
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html