xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: konrad.wilk@oracle.com
Cc: Stefano.Stabellini@eu.citrix.com, linux-kernel@vger.kernel.org,
	xen-devel@lists.xensource.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH 2/2] m2p_find_override: use list_for_each_entry_safe
Date: Tue, 27 Mar 2012 14:52:44 +0100	[thread overview]
Message-ID: <1332856364-29995-2-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <1332856364-29995-1-git-send-email-stefano.stabellini@eu.citrix.com>

Use list_for_each_entry_safe and remove the spin_lock acquisition in
m2p_find_override.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 arch/x86/xen/p2m.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 1b267e7..7ed8cc3 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -809,21 +809,17 @@ 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

  reply	other threads:[~2012-03-27 13:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 13:52 [PATCH 1/2] xen: enter/exit lazy_mmu_mode around m2p_override calls Stefano Stabellini
2012-03-27 13:52 ` Stefano Stabellini [this message]
2012-03-27 14:26   ` [PATCH 2/2] m2p_find_override: use list_for_each_entry_safe Konrad Rzeszutek Wilk
2012-03-27 16:37     ` Stefano Stabellini
2012-03-27 17:59       ` [Xen-devel] " Konrad Rzeszutek Wilk
2012-03-29 14:03         ` Stefano Stabellini
2012-03-27 14:31 ` [PATCH 1/2] xen: enter/exit lazy_mmu_mode around m2p_override calls Konrad Rzeszutek Wilk
2012-03-27 16:56   ` Stefano Stabellini

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=1332856364-29995-2-git-send-email-stefano.stabellini@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 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).