linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug fix in AIO initialization
@ 2003-07-07 22:02 Chen, Kenneth W
  2003-07-08  9:53 ` Wim ten Have
  0 siblings, 1 reply; 5+ messages in thread
From: Chen, Kenneth W @ 2003-07-07 22:02 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: linux-aio

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

We hit this bug when we have the following scenario:

One process initializes an AIO context and then forks out many child
processes.  When those child processes exit, many BUG checks
(effectively kernel oops) were triggered from put_ioctx(ctx) in function
exit_aio().

The issue was that the AIO context was incorrectly copied upon forking
and mislead all child processes to think they have an IO context and
trying to free it where they really don't own.  The following patch fix
the issue.

- Ken

[-- Attachment #2: aio.init.patch --]
[-- Type: application/octet-stream, Size: 403 bytes --]

--- linux-2.5.74/kernel/fork.c	Mon Jul  7 14:35:07 2003
+++ linux-2.5.74.aio/kernel/fork.c	Mon Jul  7 14:35:07 2003
@@ -375,6 +375,7 @@
 	mm->core_waiters = 0;
 	mm->page_table_lock = SPIN_LOCK_UNLOCKED;
 	mm->ioctx_list_lock = RW_LOCK_UNLOCKED;
+	mm->ioctx_list = NULL;
 	mm->default_kioctx = (struct kioctx)INIT_KIOCTX(mm->default_kioctx, *mm);
 	mm->free_area_cache = TASK_UNMAPPED_BASE;
 

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

* Re: Bug fix in AIO initialization
  2003-07-07 22:02 Bug fix in AIO initialization Chen, Kenneth W
@ 2003-07-08  9:53 ` Wim ten Have
  2003-07-08 18:13   ` Suparna Bhattacharya
  0 siblings, 1 reply; 5+ messages in thread
From: Wim ten Have @ 2003-07-08  9:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-aio


   Is there a definition how long system calls take when i issue
   asynchronous read/write requests?  The purpose is to not block
   but occasionally i measure up to 100's of milliseconds before
   the request is accepted or returns that there are currently
   no resources making me try again.  Is this normal?

-- 
-- Wim ten Have. 		AUDIX: 245 2981
Phone: (+31) 346 582981, Fax: Euro (+31) 346 552884, Room (+31) 346 558415

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

* Re: Bug fix in AIO initialization
  2003-07-08 18:13   ` Suparna Bhattacharya
@ 2003-07-08 12:41     ` Wim ten Have
  2003-07-08 19:45       ` Suparna Bhattacharya
  0 siblings, 1 reply; 5+ messages in thread
From: Wim ten Have @ 2003-07-08 12:41 UTC (permalink / raw)
  To: suparna; +Cc: linux-kernel, linux-aio

On Tue, 8 Jul 2003 23:43:26 +0530
Suparna Bhattacharya <suparna@in.ibm.com> wrote:

> Is this with vanilla 2.5 kernels or recent -mm kernels ?

  vanilla 2.5 kernels

> Are you doing async O_DIRECT reads/writes or regular filesystem
> aio read/writes ?

  both.

-- 
-- Wim ten Have. 		AUDIX: 245 2981
Phone: (+31) 346 582981, Fax: Euro (+31) 346 552884, Room (+31) 346 558415

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

* Re: Bug fix in AIO initialization
  2003-07-08  9:53 ` Wim ten Have
@ 2003-07-08 18:13   ` Suparna Bhattacharya
  2003-07-08 12:41     ` Wim ten Have
  0 siblings, 1 reply; 5+ messages in thread
From: Suparna Bhattacharya @ 2003-07-08 18:13 UTC (permalink / raw)
  To: Wim ten Have; +Cc: linux-kernel, linux-aio

On Tue, Jul 08, 2003 at 11:53:45AM +0200, Wim ten Have wrote:
>    Is there a definition how long system calls take when i issue
>    asynchronous read/write requests?  The purpose is to not block
>    but occasionally i measure up to 100's of milliseconds before
>    the request is accepted or returns that there are currently
>    no resources making me try again.  Is this normal?

Is this with vanilla 2.5 kernels or recent -mm kernels ?

Are you doing async O_DIRECT reads/writes or regular filesystem
aio read/writes ?

Regards
Suparna

-- 
Suparna Bhattacharya (suparna@in.ibm.com)
Linux Technology Center
IBM Software Labs, India


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

* Re: Bug fix in AIO initialization
  2003-07-08 12:41     ` Wim ten Have
@ 2003-07-08 19:45       ` Suparna Bhattacharya
  0 siblings, 0 replies; 5+ messages in thread
From: Suparna Bhattacharya @ 2003-07-08 19:45 UTC (permalink / raw)
  To: Wim ten Have; +Cc: linux-kernel, linux-aio

On Tue, Jul 08, 2003 at 02:41:21PM +0200, Wim ten Have wrote:
> On Tue, 8 Jul 2003 23:43:26 +0530
> Suparna Bhattacharya <suparna@in.ibm.com> wrote:
> 
> > Is this with vanilla 2.5 kernels or recent -mm kernels ?
> 
>   vanilla 2.5 kernels
> 
> > Are you doing async O_DIRECT reads/writes or regular filesystem
> > aio read/writes ?
> 
>   both.

Regular filesystem aio reads/writes aren't async at the
moment in the vanilla 2.5 tree, so that would be expected, but
you say you are seeing this with O_DIRECT as well ... 

What kind of i/o sizes and loads are involved when you observe 
this with O_DIRECT AIO ? Which filesystem are you using ?

Regards
Suparna

-- 
Suparna Bhattacharya (suparna@in.ibm.com)
Linux Technology Center
IBM Software Labs, India


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

end of thread, other threads:[~2003-07-08 13:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-07 22:02 Bug fix in AIO initialization Chen, Kenneth W
2003-07-08  9:53 ` Wim ten Have
2003-07-08 18:13   ` Suparna Bhattacharya
2003-07-08 12:41     ` Wim ten Have
2003-07-08 19:45       ` Suparna Bhattacharya

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).