<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/pid.h, branch v2.6.16.45</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.16.45</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.16.45'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2004-09-03T02:25:58Z</updated>
<entry>
<title>[PATCH] Fix do_each_task_pid() loop with 'continue' inside</title>
<updated>2004-09-03T02:25:58Z</updated>
<author>
<name>Kirill Korotaev</name>
<email>dev@sw.ru</email>
</author>
<published>2004-09-03T02:25:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=16fb359f52d056dee08badbabe5aba93a8f7cbf2'/>
<id>urn:sha1:16fb359f52d056dee08badbabe5aba93a8f7cbf2</id>
<content type='text'>
Dmitry Torokhov triggered a problem in the new pidhash macros: These
do_each_task_pid()/while_each_task_pid() do loop forever if you use a
'continue' inside them. 

The end of the loop has to be inside the "while()" statement, so as to
not make "continue" jump over it.
</content>
</entry>
<entry>
<title>[PATCH] fixed pidhashing patch</title>
<updated>2004-09-02T07:42:48Z</updated>
<author>
<name>Kirill Korotaev</name>
<email>kksx@mail.ru</email>
</author>
<published>2004-09-02T07:42:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=37cbd41da09cb39c9896c04ed8baac7526bb9547'/>
<id>urn:sha1:37cbd41da09cb39c9896c04ed8baac7526bb9547</id>
<content type='text'>
This patch fixes strange and obscure pid implementation in current kernels:
- it removes calling of put_task_struct() from detach_pid()
  under tasklist_lock. This allows to use blocking calls
  in security_task_free() hooks (in __put_task_struct()).
- it saves some space = 5*5 ints = 100 bytes in task_struct
- it's smaller and tidy, more straigthforward and doesn't use
  any knowledge about pids using and assignment.
- it removes pid_links and pid_struct doesn't hold reference counters
  on task_struct. instead, new pid_structs and linked altogether and
  only one of them is inserted in hash_list.

Signed-off-by: Kirill Korotaev (kksx@mail.ru)
Signed-off-by: William Irwin &lt;wli@holomorphy.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] use hlist for pid hash: cache friendliness</title>
<updated>2004-08-31T03:36:14Z</updated>
<author>
<name>Nick Piggin</name>
<email>nickpiggin@yahoo.com.au</email>
</author>
<published>2004-08-31T03:36:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=33982f7f24f119eb2f2578c52234ec0a8ff1839b'/>
<id>urn:sha1:33982f7f24f119eb2f2578c52234ec0a8ff1839b</id>
<content type='text'>
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] use hlist for pid hash</title>
<updated>2004-08-31T03:36:01Z</updated>
<author>
<name>Nick Piggin</name>
<email>nickpiggin@yahoo.com.au</email>
</author>
<published>2004-08-31T03:36:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f59ad67e9647b385fd8738b3757ce9be2369bcbc'/>
<id>urn:sha1:f59ad67e9647b385fd8738b3757ce9be2369bcbc</id>
<content type='text'>
Use hlists for the PID hashes.  This halves the memory footprint of these
hashes.  No benchmarks, but I think this is a worthy improvement because
the hashes are something that would be likely to have significant portions
loaded into the cache of every CPU on some workloads.

This comes at the "expense" of
	1. reintroducing the memory  prefetch into the hash traversal loop;
	2. adding new pids to the head of the list instead of the tail. I
	   suspect that if this was a big problem then the hash isn't sized
	   well or could benefit from moving hot entries to the head.

Also, account for all the pid hashes when reporting hash memory usage.

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] pidhash cleanups, tgid-2.5.38-F3</title>
<updated>2002-09-23T04:46:05Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2002-09-23T04:46:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=817fdd72fae82f7b43b06ee7733c8ede31a4365b'/>
<id>urn:sha1:817fdd72fae82f7b43b06ee7733c8ede31a4365b</id>
<content type='text'>
This does the following things:

 - removes the -&gt;thread_group list and uses a new PIDTYPE_TGID pid class
   to handle thread groups. This cleans up lots of code in signal.c and
   elsewhere.

 - fixes sys_execve() if a non-leader thread calls it. (2.5.38 crashed in
   this case.)

 - renames list_for_each_noprefetch to __list_for_each.

 - cleans up delayed-leader parent notification.

 - introduces link_pid() to optimize PIDTYPE_TGID installation in the
   thread-group case.

I've tested the patch with a number of threaded and non-threaded
workloads, and it works just fine. Compiles &amp; boots on UP and SMP x86.

The session/pgrp bugs reported to lkml are probably still open, they are
the next on my todo - now that we have a clean pidhash architecture they
should be easier to fix.
</content>
</entry>
<entry>
<title>[PATCH] generic-pidhash-2.5.36-J2, BK-curr</title>
<updated>2002-09-19T07:25:45Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2002-09-19T07:25:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=64cf8edb62434d9efe3ae4ebdb4d73716ad27d9a'/>
<id>urn:sha1:64cf8edb62434d9efe3ae4ebdb4d73716ad27d9a</id>
<content type='text'>
This is the latest version of the generic pidhash patch.  The biggest
change is the removal of separately allocated pid structures: they are
now part of the task structure and the first task that uses a PID will
provide the pid structure.  Task refcounting is used to avoid the
freeing of the task structure before every member of a process group or
session has exited.

This approach has a number of advantages besides the performance gains.
Besides simplifying the whole hashing code significantly, attach_pid()
is now fundamentally atomic and can be called during create_process()
without worrying about task-list side-effects.  It does not have to
re-search the pidhash to find out about raced PID-adding either, and
attach_pid() cannot fail due to OOM.  detach_pid() can do a simple
put_task_struct() instead of the kmem_cache_free().

The only minimal downside is the potential pending task structures after
session leaders or group leaders have exited - but the number of orphan
sessions and process groups is usually very low - and even if it's
higher, this can be regarded as a slow execution of the final
deallocation of the session leader, not some additional burden.
</content>
</entry>
</feed>
