public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [1/2] use aio workqueue in fs/aio.c
@ 2004-06-01  5:51 William Lee Irwin III
  2004-06-01  5:54 ` [2/2] correct use_mm()/unuse_mm() to use task_lock() to protect ->mm William Lee Irwin III
  0 siblings, 1 reply; 2+ messages in thread
From: William Lee Irwin III @ 2004-06-01  5:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: suparna, linux-aio

Minor aio correction split off from suparna's patches:

Use the dedicated aio workqueue, not keventd, in order to isolate the
rest of the system from aio's demands.

Index: suparna-2.6.7-rc2/fs/aio.c
===================================================================
--- suparna-2.6.7-rc2.orig/fs/aio.c	2004-05-29 23:26:10.000000000 -0700
+++ suparna-2.6.7-rc2/fs/aio.c	2004-05-31 22:06:35.788770000 -0700
@@ -608,7 +608,7 @@
 		spin_lock_irqsave(&ctx->ctx_lock, flags);
 		list_add_tail(&iocb->ki_run_list, &ctx->run_list);
 		spin_unlock_irqrestore(&ctx->ctx_lock, flags);
-		schedule_work(&ctx->wq);
+		queue_work(aio_wq, &ctx->wq);
 	}
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [2/2] correct use_mm()/unuse_mm() to use task_lock() to protect ->mm
  2004-06-01  5:51 [1/2] use aio workqueue in fs/aio.c William Lee Irwin III
@ 2004-06-01  5:54 ` William Lee Irwin III
  0 siblings, 0 replies; 2+ messages in thread
From: William Lee Irwin III @ 2004-06-01  5:54 UTC (permalink / raw)
  To: linux-kernel, suparna, linux-aio

Split off from suparna's patches:

Correct use_mm()/unuse_mm() to use task_lock() to protect task->mm.

Index: suparna-2.6.7-rc2/fs/aio.c
===================================================================
--- suparna-2.6.7-rc2.orig/fs/aio.c	2004-05-31 22:06:35.788770000 -0700
+++ suparna-2.6.7-rc2/fs/aio.c	2004-05-31 22:08:41.057727000 -0700
@@ -538,19 +538,25 @@
 
 static void use_mm(struct mm_struct *mm)
 {
-	struct mm_struct *active_mm = current->active_mm;
+	struct mm_struct *active_mm;
+
 	atomic_inc(&mm->mm_count);
+	task_lock(current);
+	active_mm = current->active_mm;
 	current->mm = mm;
 	if (mm != active_mm) {
 		current->active_mm = mm;
 		activate_mm(active_mm, mm);
 	}
+	task_unlock(current);
 	mmdrop(active_mm);
 }
 
 static void unuse_mm(struct mm_struct *mm)
 {
+	task_lock(current);
 	current->mm = NULL;
+	task_unlock(current);
 	/* active_mm is still 'mm' */
 	enter_lazy_tlb(mm, current);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-01  5:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-01  5:51 [1/2] use aio workqueue in fs/aio.c William Lee Irwin III
2004-06-01  5:54 ` [2/2] correct use_mm()/unuse_mm() to use task_lock() to protect ->mm William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox