lkml.org 
[lkml]   [2012]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: Deadlocks due to per-process plugging
From
Date
Hm, wonder how bad this sucks.. and if I should go hide under a big
sturdy rock after I poke xmit :)

---
block/blk-core.c | 1 +
kernel/rtmutex.c | 11 +++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)

--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2782,6 +2782,7 @@ void blk_flush_plug_list(struct blk_plug
if (q)
queue_unplugged(q, depth, from_schedule);
}
+EXPORT_SYMBOL(blk_flush_plug_list);

void blk_finish_plug(struct blk_plug *plug)
{
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -20,6 +20,7 @@
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/timer.h>
+#include <linux/blkdev.h>

#include "rtmutex_common.h"

@@ -647,8 +648,11 @@ static inline void rt_spin_lock_fastlock

if (likely(rt_mutex_cmpxchg(lock, NULL, current)))
rt_mutex_deadlock_account_lock(lock, current);
- else
+ else {
+ if (blk_needs_flush_plug(current))
+ blk_schedule_flush_plug(current);
slowfn(lock);
+ }
}

static inline void rt_spin_lock_fastunlock(struct rt_mutex *lock,
@@ -1104,8 +1108,11 @@ rt_mutex_fastlock(struct rt_mutex *lock,
if (!detect_deadlock && likely(rt_mutex_cmpxchg(lock, NULL, current))) {
rt_mutex_deadlock_account_lock(lock, current);
return 0;
- } else
+ } else {
+ if (blk_needs_flush_plug(current))
+ blk_schedule_flush_plug(current);
return slowfn(lock, state, NULL, detect_deadlock);
+ }
}

static inline int



\
 
 \ /
  Last update: 2012-07-16 13:01    [W:0.180 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site