public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Blunck <jblunck@suse.de>
To: rt-users <linux-rt-users@vger.kernel.org>
Cc: kvm@vger.kernel.org
Subject: [patch 1/3] Make rt_down_read_trylock() behave like down_read_trylock()
Date: Wed, 08 Apr 2009 01:58:54 +0200	[thread overview]
Message-ID: <20090407235902.196040156@suse.de> (raw)
In-Reply-To: 20090407235853.309888494@suse.de

[-- Attachment #1: patches.rt/rt_down_read_trylock-fix.diff --]
[-- Type: text/plain, Size: 962 bytes --]

This patch removes the stupid "Read locks within the self-held write lock
succeed" behaviour. This is breaking in mm_take_all_locks() since it is quite
common to ensure that a lock is taken with BUG_ON(down_read_trylock(&mm->mmap_sem)).

Signed-off-by: Jan Blunck <jblunck@suse.de>
---
 kernel/rt.c |   12 ------------
 1 file changed, 12 deletions(-)

Index: b/kernel/rt.c
===================================================================
--- a/kernel/rt.c
+++ b/kernel/rt.c
@@ -381,18 +381,6 @@ int  rt_down_read_trylock(struct rw_sema
 	unsigned long flags;
 	int ret;
 
-	/*
-	 * Read locks within the self-held write lock succeed.
-	 */
-	spin_lock_irqsave(&rwsem->lock.wait_lock, flags);
-	if (rt_mutex_real_owner(&rwsem->lock) == current) {
-		spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags);
-		rwsem_acquire_read(&rwsem->dep_map, 0, 1, _RET_IP_);
-		rwsem->read_depth++;
-		return 1;
-	}
-	spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags);

  reply	other threads:[~2009-04-07 23:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-07 23:58 [patch 0/3] Patches for KVM & RT Jan Blunck
2009-04-07 23:58 ` Jan Blunck [this message]
2009-04-09 13:47   ` [patch 1/3] Make rt_down_read_trylock() behave like down_read_trylock() Thomas Gleixner
2009-04-07 23:58 ` [patch 2/3] kvm: convert spin-locks to raw_spinlock_t Jan Blunck
2009-04-09  9:21   ` Marcelo Tosatti
2009-04-09 13:48   ` Thomas Gleixner
2009-04-07 23:58 ` [patch 3/3] kvm: wake up waitqueue before calling get_cpu() Jan Blunck
2009-04-09  9:24   ` Marcelo Tosatti
2009-04-09 13:48   ` Thomas Gleixner
2009-04-09 21:44 ` [patch 0/3] Patches for KVM & RT Carsten Emde
2009-04-10  7:23   ` Thomas Gleixner

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=20090407235902.196040156@suse.de \
    --to=jblunck@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    /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