<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/fork.c, branch v2.6.17.12</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>[PATCH] move call of audit_free() into do_exit()</title>
<updated>2006-05-01T10:06:13+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2006-03-30T01:30:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fa84cb935d4ec601528f5e2f0d5d31e7876a5044'/>
<id>fa84cb935d4ec601528f5e2f0d5d31e7876a5044</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Don't inherit -&gt;splice_pipe across forks</title>
<updated>2006-04-20T11:05:33+00:00</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@suse.de</email>
</author>
<published>2006-04-20T11:05:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a0aa7f68afeeb92f6274b395177c20e617c8ed2d'/>
<id>a0aa7f68afeeb92f6274b395177c20e617c8ed2d</id>
<content type='text'>
It's really task private, so clear that field on fork after copying
task structure.

Signed-off-by: Jens Axboe &lt;axboe@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's really task private, so clear that field on fork after copying
task structure.

Signed-off-by: Jens Axboe &lt;axboe@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] task: Make task list manipulations RCU safe</title>
<updated>2006-04-19T16:13:49+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2006-04-19T05:20:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5e85d4abe3f43bb5362f384bab0e20ef082ce0b5'/>
<id>5e85d4abe3f43bb5362f384bab0e20ef082ce0b5</id>
<content type='text'>
While we can currently walk through thread groups, process groups, and
sessions with just the rcu_read_lock, this opens the door to walking the
entire task list.

We already have all of the other RCU guarantees so there is no cost in
doing this, this should be enough so that proc can stop taking the
tasklist lock during readdir.

prev_task was killed because it has no users, and using it will miss new
tasks when doing an rcu traversal.

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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While we can currently walk through thread groups, process groups, and
sessions with just the rcu_read_lock, this opens the door to walking the
entire task list.

We already have all of the other RCU guarantees so there is no cost in
doing this, this should be enough so that proc can stop taking the
tasklist lock during readdir.

prev_task was killed because it has no users, and using it will miss new
tasks when doing an rcu traversal.

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;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] kill unushed __put_task_struct_cb</title>
<updated>2006-04-15T00:43:57+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2006-04-14T18:43:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=64541d19702cfdb7ea946fdc20faee849f6874b1'/>
<id>64541d19702cfdb7ea946fdc20faee849f6874b1</id>
<content type='text'>
Somehow in the midst of dotting i's and crossing t's during
the merge up to rc1 we wound up keeping __put_task_struct_cb
when it should have been killed as it no longer has any users.
Sorry I probably should have caught this while it was
still in the -mm tree.

Having the old code there gets confusing when reading
through the code and trying to understand what is
happening.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Somehow in the midst of dotting i's and crossing t's during
the merge up to rc1 we wound up keeping __put_task_struct_cb
when it should have been killed as it no longer has any users.
Sorry I probably should have caught this while it was
still in the -mm tree.

Having the old code there gets confusing when reading
through the code and trying to understand what is
happening.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] wrong error path in dup_fd() leading to oopses in RCU</title>
<updated>2006-03-31T20:25:46+00:00</updated>
<author>
<name>Kirill Korotaev</name>
<email>dev@openvz.org</email>
</author>
<published>2006-03-31T13:58:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=428622986858aebddc32d022af65e88b9d2ea8bb'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] pidhash: Refactor the pid hash table</title>
<updated>2006-03-31T20:19:00+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2006-03-31T10:31:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=92476d7fc0326a409ab1d3864a04093a6be9aca7'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] resurrect __put_task_struct</title>
<updated>2006-03-31T20:18:59+00:00</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2006-03-31T10:31:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=158d9ebd19280582da172626ad3edda1a626dace'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] cleanup __exit_signal-&gt;cleanup_sighand path</title>
<updated>2006-03-29T02:36:44+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-03-29T00:11:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a7e5328a06a2beee3a2bbfaf87ce2a7bbe937de1'/>
<id>a7e5328a06a2beee3a2bbfaf87ce2a7bbe937de1</id>
<content type='text'>
Move 'tsk-&gt;sighand = NULL' from cleanup_sighand() to __exit_signal().  This
makes the exit path more understandable and allows us to do
cleanup_sighand() outside of -&gt;siglock protected section.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move 'tsk-&gt;sighand = NULL' from cleanup_sighand() to __exit_signal().  This
makes the exit path more understandable and allows us to do
cleanup_sighand() outside of -&gt;siglock protected section.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] make fork() atomic wrt pgrp/session signals</title>
<updated>2006-03-29T02:36:44+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-03-29T00:11:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4a2c7a7837da1b91468e50426066d988050e4d56'/>
<id>4a2c7a7837da1b91468e50426066d988050e4d56</id>
<content type='text'>
Eric W. Biederman wrote:
&gt;
&gt; Ok. SUSV3/Posix is clear, fork is atomic with respect
&gt; to signals.  Either a signal comes before or after a
&gt; fork but not during. (See the rationale section).
&gt; http://www.opengroup.org/onlinepubs/000095399/functions/fork.html
&gt;
&gt; The tasklist_lock does not stop forks from adding to a process
&gt; group. The forks stall while the tasklist_lock is held, but a fork
&gt; that began before we grabbed the tasklist_lock simply completes
&gt; afterwards, and the child does not receive the signal.

This also means that SIGSTOP or sig_kernel_coredump() signal can't
be delivered to pgrp/session reliably.

With this patch copy_process() returns -ERESTARTNOINTR when it
detects a pending signal, fork() will be restarted transparently
after handling the signals.

This patch also deletes now unneeded "group_stop_count &gt; 0" check,
copy_process() can no longer succeed while group stop in progress.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Acked-By: Eric 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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Eric W. Biederman wrote:
&gt;
&gt; Ok. SUSV3/Posix is clear, fork is atomic with respect
&gt; to signals.  Either a signal comes before or after a
&gt; fork but not during. (See the rationale section).
&gt; http://www.opengroup.org/onlinepubs/000095399/functions/fork.html
&gt;
&gt; The tasklist_lock does not stop forks from adding to a process
&gt; group. The forks stall while the tasklist_lock is held, but a fork
&gt; that began before we grabbed the tasklist_lock simply completes
&gt; afterwards, and the child does not receive the signal.

This also means that SIGSTOP or sig_kernel_coredump() signal can't
be delivered to pgrp/session reliably.

With this patch copy_process() returns -ERESTARTNOINTR when it
detects a pending signal, fork() will be restarted transparently
after handling the signals.

This patch also deletes now unneeded "group_stop_count &gt; 0" check,
copy_process() can no longer succeed while group stop in progress.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Acked-By: Eric 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;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] pids: kill PIDTYPE_TGID</title>
<updated>2006-03-29T02:36:44+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-03-29T00:11:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=47e65328a7b1cdfc4e3102e50d60faf94ebba7d3'/>
<id>47e65328a7b1cdfc4e3102e50d60faf94ebba7d3</id>
<content type='text'>
This patch kills PIDTYPE_TGID pid_type thus saving one hash table in
kernel/pid.c and speeding up subthreads create/destroy a bit.  It is also a
preparation for the further tref/pids rework.

This patch adds 'struct list_head thread_group' to 'struct task_struct'
instead.

We don't detach group leader from PIDTYPE_PID namespace until another
thread inherits it's -&gt;pid == -&gt;tgid, so we are safe wrt premature
free_pidmap(-&gt;tgid) call.

Currently there are no users of find_task_by_pid_type(PIDTYPE_TGID).
Should the need arise, we can use find_task_by_pid()-&gt;group_leader.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Acked-By: Eric 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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch kills PIDTYPE_TGID pid_type thus saving one hash table in
kernel/pid.c and speeding up subthreads create/destroy a bit.  It is also a
preparation for the further tref/pids rework.

This patch adds 'struct list_head thread_group' to 'struct task_struct'
instead.

We don't detach group leader from PIDTYPE_PID namespace until another
thread inherits it's -&gt;pid == -&gt;tgid, so we are safe wrt premature
free_pidmap(-&gt;tgid) call.

Currently there are no users of find_task_by_pid_type(PIDTYPE_TGID).
Should the need arise, we can use find_task_by_pid()-&gt;group_leader.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Acked-By: Eric 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;
</pre>
</div>
</content>
</entry>
</feed>
