From: David Vrabel <david.vrabel@citrix.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"namhyung@gmail.com" <namhyung@gmail.com>,
"rientjes@google.com" <rientjes@google.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
"paulmck@linux.vnet.ibm.com" <paulmck@linux.vnet.ibm.com>
Subject: Re: [Revert] Re: [PATCH] mm: sync vmalloc address space page tables in alloc_vm_area()
Date: Fri, 2 Sep 2011 12:39:19 +0100 [thread overview]
Message-ID: <4E60C067.4010600@citrix.com> (raw)
In-Reply-To: <20110901141754.76cef93b.akpm@linux-foundation.org>
On 01/09/11 22:17, Andrew Morton wrote:
> On Thu, 01 Sep 2011 13:37:46 -0700
> Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
>> On 09/01/2011 09:11 AM, Konrad Rzeszutek Wilk wrote:
>>> On Thu, Sep 01, 2011 at 12:51:03PM +0100, David Vrabel wrote:
>>>> From: David Vrabel <david.vrabel@citrix.com>
>>> Andrew,
>>>
>>> I was wondering if you would be Ok with this patch for 3.1.
>>>
>>> It is a revert (I can prepare a proper revert if you would like
>>> that instead of this patch).
>
> David's patch looks better than a straight reversion.
>
> Problem is, I can't find David's original email anywhere. Someone's
> been playing games with To: headers?
Sorry, I should have Cc'd linux-kernel and others on the original patch.
>From 6844ca07140e08f29454ca7b3fa459571c7ba428 Mon Sep 17 00:00:00 2001
From: David Vrabel <david.vrabel@citrix.com>
Date: Thu, 1 Sep 2011 11:42:50 +0100
Subject: [PATCH] mm: sync vmalloc address space page tables in
alloc_vm_area()
Xen backend drivers (e.g., blkback and netback) would sometimes fail
to map grant pages into the vmalloc address space allocated with
alloc_vm_area(). The GNTTABOP_map_grant_ref would fail because Xen
could not find the page (in the L2 table) containing the PTEs it
needed to update.
(XEN) mm.c:3846:d0 Could not find L1 PTE for address fbb42000
netback and blkback were making the hypercall from a kernel thread
where task->active_mm != &init_mm and alloc_vm_area() was only
updating the page tables for init_mm. The usual method of deferring
the update to the page tables of other processes (i.e., after taking a
fault) doesn't work as a fault cannot occur during the hypercall.
This would work on some systems depending on what else was using
vmalloc.
Fix this by reverting ef691947d8a3d479e67652312783aedcf629320a
(vmalloc: remove vmalloc_sync_all() from alloc_vm_area()) and add a
comment to explain why it's needed.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
mm/vmalloc.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 7ef0903..5016f19 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2140,6 +2140,14 @@ struct vm_struct *alloc_vm_area(size_t size)
return NULL;
}
+ /*
+ * If the allocated address space is passed to a hypercall
+ * before being used then we cannot rely on a page fault to
+ * trigger an update of the page tables. So sync all the page
+ * tables here.
+ */
+ vmalloc_sync_all();
+
return area;
}
EXPORT_SYMBOL_GPL(alloc_vm_area);
--
1.7.2.5
WARNING: multiple messages have this Message-ID (diff)
From: David Vrabel <david.vrabel@citrix.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"namhyung@gmail.com" <namhyung@gmail.com>,
"rientjes@google.com" <rientjes@google.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
"paulmck@linux.vnet.ibm.com" <paulmck@linux.vnet.ibm.com>
Subject: Re: [Revert] Re: [PATCH] mm: sync vmalloc address space page tables in alloc_vm_area()
Date: Fri, 2 Sep 2011 12:39:19 +0100 [thread overview]
Message-ID: <4E60C067.4010600@citrix.com> (raw)
In-Reply-To: <20110901141754.76cef93b.akpm@linux-foundation.org>
On 01/09/11 22:17, Andrew Morton wrote:
> On Thu, 01 Sep 2011 13:37:46 -0700
> Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
>> On 09/01/2011 09:11 AM, Konrad Rzeszutek Wilk wrote:
>>> On Thu, Sep 01, 2011 at 12:51:03PM +0100, David Vrabel wrote:
>>>> From: David Vrabel <david.vrabel@citrix.com>
>>> Andrew,
>>>
>>> I was wondering if you would be Ok with this patch for 3.1.
>>>
>>> It is a revert (I can prepare a proper revert if you would like
>>> that instead of this patch).
>
> David's patch looks better than a straight reversion.
>
> Problem is, I can't find David's original email anywhere. Someone's
> been playing games with To: headers?
Sorry, I should have Cc'd linux-kernel and others on the original patch.
WARNING: multiple messages have this Message-ID (diff)
From: David Vrabel <david.vrabel@citrix.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"namhyung@gmail.com" <namhyung@gmail.com>,
"rientjes@google.com" <rientjes@google.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
"paulmck@linux.vnet.ibm.com" <paulmck@linux.vnet.ibm.com>
Subject: Re: [Revert] Re: [PATCH] mm: sync vmalloc address space page tables in alloc_vm_area()
Date: Fri, 2 Sep 2011 12:39:19 +0100 [thread overview]
Message-ID: <4E60C067.4010600@citrix.com> (raw)
In-Reply-To: <20110901141754.76cef93b.akpm@linux-foundation.org>
On 01/09/11 22:17, Andrew Morton wrote:
> On Thu, 01 Sep 2011 13:37:46 -0700
> Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
>> On 09/01/2011 09:11 AM, Konrad Rzeszutek Wilk wrote:
>>> On Thu, Sep 01, 2011 at 12:51:03PM +0100, David Vrabel wrote:
>>>> From: David Vrabel <david.vrabel@citrix.com>
>>> Andrew,
>>>
>>> I was wondering if you would be Ok with this patch for 3.1.
>>>
>>> It is a revert (I can prepare a proper revert if you would like
>>> that instead of this patch).
>
> David's patch looks better than a straight reversion.
>
> Problem is, I can't find David's original email anywhere. Someone's
> been playing games with To: headers?
Sorry, I should have Cc'd linux-kernel and others on the original patch.
>From 6844ca07140e08f29454ca7b3fa459571c7ba428 Mon Sep 17 00:00:00 2001
From: David Vrabel <david.vrabel@citrix.com>
Date: Thu, 1 Sep 2011 11:42:50 +0100
Subject: [PATCH] mm: sync vmalloc address space page tables in
alloc_vm_area()
Xen backend drivers (e.g., blkback and netback) would sometimes fail
to map grant pages into the vmalloc address space allocated with
alloc_vm_area(). The GNTTABOP_map_grant_ref would fail because Xen
could not find the page (in the L2 table) containing the PTEs it
needed to update.
(XEN) mm.c:3846:d0 Could not find L1 PTE for address fbb42000
netback and blkback were making the hypercall from a kernel thread
where task->active_mm != &init_mm and alloc_vm_area() was only
updating the page tables for init_mm. The usual method of deferring
the update to the page tables of other processes (i.e., after taking a
fault) doesn't work as a fault cannot occur during the hypercall.
This would work on some systems depending on what else was using
vmalloc.
Fix this by reverting ef691947d8a3d479e67652312783aedcf629320a
(vmalloc: remove vmalloc_sync_all() from alloc_vm_area()) and add a
comment to explain why it's needed.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
mm/vmalloc.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 7ef0903..5016f19 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2140,6 +2140,14 @@ struct vm_struct *alloc_vm_area(size_t size)
return NULL;
}
+ /*
+ * If the allocated address space is passed to a hypercall
+ * before being used then we cannot rely on a page fault to
+ * trigger an update of the page tables. So sync all the page
+ * tables here.
+ */
+ vmalloc_sync_all();
+
return area;
}
EXPORT_SYMBOL_GPL(alloc_vm_area);
--
1.7.2.5
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-09-02 11:36 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 11:51 [PATCH] mm: sync vmalloc address space page tables in alloc_vm_area() David Vrabel
2011-09-01 16:11 ` [Revert] " Konrad Rzeszutek Wilk
2011-09-01 16:11 ` Konrad Rzeszutek Wilk
2011-09-01 20:37 ` Jeremy Fitzhardinge
2011-09-01 20:37 ` Jeremy Fitzhardinge
2011-09-01 21:17 ` Andrew Morton
2011-09-01 21:17 ` Andrew Morton
2011-09-02 11:39 ` David Vrabel [this message]
2011-09-02 11:39 ` David Vrabel
2011-09-02 11:39 ` David Vrabel
2011-09-02 22:32 ` Andrew Morton
2011-09-02 22:32 ` Andrew Morton
2011-09-02 23:04 ` Jeremy Fitzhardinge
2011-09-02 23:04 ` Jeremy Fitzhardinge
2011-09-06 16:35 ` [Xen-devel] " Konrad Rzeszutek Wilk
2011-09-06 16:35 ` Konrad Rzeszutek Wilk
2011-11-05 13:38 ` Konrad Rzeszutek Wilk
2011-11-05 13:38 ` Konrad Rzeszutek Wilk
2011-11-05 13:38 ` Konrad Rzeszutek Wilk
2011-11-07 20:36 ` Konrad Rzeszutek Wilk
2011-11-07 20:36 ` Konrad Rzeszutek Wilk
2011-11-08 23:01 ` Andrew Morton
2011-11-08 23:01 ` Andrew Morton
2011-11-08 23:31 ` Konrad Rzeszutek Wilk
2011-11-08 23:31 ` Konrad Rzeszutek Wilk
2011-11-08 23:36 ` Andrew Morton
2011-11-08 23:36 ` Andrew Morton
2011-11-28 9:36 ` Jan Beulich
2011-11-28 10:19 ` Ian Campbell
2011-11-28 11:36 ` David Vrabel
2011-11-28 11:48 ` Ian Campbell
2011-11-28 15:20 ` Konrad Rzeszutek Wilk
2011-11-28 16:48 ` [PATCH 00/12] HVM backends and gnt/event fixups Daniel De Graaf
2011-11-28 16:49 ` [PATCH 01/12] xenbus: Support HVM backends Daniel De Graaf
2011-12-14 19:03 ` Konrad Rzeszutek Wilk
2011-12-14 19:53 ` Daniel De Graaf
2011-11-28 16:49 ` [PATCH 02/12] xenbus: Use grant-table wrapper functions Daniel De Graaf
2011-11-28 16:49 ` [PATCH 03/12] xen/grant-table: Support mappings required by blkback Daniel De Graaf
2011-11-28 16:49 ` [PATCH 04/12] xen/blkback: use grant-table.c hypercall wrappers Daniel De Graaf
2011-11-28 16:49 ` [PATCH 05/12] xen/netback: Enable netback on HVM guests Daniel De Graaf
2011-11-28 16:49 ` [PATCH 06/12] xen/blkback: Enable blkback " Daniel De Graaf
2011-11-28 16:49 ` [PATCH 07/12] xen/event: Add reference counting to event channels Daniel De Graaf
2011-12-14 18:56 ` Konrad Rzeszutek Wilk
2011-12-14 19:52 ` Daniel De Graaf
2011-12-16 19:35 ` Konrad Rzeszutek Wilk
2011-11-28 16:49 ` [PATCH 08/12] xen/gntalloc: Change gref_lock to a mutex Daniel De Graaf
2011-11-28 16:49 ` [PATCH 09/12] xen/gnt{dev, alloc}: reserve event channels for notify Daniel De Graaf
2011-11-28 16:49 ` [PATCH 10/12] xen/events: prevent calling evtchn_get on invalid channels Daniel De Graaf
2011-11-28 16:49 ` [PATCH 11/12] xen/gntalloc: release grant references on page free Daniel De Graaf
2011-11-28 16:49 ` [PATCH 12/12] xen/gntalloc: fix reference counts on multi-page mappings Daniel De Graaf
2011-09-02 7:22 ` [Xen-devel] Re: [Revert] Re: [PATCH] mm: sync vmalloc address space page tables in alloc_vm_area() Ian Campbell
2011-09-02 7:22 ` Ian Campbell
2011-09-02 7:31 ` Keir Fraser
2011-09-02 7:31 ` Keir Fraser
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=4E60C067.4010600@citrix.com \
--to=david.vrabel@citrix.com \
--cc=akpm@linux-foundation.org \
--cc=jeremy@goop.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=namhyung@gmail.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rientjes@google.com \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.