WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux: allow use of split page table locks

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: allow use of split page table locks
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 01 Mar 2007 16:27:13 +0000
Delivery-date: Thu, 01 Mar 2007 08:27:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This changes netback to use struct page's mapping field instead of the
index one, and the PageForeign logic the other way around. That way,
CONFIG_SPLIT_PTLOCK_CPUS doesn't have to be suppressed anymore for x86.

After that adjustment, the sparse tree's mm/Kconfig should be identical
to native and could hence be deleted.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: head-2007-02-27/drivers/xen/netback/netback.c
===================================================================
--- head-2007-02-27.orig/drivers/xen/netback/netback.c  2007-02-27 
16:31:12.000000000 +0100
+++ head-2007-02-27/drivers/xen/netback/netback.c       2007-03-01 
15:23:00.000000000 +0100
@@ -40,6 +40,9 @@
 
 /*#define NETBE_DEBUG_INTERRUPT*/
 
+/* extra field used in struct page */
+#define netif_page_index(pg) (*(long *)&(pg)->mapping)
+
 struct netbk_rx_meta {
        skb_frag_t frag;
        int id;
@@ -352,7 +355,7 @@ static u16 netbk_gop_frag(netif_t *netif
                copy_gop->flags = GNTCOPY_dest_gref;
                if (PageForeign(page)) {
                        struct pending_tx_info *src_pend =
-                               &pending_tx_info[page->index];
+                               &pending_tx_info[netif_page_index(page)];
                        copy_gop->source.domid = src_pend->netif->domid;
                        copy_gop->source.u.ref = src_pend->req.gref;
                        copy_gop->flags |= GNTCOPY_source_gref;
@@ -1327,7 +1330,7 @@ static void netif_page_release(struct pa
        /* Ready for next use. */
        init_page_count(page);
 
-       netif_idx_release(page->index);
+       netif_idx_release(netif_page_index(page));
 }
 
 irqreturn_t netif_be_int(int irq, void *dev_id, struct pt_regs *regs)
@@ -1457,7 +1460,7 @@ static int __init netback_init(void)
        for (i = 0; i < MAX_PENDING_REQS; i++) {
                page = mmap_pages[i];
                SetPageForeign(page, netif_page_release);
-               page->index = i;
+               netif_page_index(page) = i;
        }
 
        pending_cons = 0;
Index: head-2007-02-27/include/linux/page-flags.h
===================================================================
--- head-2007-02-27.orig/include/linux/page-flags.h     2007-02-27 
16:26:22.000000000 +0100
+++ head-2007-02-27/include/linux/page-flags.h  2007-03-01 15:15:29.000000000 
+0100
@@ -252,14 +252,14 @@ static inline void SetPageUptodate(struc
 #define PageForeign(page)      test_bit(PG_foreign, &(page)->flags)
 #define SetPageForeign(page, dtor) do {                \
        set_bit(PG_foreign, &(page)->flags);    \
-       (page)->mapping = (void *)dtor;         \
+       (page)->index = (long)(dtor);           \
 } while (0)
 #define ClearPageForeign(page) do {            \
        clear_bit(PG_foreign, &(page)->flags);  \
-       (page)->mapping = NULL;                 \
+       (page)->index = 0;                      \
 } while (0)
 #define PageForeignDestructor(page)            \
-       ( (void (*) (struct page *)) (page)->mapping )(page)
+       ( (void (*) (struct page *)) (page)->index )(page)
 
 struct page;   /* forward declaration */
 
Index: head-2007-02-27/mm/Kconfig
===================================================================
--- head-2007-02-27.orig/mm/Kconfig     2007-02-27 16:23:14.000000000 +0100
+++ head-2007-02-27/mm/Kconfig  2007-03-01 15:16:15.000000000 +0100
@@ -127,14 +127,11 @@ config MEMORY_HOTPLUG_SPARSE
 # Default to 4 for wider testing, though 8 might be more appropriate.
 # ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock.
 # PA-RISC 7xxx's spinlock_t would enlarge struct page from 32 to 44 bytes.
-# XEN on x86 architecture uses the mapping field on pagetable pages to store a
-# pointer to the destructor. This conflicts with pte_lock_deinit().
 #
 config SPLIT_PTLOCK_CPUS
        int
        default "4096" if ARM && !CPU_CACHE_VIPT
        default "4096" if PARISC && !PA20
-       default "4096" if X86_XEN || X86_64_XEN
        default "4"
 
 #



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>