-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 161356 b: refs/heads/master c: f86054c h: refs/heads/master v: v3
- Loading branch information
Linus Torvalds
committed
Sep 15, 2009
1 parent
d0bb2c1
commit ef364ac
Showing
944 changed files
with
77,071 additions
and
14,744 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 33f82d141c897f39cd8bce592d88cb3c5af58342 | ||
refs/heads/master: f86054c24565d09d1997f03192761dabf6b8a9c9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
S3C24XX CPUfreq support | ||
======================= | ||
|
||
Introduction | ||
------------ | ||
|
||
The S3C24XX series support a number of power saving systems, such as | ||
the ability to change the core, memory and peripheral operating | ||
frequencies. The core control is exported via the CPUFreq driver | ||
which has a number of different manual or automatic controls over the | ||
rate the core is running at. | ||
|
||
There are two forms of the driver depending on the specific CPU and | ||
how the clocks are arranged. The first implementation used as single | ||
PLL to feed the ARM, memory and peripherals via a series of dividers | ||
and muxes and this is the implementation that is documented here. A | ||
newer version where there is a seperate PLL and clock divider for the | ||
ARM core is available as a seperate driver. | ||
|
||
|
||
Layout | ||
------ | ||
|
||
The code core manages the CPU specific drivers, any data that they | ||
need to register and the interface to the generic drivers/cpufreq | ||
system. Each CPU registers a driver to control the PLL, clock dividers | ||
and anything else associated with it. Any board that wants to use this | ||
framework needs to supply at least basic details of what is required. | ||
|
||
The core registers with drivers/cpufreq at init time if all the data | ||
necessary has been supplied. | ||
|
||
|
||
CPU support | ||
----------- | ||
|
||
The support for each CPU depends on the facilities provided by the | ||
SoC and the driver as each device has different PLL and clock chains | ||
associated with it. | ||
|
||
|
||
Slow Mode | ||
--------- | ||
|
||
The SLOW mode where the PLL is turned off altogether and the | ||
system is fed by the external crystal input is currently not | ||
supported. | ||
|
||
|
||
sysfs | ||
----- | ||
|
||
The core code exports extra information via sysfs in the directory | ||
devices/system/cpu/cpu0/arch-freq. | ||
|
||
|
||
Board Support | ||
------------- | ||
|
||
Each board that wants to use the cpufreq code must register some basic | ||
information with the core driver to provide information about what the | ||
board requires and any restrictions being placed on it. | ||
|
||
The board needs to supply information about whether it needs the IO bank | ||
timings changing, any maximum frequency limits and information about the | ||
SDRAM refresh rate. | ||
|
||
|
||
|
||
|
||
Document Author | ||
--------------- | ||
|
||
Ben Dooks, Copyright 2009 Simtec Electronics | ||
Licensed under GPLv2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
uevents and GFS2 | ||
================== | ||
|
||
During the lifetime of a GFS2 mount, a number of uevents are generated. | ||
This document explains what the events are and what they are used | ||
for (by gfs_controld in gfs2-utils). | ||
|
||
A list of GFS2 uevents | ||
----------------------- | ||
|
||
1. ADD | ||
|
||
The ADD event occurs at mount time. It will always be the first | ||
uevent generated by the newly created filesystem. If the mount | ||
is successful, an ONLINE uevent will follow. If it is not successful | ||
then a REMOVE uevent will follow. | ||
|
||
The ADD uevent has two environment variables: SPECTATOR=[0|1] | ||
and RDONLY=[0|1] that specify the spectator status (a read-only mount | ||
with no journal assigned), and read-only (with journal assigned) status | ||
of the filesystem respectively. | ||
|
||
2. ONLINE | ||
|
||
The ONLINE uevent is generated after a successful mount or remount. It | ||
has the same environment variables as the ADD uevent. The ONLINE | ||
uevent, along with the two environment variables for spectator and | ||
RDONLY are a relatively recent addition (2.6.32-rc+) and will not | ||
be generated by older kernels. | ||
|
||
3. CHANGE | ||
|
||
The CHANGE uevent is used in two places. One is when reporting the | ||
successful mount of the filesystem by the first node (FIRSTMOUNT=Done). | ||
This is used as a signal by gfs_controld that it is then ok for other | ||
nodes in the cluster to mount the filesystem. | ||
|
||
The other CHANGE uevent is used to inform of the completion | ||
of journal recovery for one of the filesystems journals. It has | ||
two environment variables, JID= which specifies the journal id which | ||
has just been recovered, and RECOVERY=[Done|Failed] to indicate the | ||
success (or otherwise) of the operation. These uevents are generated | ||
for every journal recovered, whether it is during the initial mount | ||
process or as the result of gfs_controld requesting a specific journal | ||
recovery via the /sys/fs/gfs2/<fsname>/lock_module/recovery file. | ||
|
||
Because the CHANGE uevent was used (in early versions of gfs_controld) | ||
without checking the environment variables to discover the state, we | ||
cannot add any more functions to it without running the risk of | ||
someone using an older version of the user tools and breaking their | ||
cluster. For this reason the ONLINE uevent was used when adding a new | ||
uevent for a successful mount or remount. | ||
|
||
4. OFFLINE | ||
|
||
The OFFLINE uevent is only generated due to filesystem errors and is used | ||
as part of the "withdraw" mechanism. Currently this doesn't give any | ||
information about what the error is, which is something that needs to | ||
be fixed. | ||
|
||
5. REMOVE | ||
|
||
The REMOVE uevent is generated at the end of an unsuccessful mount | ||
or at the end of a umount of the filesystem. All REMOVE uevents will | ||
have been preceeded by at least an ADD uevent for the same fileystem, | ||
and unlike the other uevents is generated automatically by the kernel's | ||
kobject subsystem. | ||
|
||
|
||
Information common to all GFS2 uevents (uevent environment variables) | ||
---------------------------------------------------------------------- | ||
|
||
1. LOCKTABLE= | ||
|
||
The LOCKTABLE is a string, as supplied on the mount command | ||
line (locktable=) or via fstab. It is used as a filesystem label | ||
as well as providing the information for a lock_dlm mount to be | ||
able to join the cluster. | ||
|
||
2. LOCKPROTO= | ||
|
||
The LOCKPROTO is a string, and its value depends on what is set | ||
on the mount command line, or via fstab. It will be either | ||
lock_nolock or lock_dlm. In the future other lock managers | ||
may be supported. | ||
|
||
3. JOURNALID= | ||
|
||
If a journal is in use by the filesystem (journals are not | ||
assigned for spectator mounts) then this will give the | ||
numeric journal id in all GFS2 uevents. | ||
|
||
4. UUID= | ||
|
||
With recent versions of gfs2-utils, mkfs.gfs2 writes a UUID | ||
into the filesystem superblock. If it exists, this will | ||
be included in every uevent relating to the filesystem. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
Using flexible arrays in the kernel | ||
Last updated for 2.6.31 | ||
Jonathan Corbet <corbet@lwn.net> | ||
|
||
Large contiguous memory allocations can be unreliable in the Linux kernel. | ||
Kernel programmers will sometimes respond to this problem by allocating | ||
pages with vmalloc(). This solution not ideal, though. On 32-bit systems, | ||
memory from vmalloc() must be mapped into a relatively small address space; | ||
it's easy to run out. On SMP systems, the page table changes required by | ||
vmalloc() allocations can require expensive cross-processor interrupts on | ||
all CPUs. And, on all systems, use of space in the vmalloc() range | ||
increases pressure on the translation lookaside buffer (TLB), reducing the | ||
performance of the system. | ||
|
||
In many cases, the need for memory from vmalloc() can be eliminated by | ||
piecing together an array from smaller parts; the flexible array library | ||
exists to make this task easier. | ||
|
||
A flexible array holds an arbitrary (within limits) number of fixed-sized | ||
objects, accessed via an integer index. Sparse arrays are handled | ||
reasonably well. Only single-page allocations are made, so memory | ||
allocation failures should be relatively rare. The down sides are that the | ||
arrays cannot be indexed directly, individual object size cannot exceed the | ||
system page size, and putting data into a flexible array requires a copy | ||
operation. It's also worth noting that flexible arrays do no internal | ||
locking at all; if concurrent access to an array is possible, then the | ||
caller must arrange for appropriate mutual exclusion. | ||
|
||
The creation of a flexible array is done with: | ||
|
||
#include <linux/flex_array.h> | ||
|
||
struct flex_array *flex_array_alloc(int element_size, | ||
unsigned int total, | ||
gfp_t flags); | ||
|
||
The individual object size is provided by element_size, while total is the | ||
maximum number of objects which can be stored in the array. The flags | ||
argument is passed directly to the internal memory allocation calls. With | ||
the current code, using flags to ask for high memory is likely to lead to | ||
notably unpleasant side effects. | ||
|
||
Storing data into a flexible array is accomplished with a call to: | ||
|
||
int flex_array_put(struct flex_array *array, unsigned int element_nr, | ||
void *src, gfp_t flags); | ||
|
||
This call will copy the data from src into the array, in the position | ||
indicated by element_nr (which must be less than the maximum specified when | ||
the array was created). If any memory allocations must be performed, flags | ||
will be used. The return value is zero on success, a negative error code | ||
otherwise. | ||
|
||
There might possibly be a need to store data into a flexible array while | ||
running in some sort of atomic context; in this situation, sleeping in the | ||
memory allocator would be a bad thing. That can be avoided by using | ||
GFP_ATOMIC for the flags value, but, often, there is a better way. The | ||
trick is to ensure that any needed memory allocations are done before | ||
entering atomic context, using: | ||
|
||
int flex_array_prealloc(struct flex_array *array, unsigned int start, | ||
unsigned int end, gfp_t flags); | ||
|
||
This function will ensure that memory for the elements indexed in the range | ||
defined by start and end has been allocated. Thereafter, a | ||
flex_array_put() call on an element in that range is guaranteed not to | ||
block. | ||
|
||
Getting data back out of the array is done with: | ||
|
||
void *flex_array_get(struct flex_array *fa, unsigned int element_nr); | ||
|
||
The return value is a pointer to the data element, or NULL if that | ||
particular element has never been allocated. | ||
|
||
Note that it is possible to get back a valid pointer for an element which | ||
has never been stored in the array. Memory for array elements is allocated | ||
one page at a time; a single allocation could provide memory for several | ||
adjacent elements. The flexible array code does not know if a specific | ||
element has been written; it only knows if the associated memory is | ||
present. So a flex_array_get() call on an element which was never stored | ||
in the array has the potential to return a pointer to random data. If the | ||
caller does not have a separate way to know which elements were actually | ||
stored, it might be wise, at least, to add GFP_ZERO to the flags argument | ||
to ensure that all elements are zeroed. | ||
|
||
There is no way to remove a single element from the array. It is possible, | ||
though, to remove all elements with a call to: | ||
|
||
void flex_array_free_parts(struct flex_array *array); | ||
|
||
This call frees all elements, but leaves the array itself in place. | ||
Freeing the entire array is done with: | ||
|
||
void flex_array_free(struct flex_array *array); | ||
|
||
As of this writing, there are no users of flexible arrays in the mainline | ||
kernel. The functions described here are also not exported to modules; | ||
that will probably be fixed when somebody comes up with a need for it. |
Oops, something went wrong.