<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/thread_info.h, branch v3.9</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.9</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2012-12-18T23:02:13Z</updated>
<entry>
<title>fork: protect architectures where THREAD_SIZE &gt;= PAGE_SIZE against fork bombs</title>
<updated>2012-12-18T23:02:13Z</updated>
<author>
<name>Glauber Costa</name>
<email>glommer@parallels.com</email>
</author>
<published>2012-12-18T22:22:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2ad306b17c0ac5a1b1f250d5f772aeb87fdf1eba'/>
<id>urn:sha1:2ad306b17c0ac5a1b1f250d5f772aeb87fdf1eba</id>
<content type='text'>
Because those architectures will draw their stacks directly from the page
allocator, rather than the slab cache, we can directly pass __GFP_KMEMCG
flag, and issue the corresponding free_pages.

This code path is taken when the architecture doesn't define
CONFIG_ARCH_THREAD_INFO_ALLOCATOR (only ia64 seems to), and has
THREAD_SIZE &gt;= PAGE_SIZE.  Luckily, most - if not all - of the remaining
architectures fall in this category.

This will guarantee that every stack page is accounted to the memcg the
process currently lives on, and will have the allocations to fail if they
go over limit.

For the time being, I am defining a new variant of THREADINFO_GFP, not to
mess with the other path.  Once the slab is also tracked by memcg, we can
get rid of that flag.

Tested to successfully protect against :(){ :|:&amp; };:

Signed-off-by: Glauber Costa &lt;glommer@parallels.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@redhat.com&gt;
Acked-by: Kamezawa Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Reviewed-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Greg Thelen &lt;gthelen@google.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: JoonSoo Kim &lt;js1304@gmail.com&gt;
Cc: Mel Gorman &lt;mel@csn.ul.ie&gt;
Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Suleiman Souhlal &lt;suleiman@google.com&gt;
Cc: Tejun Heo &lt;tj@kernel.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>
<entry>
<title>set_restore_sigmask() is never called without SIGPENDING (and never should be)</title>
<updated>2012-06-01T16:58:50Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-04-27T17:42:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=edd63a2763bdae0daa4f0a4d4c5d61d1154352a5'/>
<id>urn:sha1:edd63a2763bdae0daa4f0a4d4c5d61d1154352a5</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>new helpers: {clear,test,test_and_clear}_restore_sigmask()</title>
<updated>2012-06-01T16:58:47Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-04-27T02:29:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4ebefe3ec729003443daf153ed6fad1739271283'/>
<id>urn:sha1:4ebefe3ec729003443daf153ed6fad1739271283</id>
<content type='text'>
helpers parallel to set_restore_sigmask(), used in the next commits

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>HAVE_RESTORE_SIGMASK is defined on all architectures now</title>
<updated>2012-06-01T16:58:46Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-04-26T22:31:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=754421c8cab1a568be844a7069fe04c1cf6391b8'/>
<id>urn:sha1:754421c8cab1a568be844a7069fe04c1cf6391b8</id>
<content type='text'>
Everyone either defines it in arch thread_info.h or has TIF_RESTORE_SIGMASK
and picks default set_restore_sigmask() in linux/thread_info.h.  Kill the
ifdefs, slap #error in linux/thread_info.h to catch breakage when new ones
get merged.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fork: Move thread info gfp flags to header</title>
<updated>2012-05-08T11:55:20Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-05-05T15:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2889f60814e15dea644782597d897cdba943564f'/>
<id>urn:sha1:2889f60814e15dea644782597d897cdba943564f</id>
<content type='text'>
These flags can be useful for extra allocations outside of the core
code.

Add __GFP_NOTRACK to them, so the archs which have kmemcheck do
not have to provide extra allocators just for that reason.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/20120505150141.428211694@linutronix.de
</content>
</entry>
<entry>
<title>hrtimers: Avoid touching inactive timer bases</title>
<updated>2011-05-23T11:59:54Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-05-20T11:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ab8177bc53e8ae3a3ba6d200ce2c2dae263f7ee5'/>
<id>urn:sha1:ab8177bc53e8ae3a3ba6d200ce2c2dae263f7ee5</id>
<content type='text'>
Instead of iterating over all possible timer bases avoid it by marking
the active bases in the cpu base.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>thread_info: Remove legacy arg0-3 from restart_block</title>
<updated>2011-02-02T14:28:13Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-02-01T13:51:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d608c18203a969e5d14572a9861c646d0bb66872'/>
<id>urn:sha1:d608c18203a969e5d14572a9861c646d0bb66872</id>
<content type='text'>
posix timers were the last users of the legacy arg0-3 members of
restart_block. Remove the cruft.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Tested-by: Richard Cochran &lt;richard.cochran@omicron.at&gt;
LKML-Reference: &lt;20110201134418.326209775@linutronix.de&gt;
</content>
</entry>
<entry>
<title>futex: Mark restart_block.futex.uaddr[2] __user</title>
<updated>2010-09-18T10:19:21Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2010-09-14T12:43:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a3c74c52570c0c4ac90c9a0216de800c39089ba7'/>
<id>urn:sha1:a3c74c52570c0c4ac90c9a0216de800c39089ba7</id>
<content type='text'>
@uaddr and @uaddr2 fields in restart_block.futex are user
pointers. Add __user and remove unnecessary casts.

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Darren Hart &lt;dvhltc@us.ibm.com&gt;
LKML-Reference: &lt;1284468228-8723-2-git-send-email-namhyung@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>futex: add requeue_pi functionality</title>
<updated>2009-04-06T09:14:03Z</updated>
<author>
<name>Darren Hart</name>
<email>dvhltc@us.ibm.com</email>
</author>
<published>2009-04-03T20:40:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=52400ba946759af28442dee6265c5c0180ac7122'/>
<id>urn:sha1:52400ba946759af28442dee6265c5c0180ac7122</id>
<content type='text'>
PI Futexes and their underlying rt_mutex cannot be left ownerless if
there are pending waiters as this will break the PI boosting logic, so
the standard requeue commands aren't sufficient.  The new commands
properly manage pi futex ownership by ensuring a futex with waiters
has an owner at all times.  This will allow glibc to properly handle
pi mutexes with pthread_condvars.

The approach taken here is to create two new futex op codes:

FUTEX_WAIT_REQUEUE_PI:
Tasks will use this op code to wait on a futex (such as a non-pi waitqueue)
and wake after they have been requeued to a pi futex.  Prior to returning to
userspace, they will acquire this pi futex (and the underlying rt_mutex).

futex_wait_requeue_pi() is the result of a high speed collision between
futex_wait() and futex_lock_pi() (with the first part of futex_lock_pi() being
done by futex_proxy_trylock_atomic() on behalf of the top_waiter).

FUTEX_REQUEUE_PI (and FUTEX_CMP_REQUEUE_PI):
This call must be used to wake tasks waiting with FUTEX_WAIT_REQUEUE_PI,
regardless of how many tasks the caller intends to wake or requeue.
pthread_cond_broadcast() should call this with nr_wake=1 and
nr_requeue=INT_MAX.  pthread_cond_signal() should call this with nr_wake=1 and
nr_requeue=0.  The reason being we need both callers to get the benefit of the
futex_proxy_trylock_atomic() routine.  futex_requeue() also enqueues the
top_waiter on the rt_mutex via rt_mutex_start_proxy_lock().

Signed-off-by: Darren Hart &lt;dvhltc@us.ibm.com&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>select: add a poll specific struct to the restart_block union</title>
<updated>2008-09-06T04:35:01Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2008-08-31T15:19:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=be5dad20a55e054a35dac7f6f5f184dc72b379b4'/>
<id>urn:sha1:be5dad20a55e054a35dac7f6f5f184dc72b379b4</id>
<content type='text'>
with hrtimer poll/select, the signal restart data no longer is a single
long representing a jiffies count, but it becomes a second/nanosecond pair
that also needs to encode if there was a timeout at all or not.

This patch adds a struct to the restart_block union for this purpose

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
</content>
</entry>
</feed>
