Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106133
b: refs/heads/master
c: cffe1c5
h: refs/heads/master
i:
  106131: 73662fc
v: v3
  • Loading branch information
David S. Miller committed Jul 25, 2008
1 parent db8d871 commit 75502ec
Show file tree
Hide file tree
Showing 1,509 changed files with 40,638 additions and 50,137 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d25b36b77fe32c296ece83e94ca6ae4d17f3e25
refs/heads/master: cffe1c5d7a5a1e54f7c2c6d0510f651a965bccc3
8 changes: 0 additions & 8 deletions trunk/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,6 @@ S: 2322 37th Ave SW
S: Seattle, Washington 98126-2010
S: USA

N: Muli Ben-Yehuda
E: mulix@mulix.org
E: muli@il.ibm.com
W: http://www.mulix.org
D: trident OSS sound driver, x86-64 dma-ops and Calgary IOMMU,
D: KVM and Xen bits and other misc. hackery.
S: Haifa, Israel

N: Johannes Berg
E: johannes@sipsolutions.net
W: http://johannes.sipsolutions.net/
Expand Down
2 changes: 2 additions & 0 deletions trunk/Documentation/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ telephony/
- directory with info on telephony (e.g. voice over IP) support.
time_interpolators.txt
- info on time interpolators.
tipar.txt
- information about Parallel link cable for Texas Instruments handhelds.
tty.txt
- guide to the locking policies of the tty layer.
uml/
Expand Down
24 changes: 0 additions & 24 deletions trunk/Documentation/ABI/testing/sysfs-devices-memory

This file was deleted.

6 changes: 0 additions & 6 deletions trunk/Documentation/ABI/testing/sysfs-kernel-mm

This file was deleted.

15 changes: 0 additions & 15 deletions trunk/Documentation/ABI/testing/sysfs-kernel-mm-hugepages

This file was deleted.

42 changes: 19 additions & 23 deletions trunk/Documentation/CodingStyle
Original file line number Diff line number Diff line change
Expand Up @@ -474,29 +474,25 @@ make a good program).
So, you can either get rid of GNU emacs, or change it to use saner
values. To do the latter, you can stick the following in your .emacs file:

(defun c-lineup-arglist-tabs-only (ignored)
"Line up argument lists by tabs, not spaces"
(let* ((anchor (c-langelem-pos c-syntactic-element))
(column (c-langelem-2nd-pos c-syntactic-element))
(offset (- (1+ column) anchor))
(steps (floor offset c-basic-offset)))
(* (max steps 1)
c-basic-offset)))

(add-hook 'c-mode-hook
(lambda ()
(let ((filename (buffer-file-name)))
;; Enable kernel mode for the appropriate files
(when (and filename
(string-match "~/src/linux-trees" filename))
(setq indent-tabs-mode t)
(c-set-style "linux")
(c-set-offset 'arglist-cont-nonempty
'(c-lineup-gcc-asm-reg
c-lineup-arglist-tabs-only))))))

This will make emacs go better with the kernel coding style for C
files below ~/src/linux-trees.
(defun linux-c-mode ()
"C mode with adjusted defaults for use with the Linux kernel."
(interactive)
(c-mode)
(c-set-style "K&R")
(setq tab-width 8)
(setq indent-tabs-mode t)
(setq c-basic-offset 8))

This will define the M-x linux-c-mode command. When hacking on a
module, if you put the string -*- linux-c -*- somewhere on the first
two lines, this mode will be automatically invoked. Also, you may want
to add

(setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode)
auto-mode-alist))

to your .emacs file if you want to have linux-c-mode switched on
automagically when you edit source files under /usr/src/linux.

But even if you fail in getting emacs to do sane formatting, not
everything is lost: use "indent".
Expand Down
57 changes: 33 additions & 24 deletions trunk/Documentation/DocBook/kernel-locking.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@
</para>

<sect1 id="lock-intro">
<title>Two Main Types of Kernel Locks: Spinlocks and Mutexes</title>
<title>Three Main Types of Kernel Locks: Spinlocks, Mutexes and Semaphores</title>

<para>
There are two main types of kernel locks. The fundamental type
There are three main types of kernel locks. The fundamental type
is the spinlock
(<filename class="headerfile">include/asm/spinlock.h</filename>),
which is a very simple single-holder lock: if you can't get the
Expand All @@ -239,6 +239,14 @@
can't sleep (see <xref linkend="sleeping-things"/>), and so have to
use a spinlock instead.
</para>
<para>
The third type is a semaphore
(<filename class="headerfile">include/linux/semaphore.h</filename>): it
can have more than one holder at any time (the number decided at
initialization time), although it is most commonly used as a
single-holder lock (a mutex). If you can't get a semaphore, your
task will be suspended and later on woken up - just like for mutexes.
</para>
<para>
Neither type of lock is recursive: see
<xref linkend="deadlock"/>.
Expand Down Expand Up @@ -270,7 +278,7 @@
</para>

<para>
Mutexes still exist, because they are required for
Semaphores still exist, because they are required for
synchronization between <firstterm linkend="gloss-usercontext">user
contexts</firstterm>, as we will see below.
</para>
Expand All @@ -281,17 +289,18 @@

<para>
If you have a data structure which is only ever accessed from
user context, then you can use a simple mutex
(<filename>include/linux/mutex.h</filename>) to protect it. This
is the most trivial case: you initialize the mutex. Then you can
call <function>mutex_lock_interruptible()</function> to grab the mutex,
and <function>mutex_unlock()</function> to release it. There is also a
<function>mutex_lock()</function>, which should be avoided, because it
user context, then you can use a simple semaphore
(<filename>linux/linux/semaphore.h</filename>) to protect it. This
is the most trivial case: you initialize the semaphore to the number
of resources available (usually 1), and call
<function>down_interruptible()</function> to grab the semaphore, and
<function>up()</function> to release it. There is also a
<function>down()</function>, which should be avoided, because it
will not return if a signal is received.
</para>

<para>
Example: <filename>net/netfilter/nf_sockopt.c</filename> allows
Example: <filename>linux/net/core/netfilter.c</filename> allows
registration of new <function>setsockopt()</function> and
<function>getsockopt()</function> calls, with
<function>nf_register_sockopt()</function>. Registration and
Expand Down Expand Up @@ -506,7 +515,7 @@
<listitem>
<para>
If you are in a process context (any syscall) and want to
lock other process out, use a mutex. You can take a mutex
lock other process out, use a semaphore. You can take a semaphore
and sleep (<function>copy_from_user*(</function> or
<function>kmalloc(x,GFP_KERNEL)</function>).
</para>
Expand Down Expand Up @@ -653,7 +662,7 @@
<entry>SLBH</entry>
<entry>SLBH</entry>
<entry>SLBH</entry>
<entry>MLI</entry>
<entry>DI</entry>
<entry>None</entry>
</row>

Expand Down Expand Up @@ -683,8 +692,8 @@
<entry>spin_lock_bh</entry>
</row>
<row>
<entry>MLI</entry>
<entry>mutex_lock_interruptible</entry>
<entry>DI</entry>
<entry>down_interruptible</entry>
</row>

</tbody>
Expand Down Expand Up @@ -1301,7 +1310,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>.
<para>
There is a coding bug where a piece of code tries to grab a
spinlock twice: it will spin forever, waiting for the lock to
be released (spinlocks, rwlocks and mutexes are not
be released (spinlocks, rwlocks and semaphores are not
recursive in Linux). This is trivial to diagnose: not a
stay-up-five-nights-talk-to-fluffy-code-bunnies kind of
problem.
Expand All @@ -1326,7 +1335,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>.

<para>
This complete lockup is easy to diagnose: on SMP boxes the
watchdog timer or compiling with <symbol>DEBUG_SPINLOCK</symbol> set
watchdog timer or compiling with <symbol>DEBUG_SPINLOCKS</symbol> set
(<filename>include/linux/spinlock.h</filename>) will show this up
immediately when it happens.
</para>
Expand Down Expand Up @@ -1549,7 +1558,7 @@ the amount of locking which needs to be done.
<title>Read/Write Lock Variants</title>

<para>
Both spinlocks and mutexes have read/write variants:
Both spinlocks and semaphores have read/write variants:
<type>rwlock_t</type> and <structname>struct rw_semaphore</structname>.
These divide users into two classes: the readers and the writers. If
you are only reading the data, you can get a read lock, but to write to
Expand Down Expand Up @@ -1672,7 +1681,7 @@ the amount of locking which needs to be done.
#include &lt;linux/slab.h&gt;
#include &lt;linux/string.h&gt;
+#include &lt;linux/rcupdate.h&gt;
#include &lt;linux/mutex.h&gt;
#include &lt;linux/semaphore.h&gt;
#include &lt;asm/errno.h&gt;

struct object
Expand Down Expand Up @@ -1904,7 +1913,7 @@ machines due to caching.
</listitem>
<listitem>
<para>
<function>put_user()</function>
<function> put_user()</function>
</para>
</listitem>
</itemizedlist>
Expand All @@ -1918,13 +1927,13 @@ machines due to caching.

<listitem>
<para>
<function>mutex_lock_interruptible()</function> and
<function>mutex_lock()</function>
<function>down_interruptible()</function> and
<function>down()</function>
</para>
<para>
There is a <function>mutex_trylock()</function> which can be
There is a <function>down_trylock()</function> which can be
used inside interrupt context, as it will not sleep.
<function>mutex_unlock()</function> will also never sleep.
<function>up()</function> will also never sleep.
</para>
</listitem>
</itemizedlist>
Expand Down Expand Up @@ -2014,7 +2023,7 @@ machines due to caching.
<para>
Prior to 2.5, or when <symbol>CONFIG_PREEMPT</symbol> is
unset, processes in user context inside the kernel would not
preempt each other (ie. you had that CPU until you gave it up,
preempt each other (ie. you had that CPU until you have it up,
except for interrupts). With the addition of
<symbol>CONFIG_PREEMPT</symbol> in 2.5.4, this changed: when
in user context, higher priority tasks can "cut in": spinlocks
Expand Down
4 changes: 2 additions & 2 deletions trunk/Documentation/DocBook/procfs-guide.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@

<revhistory>
<revision>
<revnumber>1.0</revnumber>
<revnumber>1.0&nbsp;</revnumber>
<date>May 30, 2001</date>
<revremark>Initial revision posted to linux-kernel</revremark>
</revision>
<revision>
<revnumber>1.1</revnumber>
<revnumber>1.1&nbsp;</revnumber>
<date>June 3, 2001</date>
<revremark>Revised after comments from linux-kernel</revremark>
</revision>
Expand Down
11 changes: 3 additions & 8 deletions trunk/Documentation/accounting/delay-accounting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ the delays experienced by a task while
a) waiting for a CPU (while being runnable)
b) completion of synchronous block I/O initiated by the task
c) swapping in pages
d) memory reclaim

and makes these statistics available to userspace through
the taskstats interface.
Expand Down Expand Up @@ -42,7 +41,7 @@ this structure. See
include/linux/taskstats.h
for a description of the fields pertaining to delay accounting.
It will generally be in the form of counters returning the cumulative
delay seen for cpu, sync block I/O, swapin, memory reclaim etc.
delay seen for cpu, sync block I/O, swapin etc.

Taking the difference of two successive readings of a given
counter (say cpu_delay_total) for a task will give the delay
Expand Down Expand Up @@ -95,9 +94,7 @@ CPU count real total virtual total delay total
7876 92005750 100000000 24001500
IO count delay total
0 0
SWAP count delay total
0 0
RECLAIM count delay total
MEM count delay total
0 0

Get delays seen in executing a given simple command
Expand All @@ -111,7 +108,5 @@ CPU count real total virtual total delay total
6 4000250 4000000 0
IO count delay total
0 0
SWAP count delay total
0 0
RECLAIM count delay total
MEM count delay total
0 0
8 changes: 2 additions & 6 deletions trunk/Documentation/accounting/getdelays.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,14 @@ void print_delayacct(struct taskstats *t)
" %15llu%15llu%15llu%15llu\n"
"IO %15s%15s\n"
" %15llu%15llu\n"
"SWAP %15s%15s\n"
" %15llu%15llu\n"
"RECLAIM %12s%15s\n"
"MEM %15s%15s\n"
" %15llu%15llu\n",
"count", "real total", "virtual total", "delay total",
t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total,
t->cpu_delay_total,
"count", "delay total",
t->blkio_count, t->blkio_delay_total,
"count", "delay total", t->swapin_count, t->swapin_delay_total,
"count", "delay total",
t->freepages_count, t->freepages_delay_total);
"count", "delay total", t->swapin_count, t->swapin_delay_total);
}

void task_context_switch_counts(struct taskstats *t)
Expand Down
7 changes: 0 additions & 7 deletions trunk/Documentation/accounting/taskstats-struct.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ There are three different groups of fields in the struct taskstats:

5) Time accounting for SMT machines

6) Extended delay accounting fields for memory reclaim

Future extension should add fields to the end of the taskstats struct, and
should not change the relative position of each field within the struct.

Expand Down Expand Up @@ -172,9 +170,4 @@ struct taskstats {
__u64 ac_utimescaled; /* utime scaled on frequency etc */
__u64 ac_stimescaled; /* stime scaled on frequency etc */
__u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */

6) Extended delay accounting fields for memory reclaim
/* Delay waiting for memory reclaim */
__u64 freepages_count;
__u64 freepages_delay_total;
}
Loading

0 comments on commit 75502ec

Please sign in to comment.