* [PATCH v2 2/2] m2p_find_override: use list_for_each_entry_safe
@ 2012-03-29 14:04 Stefano Stabellini
0 siblings, 0 replies; only message in thread
From: Stefano Stabellini @ 2012-03-29 14:04 UTC (permalink / raw)
To: konrad.wilk
Cc: Stefano.Stabellini, xen-devel, linux-kernel, Stefano Stabellini
Use list_for_each_entry_safe and remove the spin_lock acquisition in
m2p_find_override: getting stale entries is OK because we should never
get an m2p_find_override call looking for an entry that we are about to
add or delete.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
arch/x86/xen/p2m.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 1b267e7..a4d35d4 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -807,23 +807,18 @@ EXPORT_SYMBOL_GPL(m2p_remove_override);
struct page *m2p_find_override(unsigned long mfn)
{
- unsigned long flags;
struct list_head *bucket = &m2p_overrides[mfn_hash(mfn)];
- struct page *p, *ret;
+ struct page *p, *t, *ret;
ret = NULL;
- spin_lock_irqsave(&m2p_override_lock, flags);
-
- list_for_each_entry(p, bucket, lru) {
+ list_for_each_entry_safe(p, t, bucket, lru) {
if (page_private(p) == mfn) {
ret = p;
break;
}
}
- spin_unlock_irqrestore(&m2p_override_lock, flags);
-
return ret;
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-03-29 14:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-29 14:04 [PATCH v2 2/2] m2p_find_override: use list_for_each_entry_safe Stefano Stabellini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).