<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/lib/kernel_lock.c, branch linux-2.6.34.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-2.6.34.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-2.6.34.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2009-12-14T22:55:33Z</updated>
<entry>
<title>bkl: Fixup core_lock fallout</title>
<updated>2009-12-14T22:55:33Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-11-17T13:45:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=fa4062e7eae8f484c90b9cdd850b5df39ab0e5a0'/>
<id>urn:sha1:fa4062e7eae8f484c90b9cdd850b5df39ab0e5a0</id>
<content type='text'>
kernel_lock.c emits a warning because a raw spinlock function is used
with a spinlock. Convert BKL to raw_spinlock.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;

</content>
</entry>
<entry>
<title>locking: Further name space cleanups</title>
<updated>2009-12-14T22:55:33Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-12-03T19:55:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9828ea9d75c38fe3dce05d00566eed61c85732e6'/>
<id>urn:sha1:9828ea9d75c38fe3dce05d00566eed61c85732e6</id>
<content type='text'>
The name space hierarchy for the internal lock functions is now a bit
backwards. raw_spin* functions map to _spin* which use __spin*, while
we would like to have _raw_spin* and __raw_spin*.

_raw_spin* is already used by lock debugging, so rename those funtions
to do_raw_spin* to free up the _raw_spin* name space.

No functional change.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>[BKL] add 'might_sleep()' to the outermost lock taker</title>
<updated>2009-12-12T22:46:33Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-12-12T22:46:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f01eb3640308c005d31b29d0a8bc2b7acb4e3f75'/>
<id>urn:sha1:f01eb3640308c005d31b29d0a8bc2b7acb4e3f75</id>
<content type='text'>
As shown by the previous patch (6698e3472: "tty: Fix BKL taken under a
spinlock bug introduced in the BKL split") the BKL removal is prone to
some subtle issues, where removing the BKL in one place may in fact make
a previously nested BKL call the new outer call, and then prone to nasty
deadlocks with other spinlocks.

In general, we should never take the BKL while we're holding a spinlock,
so let's just add a "might_sleep()" to it (even though the BKL doesn't
technically sleep - at least not yet), and we'll get nice warnings the
next time this kind of problem happens during BKL removal.

Acked-and-Tested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tracing: Pushdown the bkl tracepoints calls</title>
<updated>2009-09-28T16:00:48Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-09-28T15:12:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=925936ebf35a95c290e010b784c962164e6728f3'/>
<id>urn:sha1:925936ebf35a95c290e010b784c962164e6728f3</id>
<content type='text'>
Currently we are calling the bkl tracepoint callbacks just before the
bkl lock/unlock operations, ie the tracepoint call is not inside a
lock_kernel() function but inside a lock_kernel() macro. Hence the
bkl trace event header must be included from smp_lock.h. This raises
some nasty circular header dependencies:

linux/smp_lock.h -&gt; trace/events/bkl.h -&gt; trace/define_trace.h
-&gt; trace/ftrace.h -&gt; linux/ftrace_event.h -&gt; linux/hardirq.h
-&gt; linux/smp_lock.h

This results in incomplete event declarations, spurious event
definitions and other kind of funny behaviours.

This is hardly fixable without ugly workarounds. So instead, we push
the file name, line number and function name as lock_kernel()
parameters, so that we only deal with the trace event header from
lib/kernel_lock.c

This adds two parameters to lock_kernel() and unlock_kernel() but
it should be fine wrt to performances because this pair dos not seem
to be called in fast paths.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
</content>
</entry>
<entry>
<title>tracing/bkl: Add bkl ftrace events</title>
<updated>2009-09-24T13:16:31Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-07-31T23:34:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=96a2c464de07d7c72988db851c029b204fc59108'/>
<id>urn:sha1:96a2c464de07d7c72988db851c029b204fc59108</id>
<content type='text'>
Add two events lock_kernel and unlock_kernel() to trace the bkl uses.
This opens the door for userspace tools to perform statistics about
the callsites that use it, dependencies with other locks (by pairing
the trace with lock events), use with recursivity and so on...

The {__reacquire,release}_kernel_lock() events are not traced because
these are called from schedule, thus the sched events are sufficient
to trace them.

Example of a trace:

hald-addon-stor-4152  [000]   165.875501: unlock_kernel: depth: 0, fs/block_dev.c:1358 __blkdev_put()
hald-addon-stor-4152  [000]   167.832974: lock_kernel: depth: 0, fs/block_dev.c:1167 __blkdev_get()

How to get the callsites that acquire it recursively:

cd /debug/tracing/events/bkl
echo "lock_depth &gt; 0" &gt; filter

firefox-4951  [001]   206.276967: unlock_kernel: depth: 1, fs/reiserfs/super.c:575 reiserfs_dirty_inode()

You can also filter by file and/or line.

v2: Use of FILTER_PTR_STRING attribute for files and lines fields to
    make them traceable.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
</content>
</entry>
<entry>
<title>sched: TIF_NEED_RESCHED -&gt; need_reshed() cleanup</title>
<updated>2009-03-06T11:48:55Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2009-03-06T11:40:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5ed0cec0ac5f1b3759bdbe4d9df32ee4ff8afb5a'/>
<id>urn:sha1:5ed0cec0ac5f1b3759bdbe4d9df32ee4ff8afb5a</id>
<content type='text'>
Impact: cleanup

Use test_tsk_need_resched(), set_tsk_need_resched(), need_resched()
instead of using TIF_NEED_RESCHED.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;49B10BA4.9070209@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>BKL: revert back to the old spinlock implementation</title>
<updated>2008-05-11T03:58:02Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2008-05-11T03:58:02Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8e3e076c5a78519a9f64cd384e8f18bc21882ce0'/>
<id>urn:sha1:8e3e076c5a78519a9f64cd384e8f18bc21882ce0</id>
<content type='text'>
The generic semaphore rewrite had a huge performance regression on AIM7
(and potentially other BKL-heavy benchmarks) because the generic
semaphores had been rewritten to be simple to understand and fair.  The
latter, in particular, turns a semaphore-based BKL implementation into a
mess of scheduling.

The attempt to fix the performance regression failed miserably (see the
previous commit 00b41ec2611dc98f87f30753ee00a53db648d662 'Revert
"semaphore: fix"'), and so for now the simple and sane approach is to
instead just go back to the old spinlock-based BKL implementation that
never had any issues like this.

This patch also has the advantage of being reported to fix the
regression completely according to Yanmin Zhang, unlike the semaphore
hack which still left a couple percentage point regression.

As a spinlock, the BKL obviously has the potential to be a latency
issue, but it's not really any different from any other spinlock in that
respect.  We do want to get rid of the BKL asap, but that has been the
plan for several years.

These days, the biggest users are in the tty layer (open/release in
particular) and Alan holds out some hope:

  "tty release is probably a few months away from getting cured - I'm
   afraid it will almost certainly be the very last user of the BKL in
   tty to get fixed as it depends on everything else being sanely locked."

so while we're not there yet, we do have a plan of action.

Tested-by: Yanmin Zhang &lt;yanmin_zhang@linux.intel.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Matthew Wilcox &lt;matthew@wil.cx&gt;
Cc: Alexander Viro &lt;viro@ftp.linux.org.uk&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Convert asm/semaphore.h users to linux/semaphore.h</title>
<updated>2008-04-19T02:22:54Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>matthew@wil.cx</email>
</author>
<published>2008-04-19T02:21:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6188e10d38b8d7244ee7776d5f1f88c837b4b93f'/>
<id>urn:sha1:6188e10d38b8d7244ee7776d5f1f88c837b4b93f</id>
<content type='text'>
Signed-off-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>Add semaphore.h to kernel_lock.c</title>
<updated>2008-04-17T14:42:27Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>matthew@wil.cx</email>
</author>
<published>2008-02-26T23:34:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e48b3deee475134585eed03e7afebe4bf9e0dba9'/>
<id>urn:sha1:e48b3deee475134585eed03e7afebe4bf9e0dba9</id>
<content type='text'>
kernel_lock.c uses DECLARE_MUTEX, up() and down() without explicitly
including asm/semaphore.h.  This is fragile and leaves it vulnerable
to breakage during header reorganisations.

Signed-off-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>sched: remove the !PREEMPT_BKL code</title>
<updated>2008-01-25T20:08:33Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-01-25T20:08:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6478d8800b75253b2a934ddcb734e13ade023ad0'/>
<id>urn:sha1:6478d8800b75253b2a934ddcb734e13ade023ad0</id>
<content type='text'>
remove the !PREEMPT_BKL code.

this removes 160 lines of legacy code.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
