<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/kernel, branch v2.6.17-rc1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>https://git.kobert.dev/pm24.git/atom/kernel?h=v2.6.17-rc1</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom/kernel?h=v2.6.17-rc1'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2006-04-02T11:45:55Z</updated>
<entry>
<title>BUG_ON() Conversion in kernel/signal.c</title>
<updated>2006-04-02T11:45:55Z</updated>
<author>
<name>Eric Sesterhenn</name>
<email>snakebyte@gmx.de</email>
</author>
<published>2006-04-02T11:45:55Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=9f31252cb61d5bc641cdef8a069a2ca5a77855f2'/>
<id>urn:sha1:9f31252cb61d5bc641cdef8a069a2ca5a77855f2</id>
<content type='text'>
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.

Signed-off-by: Eric Sesterhenn &lt;snakebyte@gmx.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>BUG_ON() Conversion in kernel/signal.c</title>
<updated>2006-04-02T11:44:47Z</updated>
<author>
<name>Eric Sesterhenn</name>
<email>snakebyte@gmx.de</email>
</author>
<published>2006-04-02T11:44:47Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=fda8bd78a15950b9b01a1c1477a9095cb08c27c1'/>
<id>urn:sha1:fda8bd78a15950b9b01a1c1477a9095cb08c27c1</id>
<content type='text'>
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.

Signed-off-by: Eric Sesterhenn &lt;snakebyte@gmx.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>BUG_ON() Conversion in kernel/ptrace.c</title>
<updated>2006-04-02T11:43:40Z</updated>
<author>
<name>Eric Sesterhenn</name>
<email>snakebyte@gmx.de</email>
</author>
<published>2006-04-02T11:43:40Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=524223ca8142d593124bde66f3ffa1deb6f56c06'/>
<id>urn:sha1:524223ca8142d593124bde66f3ffa1deb6f56c06</id>
<content type='text'>
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.

Signed-off-by: Eric Sesterhenn &lt;snakebyte@gmx.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>Fix comments: s/granuality/granularity/</title>
<updated>2006-03-31T23:41:22Z</updated>
<author>
<name>Kalin KOZHUHAROV</name>
<email>kalin@thinrope.net</email>
</author>
<published>2006-03-31T23:41:22Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=8ba8e95ed14a2771bbcb43300feda094f298853e'/>
<id>urn:sha1:8ba8e95ed14a2771bbcb43300feda094f298853e</id>
<content type='text'>
I was grepping through the code and some `grep ganularity -R .` didn't
catch what I thought. Then looking closer I saw the term "granuality"
used in only four places (in comments) and granularity in many more
places describing the same idea. Some other facts:

dictionary.com does not know such a word
define:granuality on google is not found (and pages for granuality are
mostly related to patches to the kernel)
it has not been discussed as a term on LKML, AFAICS (=Can Search)

To be consistent, I think granularity should be used everywhere.

Signed-off-by: Kalin KOZHUHAROV &lt;kalin@thinrope.net&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>BUG_ON() Conversion in kernel/printk.c</title>
<updated>2006-03-31T23:21:17Z</updated>
<author>
<name>Eric Sesterhenn</name>
<email>snakebyte@gmx.de</email>
</author>
<published>2006-03-31T23:21:17Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=8abd8e298eb15e2c1b993df0634daf29e43e0aab'/>
<id>urn:sha1:8abd8e298eb15e2c1b993df0634daf29e43e0aab</id>
<content type='text'>
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.

Signed-off-by: Eric Sesterhenn &lt;snakebyte@gmx.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>help text: SOFTWARE_SUSPEND doesn't need ACPI</title>
<updated>2006-03-31T23:03:08Z</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@stusta.de</email>
</author>
<published>2006-03-31T23:03:08Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=3e6e952d1d17e5cd2e25a438662d906c44ffcfaa'/>
<id>urn:sha1:3e6e952d1d17e5cd2e25a438662d906c44ffcfaa</id>
<content type='text'>
The note that SOFTWARE_SUSPEND doesn't need APM is helpful, but nowadays
the information that it doesn't need ACPI, too, is even more helpful.

Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>[PATCH] wrong error path in dup_fd() leading to oopses in RCU</title>
<updated>2006-03-31T20:25:46Z</updated>
<author>
<name>Kirill Korotaev</name>
<email>dev@openvz.org</email>
</author>
<published>2006-03-31T13:58:46Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=428622986858aebddc32d022af65e88b9d2ea8bb'/>
<id>urn:sha1:428622986858aebddc32d022af65e88b9d2ea8bb</id>
<content type='text'>
Wrong error path in dup_fd() - it should return NULL on error,
not an address of already freed memory :/

Triggered by OpenVZ stress test suite.

What is interesting is that it was causing different oopses in RCU like
below:
Call Trace:
   [&lt;c013492c&gt;] rcu_do_batch+0x2c/0x80
   [&lt;c0134bdd&gt;] rcu_process_callbacks+0x3d/0x70
   [&lt;c0126cf3&gt;] tasklet_action+0x73/0xe0
   [&lt;c01269aa&gt;] __do_softirq+0x10a/0x130
   [&lt;c01058ff&gt;] do_softirq+0x4f/0x60
   =======================
   [&lt;c0113817&gt;] smp_apic_timer_interrupt+0x77/0x110
   [&lt;c0103b54&gt;] apic_timer_interrupt+0x1c/0x24
  Code:  Bad EIP value.
   &lt;0&gt;Kernel panic - not syncing: Fatal exception in interrupt

Signed-Off-By: Pavel Emelianov &lt;xemul@sw.ru&gt;
Signed-Off-By: Dmitry Mishin &lt;dim@openvz.org&gt;
Signed-Off-By: Kirill Korotaev &lt;dev@openvz.org&gt;
Signed-Off-By: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] pidhash: Refactor the pid hash table</title>
<updated>2006-03-31T20:19:00Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2006-03-31T10:31:42Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=92476d7fc0326a409ab1d3864a04093a6be9aca7'/>
<id>urn:sha1:92476d7fc0326a409ab1d3864a04093a6be9aca7</id>
<content type='text'>
Simplifies the code, reduces the need for 4 pid hash tables, and makes the
code more capable.

In the discussions I had with Oleg it was felt that to a large extent the
cleanup itself justified the work.  With struct pid being dynamically
allocated meant we could create the hash table entry when the pid was
allocated and free the hash table entry when the pid was freed.  Instead of
playing with the hash lists when ever a process would attach or detach to a
process.

For myself the fact that it gave what my previous task_ref patch gave for free
with simpler code was a big win.  The problem is that if you hold a reference
to struct task_struct you lock in 10K of low memory.  If you do that in a user
controllable way like /proc does, with an unprivileged but hostile user space
application with typical resource limits of 1000 fds and 100 processes I can
trigger the OOM killer by consuming all of low memory with task structs, on a
machine wight 1GB of low memory.

If I instead hold a reference to struct pid which holds a pointer to my
task_struct, I don't suffer from that problem because struct pid is 2 orders
of magnitude smaller.  In fact struct pid is small enough that most other
kernel data structures dwarf it, so simply limiting the number of referring
data structures is enough to prevent exhaustion of low memory.

This splits the current struct pid into two structures, struct pid and struct
pid_link, and reduces our number of hash tables from PIDTYPE_MAX to just one.
struct pid_link is the per process linkage into the hash tables and lives in
struct task_struct.  struct pid is given an indepedent lifetime, and holds
pointers to each of the pid types.

The independent life of struct pid simplifies attach_pid, and detach_pid,
because we are always manipulating the list of pids and not the hash table.
In addition in giving struct pid an indpendent life it makes the concept much
more powerful.

Kernel data structures can now embed a struct pid * instead of a pid_t and
not suffer from pid wrap around problems or from keeping unnecessarily
large amounts of memory allocated.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] task: RCU protect task-&gt;usage</title>
<updated>2006-03-31T20:18:59Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2006-03-31T10:31:37Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=8c7904a00b06d2ee51149794b619e07369fcf9d4'/>
<id>urn:sha1:8c7904a00b06d2ee51149794b619e07369fcf9d4</id>
<content type='text'>
A big problem with rcu protected data structures that are also reference
counted is that you must jump through several hoops to increase the reference
count.  I think someone finally implemented atomic_inc_not_zero(&amp;count) to
automate the common case.  Unfortunately this means you must special case the
rcu access case.

When data structures are only visible via rcu in a manner that is not
determined by the reference count on the object (i.e.  tasks are visible until
their zombies are reaped) there is a much simpler technique we can employ.
Simply delaying the decrement of the reference count until the rcu interval is
over.

What that means is that the proc code that looks up a task and later
wants to sleep can now do:

rcu_read_lock();
task = find_task_by_pid(some_pid);
if (task) {
	get_task_struct(task);
}
rcu_read_unlock();

The effect on the rest of the kernel is that put_task_struct becomes cheaper
and immediate, and in the case where the task has been reaped it frees the
task immediate instead of unnecessarily waiting an until the rcu interval is
over.

Cleanup of task_struct does not happen when its reference count drops to
zero, instead cleanup happens when release_task is called.  Tasks can only
be looked up via rcu before release_task is called.  All rcu protected
members of task_struct are freed by release_task.

Therefore we can move call_rcu from put_task_struct into release_task.  And
we can modify release_task to not immediately release the reference count
but instead have it call put_task_struct from the function it gives to
call_rcu.

The end result:

- get_task_struct is safe in an rcu context where we have just looked
  up the task.

- put_task_struct() simplifies into its old pre rcu self.

This reorganization also makes put_task_struct uncallable from modules as
it is not exported but it does not appear to be called from any modules so
this should not be an issue, and is trivially fixed.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] resurrect __put_task_struct</title>
<updated>2006-03-31T20:18:59Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2006-03-31T10:31:34Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=158d9ebd19280582da172626ad3edda1a626dace'/>
<id>urn:sha1:158d9ebd19280582da172626ad3edda1a626dace</id>
<content type='text'>
This just got nuked in mainline.  Bring it back because Eric's patches use it.

Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
