Re: [HACK] convert i_alloc_sem for direct_io.c craziness!

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Peter Zijlstra <a.p.zijlstra@...>
Cc: Steven Rostedt <rostedt@...>, LKML <linux-kernel@...>, linux-rt-users <linux-rt-users@...>, <mingo@...>, Thomas Gleixner <tglx@...>
Date: Tuesday, October 2, 2007 - 2:03 pm

On Oct 1, 2007, at 1:39 PM, Peter Zijlstra wrote:


I'm worried that the aio+dio implementation of concurrent pending IOs  
just doesn't map well to PI.

Would a hack with a mutex and counts help at all?  It seems like it  
would still have the same problem.  The count increments don't  
transfer ownership to the count decrements and the wake up.

io submission from tasks:
	down(&inode->i_mutex);
	atomic_inc(&inode->in_flight);
	up(&inode->i_mutex);

io completion from interrupts:
	if(atomic_dec_and_test(&inode->in_flight))
		wake_up(&inode->waiting);

file allocation in tasks:
	down(&inode->i_mutex);
	wait_event(inode->waiting, atomic_read(&inode->in_flight) == 0);
	up(&inode->i_mutex);

(yeah, yeah, starvation -- it's just a demonstration)

In any case, this seems like it's not a very high priority now that  
RT has Steven's work-around.  If it does become a priority can you  
guys let linux-fsdevel know?

- z
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[HACK] convert i_alloc_sem for direct_io.c craziness!, Steven Rostedt, (Mon Sep 24, 5:14 pm)
Re: [HACK] convert i_alloc_sem for direct_io.c craziness!, Peter Zijlstra, (Mon Oct 1, 4:39 pm)
Re: [HACK] convert i_alloc_sem for direct_io.c craziness!, Zach Brown, (Tue Oct 2, 2:03 pm)
Re: [HACK] convert i_alloc_sem for direct_io.c craziness!, Steven Rostedt, (Tue Oct 2, 2:12 pm)
Re: [HACK] convert i_alloc_sem for direct_io.c craziness!, Peter Zijlstra, (Tue Sep 25, 8:42 am)
[PATCH RT] Don't let -rt rw_semaphors do _non_owner locks, Steven Rostedt, (Tue Sep 25, 11:29 am)