<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/kernel/async.c, branch linux-2.6.32.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.32.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.32.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-06-10T09:42:26Z</updated>
<entry>
<title>Fix a dead loop in async_synchronize_full()</title>
<updated>2013-06-10T09:42:26Z</updated>
<author>
<name>Li Zhong</name>
</author>
<published>2012-07-24T22:02:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=48bac8099a1b28e7d400d89c067e64ea5e196ef0'/>
<id>urn:sha1:48bac8099a1b28e7d400d89c067e64ea5e196ef0</id>
<content type='text'>
[Fixed upstream by commits 2955b47d2c1983998a8c5915cb96884e67f7cb53 and
a4683487f90bfe3049686fc5c566bdc1ad03ace6 from Dan Williams, but they are much
more intrusive than this tiny fix, according to Andrew - gregkh]

This patch tries to fix a dead loop in  async_synchronize_full(), which
could be seen when preemption is disabled on a single cpu machine.

void async_synchronize_full(void)
{
        do {
                async_synchronize_cookie(next_cookie);
        } while (!list_empty(&amp;async_running) || !
list_empty(&amp;async_pending));
}

async_synchronize_cookie() calls async_synchronize_cookie_domain() with
&amp;async_running as the default domain to synchronize.

However, there might be some works in the async_pending list from other
domains. On a single cpu system, without preemption, there is no chance
for the other works to finish, so async_synchronize_full() enters a dead
loop.

It seems async_synchronize_full() wants to synchronize all entries in
all running lists(domains), so maybe we could just check the entry_count
to know whether all works are finished.

Currently, async_synchronize_cookie_domain() expects a non-NULL running
list ( if NULL, there would be NULL pointer dereference ), so maybe a
NULL pointer could be used as an indication for the functions to
synchronize all works in all domains.

Reported-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: Li Zhong &lt;zhong@linux.vnet.ibm.com&gt;
Tested-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Tested-by: Christian Kujau &lt;lists@nerdbynature.de&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Dan Williams &lt;dan.j.williams@gmail.com&gt;
Cc: Christian Kujau &lt;lists@nerdbynature.de&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>async: Fix lack of boot-time console due to insufficient synchronization</title>
<updated>2009-06-08T19:31:53Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2009-06-08T19:31:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3af968e066d593bc4dacc021715f3e95ddf0996f'/>
<id>urn:sha1:3af968e066d593bc4dacc021715f3e95ddf0996f</id>
<content type='text'>
Our async work synchronization was broken by "async: make sure
independent async domains can't accidentally entangle" (commit
d5a877e8dd409d8c702986d06485c374b705d340), because it would report
the wrong lowest active async ID when there was both running and
pending async work.

This caused things like no being able to read the root filesystem,
resulting in missing console devices and inability to run 'init',
causing a boot-time panic.

This fixes it by properly returning the lowest pending async ID: if
there is any running async work, that will have a lower ID than any
pending work, and we should _not_ look at the pending work list.

There were alternative patches from Jaswinder and James, but this one
also cleans up the code by removing the pointless 'ret' variable and
the unnecesary testing for an empty list around 'for_each_entry()' (if
the list is empty, the for_each_entry() thing just won't execute).

Fixes-bug: http://bugzilla.kernel.org/show_bug.cgi?id=13474
Reported-and-tested-by: Chris Clayton &lt;chris2553@googlemail.com&gt;
Cc: Jaswinder Singh Rajput &lt;jaswinder@kernel.org&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>async: make sure independent async domains can't accidentally entangle</title>
<updated>2009-05-24T20:38:41Z</updated>
<author>
<name>James Bottomley</name>
</author>
<published>2009-05-24T20:03:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d5a877e8dd409d8c702986d06485c374b705d340'/>
<id>urn:sha1:d5a877e8dd409d8c702986d06485c374b705d340</id>
<content type='text'>
The problem occurs when async_synchronize_full_domain() is called when
the async_pending list is not empty.  This will cause lowest_running()
to return the cookie of the first entry on the async_pending list, which
might be nothing at all to do with the domain being asked for and thus
cause the domain synchronization to wait for an unrelated domain.   This
can cause a deadlock if domain synchronization is used from one domain
to wait for another.

Fix by running over the async_pending list to see if any pending items
actually belong to our domain (and return their cookies if they do).

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>async: remove the temporary (2.6.29) "async is off by default" code</title>
<updated>2009-03-28T20:05:30Z</updated>
<author>
<name>Arjan van de Ven</name>
</author>
<published>2009-03-15T18:11:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9710794383ee5008d67f1a6613a4717bf6de47bc'/>
<id>urn:sha1:9710794383ee5008d67f1a6613a4717bf6de47bc</id>
<content type='text'>
Now that everyone has been able to test the async code (and it's being used
in the Moblin betas by default), we can enable it by default.
The various fixes needed have gone into 2.6.29 already.

[With an important bugfix from Stefan Richter]

Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>async: use list_move_tail</title>
<updated>2009-02-08T18:00:26Z</updated>
<author>
<name>Stefan Richter</name>
</author>
<published>2009-02-02T12:24:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f7de7621f07495ad14fb23a812003bcf8f6af65a'/>
<id>urn:sha1:f7de7621f07495ad14fb23a812003bcf8f6af65a</id>
<content type='text'>
list.h provides a dedicated primitive for
"list_del followed by list_add_tail"... list_move_tail.

Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>async: Rename _special -&gt; _domain for clarity.</title>
<updated>2009-02-08T17:56:11Z</updated>
<author>
<name>Cornelia Huck</name>
</author>
<published>2009-01-20T14:31:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=766ccb9ed406c230d13c145def08ebea1b932982'/>
<id>urn:sha1:766ccb9ed406c230d13c145def08ebea1b932982</id>
<content type='text'>
Rename the async_*_special() functions to async_*_domain(), which
describes the purpose of these functions much better.
[Broke up long lines to silence checkpatch]

Signed-off-by: Cornelia Huck &lt;cornelia.huck@de.ibm.com&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>async: Add some documentation.</title>
<updated>2009-02-08T17:56:11Z</updated>
<author>
<name>Cornelia Huck</name>
</author>
<published>2009-01-19T12:45:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f30d5b307c694e03368ab55f2f96b0ca4131e775'/>
<id>urn:sha1:f30d5b307c694e03368ab55f2f96b0ca4131e775</id>
<content type='text'>
Add some kerneldoc to the async interface.

Signed-off-by: Cornelia Huck &lt;cornelia.huck@de.ibm.com&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>async: Handle kthread_run() return codes.</title>
<updated>2009-02-08T17:56:10Z</updated>
<author>
<name>Cornelia Huck</name>
</author>
<published>2009-01-19T12:45:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=86532d8b167e71e24da8b564348b52977b76d15f'/>
<id>urn:sha1:86532d8b167e71e24da8b564348b52977b76d15f</id>
<content type='text'>
If we fail to create the manager thread, fall back to non-fastboot.
If we fail to create an async thread, try again after waiting for
a bit.

Signed-off-by: Cornelia Huck &lt;cornelia.huck@de.ibm.com&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>async: Fix running list handling.</title>
<updated>2009-02-08T17:56:10Z</updated>
<author>
<name>Cornelia Huck</name>
</author>
<published>2009-01-19T12:45:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a89bbc74937cd74a6bcf109cfc7c032109639be'/>
<id>urn:sha1:7a89bbc74937cd74a6bcf109cfc7c032109639be</id>
<content type='text'>
async_schedule() should pass in async_running as the running
list, and run_one_entry() should put the entry to be run on
the provided running list instead of always on the generic one.

Reported-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
Signed-off-by: Cornelia Huck &lt;cornelia.huck@de.ibm.com&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>kernel/async.c: fix printk warnings</title>
<updated>2009-02-05T20:56:46Z</updated>
<author>
<name>Andrew Morton</name>
</author>
<published>2009-02-04T23:11:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=58763a297405024d23d8f1d0bba3e6603660c4b6'/>
<id>urn:sha1:58763a297405024d23d8f1d0bba3e6603660c4b6</id>
<content type='text'>
alpha:

kernel/async.c: In function 'run_one_entry':
kernel/async.c:141: warning: format '%lli' expects type 'long long int', but argument 2 has type 'async_cookie_t'
kernel/async.c:149: warning: format '%lli' expects type 'long long int', but argument 2 has type 'async_cookie_t'
kernel/async.c:149: warning: format '%lld' expects type 'long long int', but argument 4 has type 's64'
kernel/async.c: In function 'async_synchronize_cookie_special':
kernel/async.c:250: warning: format '%lli' expects type 'long long int', but argument 3 has type 's64'

Cc: Arjan van de Ven &lt;arjan@infradead.org&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>
