Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106387
b: refs/heads/master
c: 1685a03
h: refs/heads/master
i:
  106385: 656a8bc
  106383: fa7c0e3
v: v3
  • Loading branch information
Jan Nikitenko authored and Pierre Ossman committed Jul 23, 2008
1 parent 9ef7a4c commit 8ac70d0
Show file tree
Hide file tree
Showing 1,983 changed files with 45,341 additions and 79,821 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: 4836e3007882984279ca63d3c42bf0b14616eb78
refs/heads/master: 1685a03e98b7e9b83e0aa692c1cc470b3aa37597
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
4 changes: 2 additions & 2 deletions trunk/Documentation/DMA-API.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ recommended that you never use these unless you really know what the
cache width is.

int
dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
dma_mapping_error(dma_addr_t dma_addr)

int
pci_dma_mapping_error(struct pci_dev *hwdev, dma_addr_t dma_addr)
pci_dma_mapping_error(dma_addr_t dma_addr)

In some circumstances dma_map_single and dma_map_page will fail to create
a mapping. A driver can check for these errors by testing the returned
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
4 changes: 2 additions & 2 deletions trunk/Documentation/Intel-IOMMU.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ IOVA generation is pretty generic. We used the same technique as vmalloc()
but these are not global address spaces, but separate for each domain.
Different DMA engines may support different number of domains.

We also allocate guard pages with each mapping, so we can attempt to catch
We also allocate gaurd pages with each mapping, so we can attempt to catch
any overflow that might happen.


Expand Down Expand Up @@ -112,4 +112,4 @@ TBD

- For compatibility testing, could use unity map domain for all devices, just
provide a 1-1 for all useful memory under a single domain for all devices.
- API for paravirt ops for abstracting functionality for VMM folks.
- API for paravirt ops for abstracting functionlity for VMM folks.
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
Loading

0 comments on commit 8ac70d0

Please sign in to comment.