<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/aio.c, branch linux-2.6.25.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.25.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.25.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2008-05-01T21:44:37Z</updated>
<entry>
<title>aio: io_getevents() should return if io_destroy() is invoked</title>
<updated>2008-05-01T21:44:37Z</updated>
<author>
<name>Jeff Moyer</name>
</author>
<published>2008-04-28T17:15:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bcf2286df0f605a6e44212a494eafa95b8f6c64e'/>
<id>urn:sha1:bcf2286df0f605a6e44212a494eafa95b8f6c64e</id>
<content type='text'>
commit e92adcba261fd391591bb63c1703185a04a41554 upstream

This patch wakes up a thread waiting in io_getevents if another thread
destroys the context.  This was tested using a small program that spawns a
thread to wait in io_getevents while the parent thread destroys the io context
and then waits for the getevents thread to exit.  Without this patch, the
program hangs indefinitely.  With the patch, the program exits as expected.

Signed-off-by: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Cc: Zach Brown &lt;zach.brown@oracle.com&gt;
Cc: Christopher Smith &lt;x@xman.org&gt;
Cc: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>eventfd/kaio integration fix</title>
<updated>2008-04-11T15:06:43Z</updated>
<author>
<name>Davide Libenzi</name>
</author>
<published>2008-04-11T04:29:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8d1c98b0b5c0148b519c6416e689ef6a89ffcea3'/>
<id>urn:sha1:8d1c98b0b5c0148b519c6416e689ef6a89ffcea3</id>
<content type='text'>
Jeff Roberson discovered a race when using kaio eventfd based notifications.
When it occurs it can lead tomissed wakeups and hung userspace.

This patch fixes the race by moving the notification inside the spinlocked
section of kaio.  The operation is safe since eventfd spinlock and kaio one
are unrelated.

Signed-off-by: Davide Libenzi &lt;davidel@xmailserver.org&gt;
Cc: Zach Brown &lt;zach.brown@oracle.com&gt;
Cc: Jeff Roberson &lt;jroberson@chesapeake.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>asmlinkage_protect sys_io_getevents</title>
<updated>2008-04-11T00:28:26Z</updated>
<author>
<name>Roland McGrath</name>
</author>
<published>2008-04-10T22:38:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=598af051a79d05b751fe793f1fe09fcf74763e02'/>
<id>urn:sha1:598af051a79d05b751fe793f1fe09fcf74763e02</id>
<content type='text'>
Use asmlinkage_protect in sys_io_getevents, because GCC for i386 with
CONFIG_FRAME_POINTER=n can decide to clobber an argument word on the
stack, i.e. the user struct pt_regs.  Here the problem is not a tail
call, but just the compiler's use of the stack when it inlines and
optimizes the body of the called function.  This seems to avoid it.

Signed-off-by: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>aio: bad AIO race in aio_complete() leads to process hang</title>
<updated>2008-03-20T01:53:35Z</updated>
<author>
<name>Quentin Barnes</name>
</author>
<published>2008-03-20T00:00:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6cb2a21049b8990df4576c5fce4d48d0206c22d5'/>
<id>urn:sha1:6cb2a21049b8990df4576c5fce4d48d0206c22d5</id>
<content type='text'>
My group ran into a AIO process hang on a 2.6.24 kernel with the process
sleeping indefinitely in io_getevents(2) waiting for the last wakeup to come
and it never would.

We ran the tests on x86_64 SMP.  The hang only occurred on a Xeon box
("Clovertown") but not a Core2Duo ("Conroe").  On the Xeon, the L2 cache isn't
shared between all eight processors, but is L2 is shared between between all
two processors on the Core2Duo we use.

My analysis of the hang is if you go down to the second while-loop
in read_events(), what happens on processor #1:
	1) add_wait_queue_exclusive() adds thread to ctx-&gt;wait
	2) aio_read_evt() to check tail
	3) if aio_read_evt() returned 0, call [io_]schedule() and sleep

In aio_complete() with processor #2:
	A) info-&gt;tail = tail;
	B) waitqueue_active(&amp;ctx-&gt;wait)
	C) if waitqueue_active() returned non-0, call wake_up()

The way the code is written, step 1 must be seen by all other processors
before processor 1 checks for pending events in step 2 (that were recorded by
step A) and step A by processor 2 must be seen by all other processors
(checked in step 2) before step B is done.

The race I believed I was seeing is that steps 1 and 2 were
effectively swapped due to the __list_add() being delayed by the L2
cache not shared by some of the other processors.  Imagine:
proc 2: just before step A
proc 1, step 1: adds to ctx-&gt;wait, but is not visible by other processors yet
proc 1, step 2: checks tail and sees no pending events
proc 2, step A: updates tail
proc 1, step 3: calls [io_]schedule() and sleeps
proc 2, step B: checks ctx-&gt;wait, but sees no one waiting, skips wakeup
                so proc 1 sleeps indefinitely

My patch adds a memory barrier between steps A and B.  It ensures that the
update in step 1 gets seen on processor 2 before continuing.  If processor 1
was just before step 1, the memory barrier makes sure that step A (update
tail) gets seen by the time processor 1 makes it to step 2 (check tail).

Before the patch our AIO process would hang virtually 100% of the time.  After
the patch, we have yet to see the process ever hang.

Signed-off-by: Quentin Barnes &lt;qbarnes+linux@yahoo-inc.com&gt;
Reviewed-by: Zach Brown &lt;zach.brown@oracle.com&gt;
Cc: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Cc: &lt;stable@kernel.org&gt;
Cc: Nick Piggin &lt;nickpiggin@yahoo.com.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
[ We should probably disallow that "if (waitqueue_active()) wake_up()"
  coding pattern, because it's so often buggy wrt memory ordering ]
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>aio: negative offset should return -EINVAL</title>
<updated>2008-02-08T17:22:33Z</updated>
<author>
<name>Rusty Russell</name>
</author>
<published>2008-02-08T12:20:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c2ec66828fd253802abb912668f4bf9597e3c898'/>
<id>urn:sha1:c2ec66828fd253802abb912668f4bf9597e3c898</id>
<content type='text'>
An AIO read or write should return -EINVAL if the offset is negative.
This check matches the one in pread and pwrite.

This was found by the libaio test suite.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Acked-by: Zach Brown &lt;zach.brown@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>aio: partial write should not return error code</title>
<updated>2008-02-08T17:22:33Z</updated>
<author>
<name>Rusty Russell</name>
</author>
<published>2008-02-08T12:20:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7adfa2ff3efa02a7a9f2632d2d2662d3e5eb5304'/>
<id>urn:sha1:7adfa2ff3efa02a7a9f2632d2d2662d3e5eb5304</id>
<content type='text'>
When an AIO write gets an error after writing some data (eg.  ENOSPC), it
should return the amount written already, not the error.  Just like write()
is supposed to.

This was found by the libaio test suite.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Acked-By: Zach Brown &lt;zach.brown@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs: remove fastcall, it is always empty</title>
<updated>2008-02-08T17:22:31Z</updated>
<author>
<name>Harvey Harrison</name>
</author>
<published>2008-02-08T12:19:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fc9b52cd8f5f459b88adcf67c47668425ae31a78'/>
<id>urn:sha1:fc9b52cd8f5f459b88adcf67c47668425ae31a78</id>
<content type='text'>
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>core: remove last users of empty FASTCALL macro</title>
<updated>2008-01-30T12:31:17Z</updated>
<author>
<name>Harvey Harrison</name>
</author>
<published>2008-01-30T12:31:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56c4da454de1264e381256f658f61b9ef690dd21'/>
<id>urn:sha1:56c4da454de1264e381256f658f61b9ef690dd21</id>
<content type='text'>
FASTCALL is always empty after the x86 removal.

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>aio: only account I/O wait time in read_events if there are active requests</title>
<updated>2007-12-05T17:21:18Z</updated>
<author>
<name>Jeff Moyer</name>
</author>
<published>2007-12-05T07:45:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e00ba3dae077f54cfd2af42e939a618caa7a3bca'/>
<id>urn:sha1:e00ba3dae077f54cfd2af42e939a618caa7a3bca</id>
<content type='text'>
On 2.6.24, top started showing 100% iowait on one CPU when a UML instance was
running (but completely idle).  The UML code sits in io_getevents waiting for
an event to be submitted and completed.

Fix this by checking ctx-&gt;reqs_active before scheduling to determine whether
or not we are waiting for I/O.

Signed-off-by: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Cc: Zach Brown &lt;zach.brown@oracle.com&gt;
Cc: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Remove struct task_struct::io_wait</title>
<updated>2007-10-18T21:37:20Z</updated>
<author>
<name>Alexey Dobriyan</name>
</author>
<published>2007-10-18T10:04:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6212e3a388fdda3f19fa660ef5a30edf54d1dcfd'/>
<id>urn:sha1:6212e3a388fdda3f19fa660ef5a30edf54d1dcfd</id>
<content type='text'>
Hell knows what happened in commit 63b05203af57e7de4f3bb63b8b81d43bc196d32b
during 2.6.9 development.  Commit introduced io_wait field which remained
write-only than and still remains write-only.

Also garbage collect macros which "use" io_wait.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
