From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Derzhavets Subject: Re: Re: 2.6.37-rc1 mainline domU - BUG: unable to handle kernel paging request Date: Thu, 2 Dec 2010 00:33:00 -0800 (PST) Message-ID: <99241.35375.qm@web56103.mail.re3.yahoo.com> References: <4CF73DCF.4010200@goop.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1940429291==" Return-path: In-Reply-To: <4CF73DCF.4010200@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Bruce Edge , Jeremy Fitzhardinge Cc: xen-devel@lists.xensource.com, Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org --===============1940429291== Content-Type: multipart/alternative; boundary="0-1440248469-1291278780=:35375" --0-1440248469-1291278780=:35375 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Could you , please, resend the patch as raw attachment. Boris. --- On Thu, 12/2/10, Jeremy Fitzhardinge wrote: From: Jeremy Fitzhardinge Subject: Re: [Xen-devel] Re: 2.6.37-rc1 mainline domU - BUG: unable to hand= le kernel paging request To: "Bruce Edge" Cc: "Boris Derzhavets" , xen-devel@lists.xensource.c= om, "Konrad Rzeszutek Wilk" Date: Thursday, December 2, 2010, 1:33 AM On 12/01/2010 01:32 PM, Bruce Edge wrote: > I just checked the recently released 2.6.73-rc4, Do you mean mainline 2.6.37-rc4, or the one in xen/next-2.6.37? >=A0 and while the BUG > signature is different, it still fails under NFS accesses. This is > 100% recreatable. Please try this patch which is queued up for mainline.=A0 It's already in xen/next-2.6.37. =A0 =A0 J diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 21ed8d7..0e4ecac 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -2358,8 +2358,6 @@ void __init xen_init_mmu_ops(void) =A0=A0=A0 x86_init.paging.pagetable_setup_done =3D xen_pagetable_setup_don= e; =A0=A0=A0 pv_mmu_ops =3D xen_mmu_ops; =20 -=A0=A0=A0 vmap_lazy_unmap =3D false; - =A0=A0=A0 memset(dummy_mapping, 0xff, PAGE_SIZE); } =20 diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index a03dcf6..44b54f6 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -7,8 +7,6 @@ =20 struct vm_area_struct;=A0=A0=A0 =A0=A0=A0 /* vma defining user mapping in = mm_types.h */ =20 -extern bool vmap_lazy_unmap; - /* bits in flags of vmalloc's vm_struct below */ #define VM_IOREMAP=A0=A0=A0 0x00000001=A0=A0=A0 /* ioremap() and friends *= / #define VM_ALLOC=A0=A0=A0 0x00000002=A0=A0=A0 /* vmalloc() */ diff --git a/mm/vmalloc.c b/mm/vmalloc.c index a3d66b3..eb5cc7d 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -31,8 +31,6 @@ #include #include =20 -bool vmap_lazy_unmap __read_mostly =3D true; - /*** Page table manipulation functions ***/ =20 static void vunmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long= end) @@ -503,9 +501,6 @@ static unsigned long lazy_max_pages(void) { =A0=A0=A0 unsigned int log; =20 -=A0=A0=A0 if (!vmap_lazy_unmap) -=A0=A0=A0 =A0=A0=A0 return 0; - =A0=A0=A0 log =3D fls(num_online_cpus()); =20 =A0=A0=A0 return log * (32UL * 1024 * 1024 / PAGE_SIZE); @@ -566,7 +561,6 @@ static void __purge_vmap_area_lazy(unsigned long *start= , unsigned long *end, =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 if (va->va_end > *end) =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 *end =3D va->va_end; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 nr +=3D (va->va_end - va->va_start) >> PAGE_= SHIFT; -=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 unmap_vmap_area(va); =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 list_add_tail(&va->purge_list, &valist); =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 va->flags |=3D VM_LAZY_FREEING; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 va->flags &=3D ~VM_LAZY_FREE; @@ -611,10 +605,11 @@ static void purge_vmap_area_lazy(void) } =20 /* - * Free and unmap a vmap area, caller ensuring flush_cache_vunmap had been - * called for the correct range previously. + * Free a vmap area, caller ensuring that the area has been unmapped + * and flush_cache_vunmap had been called for the correct range + * previously. =A0 */ -static void free_unmap_vmap_area_noflush(struct vmap_area *va) +static void free_vmap_area_noflush(struct vmap_area *va) { =A0=A0=A0 va->flags |=3D VM_LAZY_FREE; =A0=A0=A0 atomic_add((va->va_end - va->va_start) >> PAGE_SHIFT, &vmap_lazy= _nr); @@ -623,6 +618,16 @@ static void free_unmap_vmap_area_noflush(struct vmap_a= rea *va) } =20 /* + * Free and unmap a vmap area, caller ensuring flush_cache_vunmap had been + * called for the correct range previously. + */ +static void free_unmap_vmap_area_noflush(struct vmap_area *va) +{ +=A0=A0=A0 unmap_vmap_area(va); +=A0=A0=A0 free_vmap_area_noflush(va); +} + +/* =A0 * Free and unmap a vmap area =A0 */ static void free_unmap_vmap_area(struct vmap_area *va) @@ -798,7 +803,7 @@ static void free_vmap_block(struct vmap_block *vb) =A0=A0=A0 spin_unlock(&vmap_block_tree_lock); =A0=A0=A0 BUG_ON(tmp !=3D vb); =20 -=A0=A0=A0 free_unmap_vmap_area_noflush(vb->va); +=A0=A0=A0 free_vmap_area_noflush(vb->va); =A0=A0=A0 call_rcu(&vb->rcu_head, rcu_free_vb); } =20 @@ -936,6 +941,8 @@ static void vb_free(const void *addr, unsigned long siz= e) =A0=A0=A0 rcu_read_unlock(); =A0=A0=A0 BUG_ON(!vb); =20 +=A0=A0=A0 vunmap_page_range((unsigned long)addr, (unsigned long)addr + siz= e); + =A0=A0=A0 spin_lock(&vb->lock); =A0=A0=A0 BUG_ON(bitmap_allocate_region(vb->dirty_map, offset >> PAGE_SHIF= T, order)); =20 @@ -988,7 +995,6 @@ void vm_unmap_aliases(void) =20 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 s =3D vb->va->va_start + (i << PAG= E_SHIFT); =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 e =3D vb->va->va_start + (j << PAG= E_SHIFT); -=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 vunmap_page_range(s, e); =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 flush =3D 1; =20 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 if (s < start) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel =0A=0A=0A --0-1440248469-1291278780=:35375 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Could you , please, resend the patch as raw a= ttachment.

Boris.

--- On Thu, 12/2/10, Jeremy Fitzhardinge= <jeremy@goop.org> wrote:

= From: Jeremy Fitzhardinge <jeremy@goop.org>
Subject: Re: [Xen-deve= l] Re: 2.6.37-rc1 mainline domU - BUG: unable to handle kernel paging reque= st
To: "Bruce Edge" <bruce.edge@gmail.com>
Cc: "Boris Derzhavet= s" <bderzhavets@yahoo.com>, xen-devel@lists.xensource.com, "Konrad Rz= eszutek Wilk" <konrad.wilk@oracle.com>
Date: Thursday, December 2,= 2010, 1:33 AM

On 12/01/2010 01:32 PM, Bruc= e Edge wrote:
> I just checked the recently released 2.6.73-rc4,
<= br>Do you mean mainline 2.6.37-rc4, or the one in xen/next-2.6.37?

>  and while the BUG
> signature is = different, it still fails under NFS accesses. This is
> 100% recreata= ble.

Please try this patch which is queued up for mainline.  It= 's already in
xen/next-2.6.37.

    J


diff --= git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 21ed8d7..0e4ecac 100= 644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2358,8 += 2358,6 @@ void __init xen_init_mmu_ops(void)
    x86_ini= t.paging.pagetable_setup_done =3D xen_pagetable_setup_done;
  = ;  pv_mmu_ops =3D xen_mmu_ops;

-    vmap_lazy_u= nmap =3D false;
-
    memset(dummy_mapping, 0xff, PAG= E_SIZE);
}

diff --git a/include/linux/vmalloc.h b/include/linux= /vmalloc.h
index a03dcf6..44b54f6 100644
--- a/include/linux/vmalloc.= h
+++ b/include/linux/vmalloc.h
@@ -7,8 +7,6 @@

struct vm_area_struct;        /* vma defining user = mapping in mm_types.h */

-extern bool vmap_lazy_unmap;
-
/* = bits in flags of vmalloc's vm_struct below */
#define VM_IOREMAP &= nbsp;  0x00000001    /* ioremap() and friends */
#d= efine VM_ALLOC    0x00000002    /* vmalloc() = */
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index a3d66b3..eb5cc7d 10= 0644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -31,8 +31,6 @@
#= include <asm/tlbflush.h>
#include <asm/shmparam.h>

= -bool vmap_lazy_unmap __read_mostly =3D true;
-
/*** Page table mani= pulation functions ***/

static void vunmap_pte_range(pmd_t *pmd, u= nsigned long addr, unsigned long end)
@@ -503,9 +501,6 @@ static unsigne= d long lazy_max_pages(void)
{
    unsigned int log;<= br>
-    if (!vmap_lazy_unmap)
-        return 0;
= -
    log =3D fls(num_online_cpus());

 &nb= sp;  return log * (32UL * 1024 * 1024 / PAGE_SIZE);
@@ -566,7 +561,= 6 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long= *end,
            if (va-= >va_end > *end)
          = ;      *end =3D va->va_end;
    &= nbsp;       nr +=3D (va->va_end - va->va_sta= rt) >> PAGE_SHIFT;
-         &n= bsp;  unmap_vmap_area(va);
        &= nbsp;   list_add_tail(&va->purge_list, &valist);
&= nbsp;           va->flags |=3D V= M_LAZY_FREEING;
           = ; va->flags &=3D ~VM_LAZY_FREE;
@@ -611,10 +605,11 @@ static void = purge_vmap_area_lazy(void)
}

/*
- * Free and unmap a vmap a= rea, caller ensuring flush_cache_vunmap had been
- * called for the corr= ect range previously.
+ * Free a vmap area, caller ensuring that the are= a has been unmapped
+ * and flush_cache_vunmap had been called for the c= orrect range
+ * previously.
  */
-static void free_unmap_vma= p_area_noflush(struct vmap_area *va)
+static void free_vmap_area_noflush= (struct vmap_area *va)
{
    va->flags |=3D VM_LA= ZY_FREE;
    atomic_add((va->va_end - va->va_start= ) >> PAGE_SHIFT, &vmap_lazy_nr);
@@ -623,6 +618,16 @@ static v= oid free_unmap_vmap_area_noflush(struct vmap_area *va)
}

/*+ * Free and unmap a vmap area, caller ensuring flush_cache_vunmap had bee= n
+ * called for the correct range previously.
+ */
+static void free_unmap_vmap_area_noflush(struct vmap_area *va)
+{
+ &n= bsp;  unmap_vmap_area(va);
+    free_vmap_area_noflu= sh(va);
+}
+
+/*
  * Free and unmap a vmap area
  = */
static void free_unmap_vmap_area(struct vmap_area *va)
@@ -798,7 = +803,7 @@ static void free_vmap_block(struct vmap_block *vb)
 &nbs= p;  spin_unlock(&vmap_block_tree_lock);
    BUG= _ON(tmp !=3D vb);

-    free_unmap_vmap_area_noflush(= vb->va);
+    free_vmap_area_noflush(vb->va);
&= nbsp;   call_rcu(&vb->rcu_head, rcu_free_vb);
}
@@ -936,6 +941,8 @@ static void vb_free(const void *addr, unsigned long s= ize)
    rcu_read_unlock();
    BUG_O= N(!vb);

+    vunmap_page_range((unsigned long)addr, = (unsigned long)addr + size);
+
    spin_lock(&vb->lock);
    BUG_ON(bitmap_allocate= _region(vb->dirty_map, offset >> PAGE_SHIFT, order));

@@ -= 988,7 +995,6 @@ void vm_unmap_aliases(void)

    &nb= sp;           s =3D vb->va->v= a_start + (i << PAGE_SHIFT);
       = ;         e =3D vb->va->va_start + (j &= lt;< PAGE_SHIFT);
-          =       vunmap_page_range(s, e);
    &= nbsp;           flush =3D 1;
              &nb= sp; if (s < start)



______________________________________= _________
Xen-devel mailing list
Xen-devel@lists.xe= nsource.com
http://lists.xensource.com/xen-devel
=

=0A=0A --0-1440248469-1291278780=:35375-- --===============1940429291== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1940429291==--