* [PATCH] exit_io_context: don't disable irqs
@ 2006-08-26 20:31 Oleg Nesterov
2006-08-29 7:14 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2006-08-26 20:31 UTC (permalink / raw)
To: Jens Axboe; +Cc: Andrew Morton, linux-kernel
We don't need to disable irqs to clear current->io_context, it is protected
by ->alloc_lock. Even IF it was possible to submit I/O from IRQ on behalf of
current this irq_disable() can't help: current_io_context() will re-instantiate
->io_context after irq_enable().
We don't need task_lock() or local_irq_disable() to clear ioc->task. This can't
prevent other CPUs from playing with our io_context anyway.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- 2.6.18-rc4/block/ll_rw_blk.c~6_exit 2006-08-27 00:10:53.000000000 +0400
+++ 2.6.18-rc4/block/ll_rw_blk.c 2006-08-27 00:11:47.000000000 +0400
@@ -3580,25 +3580,22 @@ EXPORT_SYMBOL(put_io_context);
/* Called by the exitting task */
void exit_io_context(void)
{
- unsigned long flags;
struct io_context *ioc;
struct cfq_io_context *cic;
- local_irq_save(flags);
task_lock(current);
ioc = current->io_context;
current->io_context = NULL;
- ioc->task = NULL;
task_unlock(current);
- local_irq_restore(flags);
+ ioc->task = NULL;
if (ioc->aic && ioc->aic->exit)
ioc->aic->exit(ioc->aic);
if (ioc->cic_root.rb_node != NULL) {
cic = rb_entry(rb_first(&ioc->cic_root), struct cfq_io_context, rb_node);
cic->exit(ioc);
}
-
+
put_io_context(ioc);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] exit_io_context: don't disable irqs
2006-08-26 20:31 [PATCH] exit_io_context: don't disable irqs Oleg Nesterov
@ 2006-08-29 7:14 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2006-08-29 7:14 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, linux-kernel
On Sun, Aug 27 2006, Oleg Nesterov wrote:
> We don't need to disable irqs to clear current->io_context, it is
> protected by ->alloc_lock. Even IF it was possible to submit I/O from
> IRQ on behalf of current this irq_disable() can't help:
> current_io_context() will re-instantiate ->io_context after
> irq_enable().
>
> We don't need task_lock() or local_irq_disable() to clear ioc->task.
> This can't prevent other CPUs from playing with our io_context anyway.
>
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-29 7:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-26 20:31 [PATCH] exit_io_context: don't disable irqs Oleg Nesterov
2006-08-29 7:14 ` Jens Axboe
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).