mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -12,6 +12,9 @@
|
||||
*.ko
|
||||
*.so
|
||||
*.mod.c
|
||||
*.i
|
||||
*.lst
|
||||
*.symtypes
|
||||
|
||||
#
|
||||
# Top-level generic files
|
||||
@@ -30,6 +33,11 @@ include/config
|
||||
include/linux/autoconf.h
|
||||
include/linux/compile.h
|
||||
include/linux/version.h
|
||||
include/linux/utsrelease.h
|
||||
|
||||
# stgit generated dirs
|
||||
patches-*
|
||||
|
||||
# quilt's files
|
||||
patches
|
||||
series
|
||||
|
||||
12
CREDITS
12
CREDITS
@@ -528,11 +528,11 @@ S: Oxford
|
||||
S: United Kingdom
|
||||
|
||||
N: Luiz Fernando N. Capitulino
|
||||
E: lcapitulino@terra.com.br
|
||||
E: lcapitulino@prefeitura.sp.gov.br
|
||||
W: http://www.telecentros.sp.gov.br
|
||||
D: Little fixes and a lot of janitorial work
|
||||
S: E-GOV Telecentros SP
|
||||
E: lcapitulino@mandriva.com.br
|
||||
E: lcapitulino@gmail.com
|
||||
W: http://www.cpu.eti.br
|
||||
D: misc kernel hacking
|
||||
S: Mandriva
|
||||
S: Brazil
|
||||
|
||||
N: Remy Card
|
||||
@@ -2209,7 +2209,7 @@ S: (address available on request)
|
||||
S: USA
|
||||
|
||||
N: Ian McDonald
|
||||
E: iam4@cs.waikato.ac.nz
|
||||
E: ian.mcdonald@jandi.co.nz
|
||||
E: imcdnzl@gmail.com
|
||||
W: http://wand.net.nz/~iam4
|
||||
W: http://imcdnzl.blogspot.com
|
||||
|
||||
@@ -698,12 +698,12 @@ these interfaces. Remember that, as defined, consistent mappings are
|
||||
always going to be SAC addressable.
|
||||
|
||||
The first thing your driver needs to do is query the PCI platform
|
||||
layer with your devices DAC addressing capabilities:
|
||||
layer if it is capable of handling your devices DAC addressing
|
||||
capabilities:
|
||||
|
||||
int pci_dac_set_dma_mask(struct pci_dev *pdev, u64 mask);
|
||||
int pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask);
|
||||
|
||||
This routine behaves identically to pci_set_dma_mask. You may not
|
||||
use the following interfaces if this routine fails.
|
||||
You may not use the following interfaces if this routine fails.
|
||||
|
||||
Next, DMA addresses using this API are kept track of using the
|
||||
dma64_addr_t type. It is guaranteed to be big enough to hold any
|
||||
|
||||
@@ -58,6 +58,9 @@
|
||||
!Iinclude/linux/ktime.h
|
||||
!Iinclude/linux/hrtimer.h
|
||||
!Ekernel/hrtimer.c
|
||||
</sect1>
|
||||
<sect1><title>Workqueues and Kevents</title>
|
||||
!Ekernel/workqueue.c
|
||||
</sect1>
|
||||
<sect1><title>Internal Functions</title>
|
||||
!Ikernel/exit.c
|
||||
@@ -300,7 +303,7 @@ X!Ekernel/module.c
|
||||
</sect1>
|
||||
|
||||
<sect1><title>Resources Management</title>
|
||||
!Ekernel/resource.c
|
||||
!Ikernel/resource.c
|
||||
</sect1>
|
||||
|
||||
<sect1><title>MTRR Handling</title>
|
||||
@@ -312,9 +315,7 @@ X!Ekernel/module.c
|
||||
!Edrivers/pci/pci-driver.c
|
||||
!Edrivers/pci/remove.c
|
||||
!Edrivers/pci/pci-acpi.c
|
||||
<!-- kerneldoc does not understand __devinit
|
||||
X!Edrivers/pci/search.c
|
||||
-->
|
||||
!Edrivers/pci/search.c
|
||||
!Edrivers/pci/msi.c
|
||||
!Edrivers/pci/bus.c
|
||||
<!-- FIXME: Removed for now since no structured comments in source
|
||||
|
||||
@@ -687,8 +687,9 @@ diff shows how closely related RCU and reader-writer locking can be.
|
||||
+ spin_lock(&listmutex);
|
||||
list_for_each_entry(p, head, lp) {
|
||||
if (p->key == key) {
|
||||
list_del(&p->list);
|
||||
- list_del(&p->list);
|
||||
- write_unlock(&listmutex);
|
||||
+ list_del_rcu(&p->list);
|
||||
+ spin_unlock(&listmutex);
|
||||
+ synchronize_rcu();
|
||||
kfree(p);
|
||||
@@ -736,7 +737,7 @@ Or, for those who prefer a side-by-side listing:
|
||||
5 write_lock(&listmutex); 5 spin_lock(&listmutex);
|
||||
6 list_for_each_entry(p, head, lp) { 6 list_for_each_entry(p, head, lp) {
|
||||
7 if (p->key == key) { 7 if (p->key == key) {
|
||||
8 list_del(&p->list); 8 list_del(&p->list);
|
||||
8 list_del(&p->list); 8 list_del_rcu(&p->list);
|
||||
9 write_unlock(&listmutex); 9 spin_unlock(&listmutex);
|
||||
10 synchronize_rcu();
|
||||
10 kfree(p); 11 kfree(p);
|
||||
|
||||
@@ -1,57 +1,63 @@
|
||||
Linux Kernel patch sumbittal checklist
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Here are some basic things that developers should do if they
|
||||
want to see their kernel patch submittals accepted quicker.
|
||||
Here are some basic things that developers should do if they want to see their
|
||||
kernel patch submissions accepted more quickly.
|
||||
|
||||
These are all above and beyond the documentation that is provided
|
||||
in Documentation/SubmittingPatches and elsewhere about submitting
|
||||
Linux kernel patches.
|
||||
These are all above and beyond the documentation that is provided in
|
||||
Documentation/SubmittingPatches and elsewhere regarding submitting Linux
|
||||
kernel patches.
|
||||
|
||||
|
||||
|
||||
- Builds cleanly with applicable or modified CONFIG options =y, =m, and =n.
|
||||
No gcc warnings/errors, no linker warnings/errors.
|
||||
1: Builds cleanly with applicable or modified CONFIG options =y, =m, and
|
||||
=n. No gcc warnings/errors, no linker warnings/errors.
|
||||
|
||||
- Passes allnoconfig, allmodconfig
|
||||
2: Passes allnoconfig, allmodconfig
|
||||
|
||||
- Builds on multiple CPU arch-es by using local cross-compile tools
|
||||
or something like PLM at OSDL.
|
||||
3: Builds on multiple CPU architectures by using local cross-compile tools
|
||||
or something like PLM at OSDL.
|
||||
|
||||
- ppc64 is a good architecture for cross-compilation checking because it
|
||||
tends to use `unsigned long' for 64-bit quantities.
|
||||
4: ppc64 is a good architecture for cross-compilation checking because it
|
||||
tends to use `unsigned long' for 64-bit quantities.
|
||||
|
||||
- Matches kernel coding style(!)
|
||||
5: Matches kernel coding style(!)
|
||||
|
||||
- Any new or modified CONFIG options don't muck up the config menu.
|
||||
6: Any new or modified CONFIG options don't muck up the config menu.
|
||||
|
||||
- All new Kconfig options have help text.
|
||||
7: All new Kconfig options have help text.
|
||||
|
||||
- Has been carefully reviewed with respect to relevant Kconfig
|
||||
combinations. This is very hard to get right with testing --
|
||||
brainpower pays off here.
|
||||
8: Has been carefully reviewed with respect to relevant Kconfig
|
||||
combinations. This is very hard to get right with testing -- brainpower
|
||||
pays off here.
|
||||
|
||||
- Check cleanly with sparse.
|
||||
9: Check cleanly with sparse.
|
||||
|
||||
- Use 'make checkstack' and 'make namespacecheck' and fix any
|
||||
problems that they find. Note: checkstack does not point out
|
||||
problems explicitly, but any one function that uses more than
|
||||
512 bytes on the stack is a candidate for change.
|
||||
10: Use 'make checkstack' and 'make namespacecheck' and fix any problems
|
||||
that they find. Note: checkstack does not point out problems explicitly,
|
||||
but any one function that uses more than 512 bytes on the stack is a
|
||||
candidate for change.
|
||||
|
||||
- Include kernel-doc to document global kernel APIs. (Not required
|
||||
for static functions, but OK there also.) Use 'make htmldocs'
|
||||
or 'make mandocs' to check the kernel-doc and fix any issues.
|
||||
11: Include kernel-doc to document global kernel APIs. (Not required for
|
||||
static functions, but OK there also.) Use 'make htmldocs' or 'make
|
||||
mandocs' to check the kernel-doc and fix any issues.
|
||||
|
||||
- Has been tested with CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT,
|
||||
CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES,
|
||||
CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_SPINLOCK_SLEEP all simultaneously
|
||||
enabled.
|
||||
12: Has been tested with CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT,
|
||||
CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES,
|
||||
CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_SPINLOCK_SLEEP all simultaneously
|
||||
enabled.
|
||||
|
||||
- Has been build- and runtime tested with and without CONFIG_SMP and
|
||||
CONFIG_PREEMPT.
|
||||
13: Has been build- and runtime tested with and without CONFIG_SMP and
|
||||
CONFIG_PREEMPT.
|
||||
|
||||
- If the patch affects IO/Disk, etc: has been tested with and without
|
||||
CONFIG_LBD.
|
||||
14: If the patch affects IO/Disk, etc: has been tested with and without
|
||||
CONFIG_LBD.
|
||||
|
||||
15: All codepaths have been exercised with all lockdep features enabled.
|
||||
|
||||
2006-APR-27
|
||||
16: All new /proc entries are documented under Documentation/
|
||||
|
||||
17: All new kernel boot parameters are documented in
|
||||
Documentation/kernel-parameters.txt.
|
||||
|
||||
18: All new module parameters are documented with MODULE_PARM_DESC()
|
||||
|
||||
@@ -10,7 +10,9 @@ kernel, the process can sometimes be daunting if you're not familiar
|
||||
with "the system." This text is a collection of suggestions which
|
||||
can greatly increase the chances of your change being accepted.
|
||||
|
||||
If you are submitting a driver, also read Documentation/SubmittingDrivers.
|
||||
Read Documentation/SubmitChecklist for a list of items to check
|
||||
before submitting code. If you are submitting a driver, also read
|
||||
Documentation/SubmittingDrivers.
|
||||
|
||||
|
||||
|
||||
@@ -74,9 +76,6 @@ There are a number of scripts which can aid in this:
|
||||
Quilt:
|
||||
http://savannah.nongnu.org/projects/quilt
|
||||
|
||||
Randy Dunlap's patch scripts:
|
||||
http://www.xenotime.net/linux/scripts/patching-scripts-002.tar.gz
|
||||
|
||||
Andrew Morton's patch scripts:
|
||||
http://www.zip.com.au/~akpm/linux/patches/
|
||||
Instead of these scripts, quilt is the recommended patch management
|
||||
@@ -309,6 +308,8 @@ then you just add a line saying
|
||||
|
||||
Signed-off-by: Random J Developer <random@developer.example.org>
|
||||
|
||||
using your real name (sorry, no pseudonyms or anonymous contributions.)
|
||||
|
||||
Some people also put extra tags at the end. They'll just be ignored for
|
||||
now, but you can do this to mark internal company procedures or just
|
||||
point out some special detail about the sign-off.
|
||||
@@ -484,7 +485,7 @@ Greg Kroah-Hartman "How to piss off a kernel subsystem maintainer".
|
||||
<http://www.kroah.com/log/2005/10/19/>
|
||||
<http://www.kroah.com/log/2006/01/11/>
|
||||
|
||||
NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people!.
|
||||
NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people!
|
||||
<http://marc.theaimsgroup.com/?l=linux-kernel&m=112112749912944&w=2>
|
||||
|
||||
Kernel Documentation/CodingStyle
|
||||
@@ -493,4 +494,3 @@ Kernel Documentation/CodingStyle
|
||||
Linus Torvald's mail on the canonical patch format:
|
||||
<http://lkml.org/lkml/2005/4/7/183>
|
||||
--
|
||||
Last updated on 17 Nov 2005.
|
||||
|
||||
112
Documentation/accounting/delay-accounting.txt
Normal file
112
Documentation/accounting/delay-accounting.txt
Normal file
@@ -0,0 +1,112 @@
|
||||
Delay accounting
|
||||
----------------
|
||||
|
||||
Tasks encounter delays in execution when they wait
|
||||
for some kernel resource to become available e.g. a
|
||||
runnable task may wait for a free CPU to run on.
|
||||
|
||||
The per-task delay accounting functionality measures
|
||||
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
|
||||
|
||||
and makes these statistics available to userspace through
|
||||
the taskstats interface.
|
||||
|
||||
Such delays provide feedback for setting a task's cpu priority,
|
||||
io priority and rss limit values appropriately. Long delays for
|
||||
important tasks could be a trigger for raising its corresponding priority.
|
||||
|
||||
The functionality, through its use of the taskstats interface, also provides
|
||||
delay statistics aggregated for all tasks (or threads) belonging to a
|
||||
thread group (corresponding to a traditional Unix process). This is a commonly
|
||||
needed aggregation that is more efficiently done by the kernel.
|
||||
|
||||
Userspace utilities, particularly resource management applications, can also
|
||||
aggregate delay statistics into arbitrary groups. To enable this, delay
|
||||
statistics of a task are available both during its lifetime as well as on its
|
||||
exit, ensuring continuous and complete monitoring can be done.
|
||||
|
||||
|
||||
Interface
|
||||
---------
|
||||
|
||||
Delay accounting uses the taskstats interface which is described
|
||||
in detail in a separate document in this directory. Taskstats returns a
|
||||
generic data structure to userspace corresponding to per-pid and per-tgid
|
||||
statistics. The delay accounting functionality populates specific fields of
|
||||
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 etc.
|
||||
|
||||
Taking the difference of two successive readings of a given
|
||||
counter (say cpu_delay_total) for a task will give the delay
|
||||
experienced by the task waiting for the corresponding resource
|
||||
in that interval.
|
||||
|
||||
When a task exits, records containing the per-task statistics
|
||||
are sent to userspace without requiring a command. If it is the last exiting
|
||||
task of a thread group, the per-tgid statistics are also sent. More details
|
||||
are given in the taskstats interface description.
|
||||
|
||||
The getdelays.c userspace utility in this directory allows simple commands to
|
||||
be run and the corresponding delay statistics to be displayed. It also serves
|
||||
as an example of using the taskstats interface.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Compile the kernel with
|
||||
CONFIG_TASK_DELAY_ACCT=y
|
||||
CONFIG_TASKSTATS=y
|
||||
|
||||
Delay accounting is enabled by default at boot up.
|
||||
To disable, add
|
||||
nodelayacct
|
||||
to the kernel boot options. The rest of the instructions
|
||||
below assume this has not been done.
|
||||
|
||||
After the system has booted up, use a utility
|
||||
similar to getdelays.c to access the delays
|
||||
seen by a given task or a task group (tgid).
|
||||
The utility also allows a given command to be
|
||||
executed and the corresponding delays to be
|
||||
seen.
|
||||
|
||||
General format of the getdelays command
|
||||
|
||||
getdelays [-t tgid] [-p pid] [-c cmd...]
|
||||
|
||||
|
||||
Get delays, since system boot, for pid 10
|
||||
# ./getdelays -p 10
|
||||
(output similar to next case)
|
||||
|
||||
Get sum of delays, since system boot, for all pids with tgid 5
|
||||
# ./getdelays -t 5
|
||||
|
||||
|
||||
CPU count real total virtual total delay total
|
||||
7876 92005750 100000000 24001500
|
||||
IO count delay total
|
||||
0 0
|
||||
MEM count delay total
|
||||
0 0
|
||||
|
||||
Get delays seen in executing a given simple command
|
||||
# ./getdelays -c ls /
|
||||
|
||||
bin data1 data3 data5 dev home media opt root srv sys usr
|
||||
boot data2 data4 data6 etc lib mnt proc sbin subdomain tmp var
|
||||
|
||||
|
||||
CPU count real total virtual total delay total
|
||||
6 4000250 4000000 0
|
||||
IO count delay total
|
||||
0 0
|
||||
MEM count delay total
|
||||
0 0
|
||||
396
Documentation/accounting/getdelays.c
Normal file
396
Documentation/accounting/getdelays.c
Normal file
@@ -0,0 +1,396 @@
|
||||
/* getdelays.c
|
||||
*
|
||||
* Utility to get per-pid and per-tgid delay accounting statistics
|
||||
* Also illustrates usage of the taskstats interface
|
||||
*
|
||||
* Copyright (C) Shailabh Nagar, IBM Corp. 2005
|
||||
* Copyright (C) Balbir Singh, IBM Corp. 2006
|
||||
* Copyright (c) Jay Lan, SGI. 2006
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <poll.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <linux/genetlink.h>
|
||||
#include <linux/taskstats.h>
|
||||
|
||||
/*
|
||||
* Generic macros for dealing with netlink sockets. Might be duplicated
|
||||
* elsewhere. It is recommended that commercial grade applications use
|
||||
* libnl or libnetlink and use the interfaces provided by the library
|
||||
*/
|
||||
#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
|
||||
#define GENLMSG_PAYLOAD(glh) (NLMSG_PAYLOAD(glh, 0) - GENL_HDRLEN)
|
||||
#define NLA_DATA(na) ((void *)((char*)(na) + NLA_HDRLEN))
|
||||
#define NLA_PAYLOAD(len) (len - NLA_HDRLEN)
|
||||
|
||||
#define err(code, fmt, arg...) do { printf(fmt, ##arg); exit(code); } while (0)
|
||||
int done = 0;
|
||||
int rcvbufsz=0;
|
||||
|
||||
char name[100];
|
||||
int dbg=0, print_delays=0;
|
||||
__u64 stime, utime;
|
||||
#define PRINTF(fmt, arg...) { \
|
||||
if (dbg) { \
|
||||
printf(fmt, ##arg); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Maximum size of response requested or message sent */
|
||||
#define MAX_MSG_SIZE 256
|
||||
/* Maximum number of cpus expected to be specified in a cpumask */
|
||||
#define MAX_CPUS 32
|
||||
/* Maximum length of pathname to log file */
|
||||
#define MAX_FILENAME 256
|
||||
|
||||
struct msgtemplate {
|
||||
struct nlmsghdr n;
|
||||
struct genlmsghdr g;
|
||||
char buf[MAX_MSG_SIZE];
|
||||
};
|
||||
|
||||
char cpumask[100+6*MAX_CPUS];
|
||||
|
||||
/*
|
||||
* Create a raw netlink socket and bind
|
||||
*/
|
||||
static int create_nl_socket(int protocol)
|
||||
{
|
||||
int fd;
|
||||
struct sockaddr_nl local;
|
||||
|
||||
fd = socket(AF_NETLINK, SOCK_RAW, protocol);
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
|
||||
if (rcvbufsz)
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
|
||||
&rcvbufsz, sizeof(rcvbufsz)) < 0) {
|
||||
printf("Unable to set socket rcv buf size to %d\n",
|
||||
rcvbufsz);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&local, 0, sizeof(local));
|
||||
local.nl_family = AF_NETLINK;
|
||||
|
||||
if (bind(fd, (struct sockaddr *) &local, sizeof(local)) < 0)
|
||||
goto error;
|
||||
|
||||
return fd;
|
||||
error:
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
|
||||
__u8 genl_cmd, __u16 nla_type,
|
||||
void *nla_data, int nla_len)
|
||||
{
|
||||
struct nlattr *na;
|
||||
struct sockaddr_nl nladdr;
|
||||
int r, buflen;
|
||||
char *buf;
|
||||
|
||||
struct msgtemplate msg;
|
||||
|
||||
msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
|
||||
msg.n.nlmsg_type = nlmsg_type;
|
||||
msg.n.nlmsg_flags = NLM_F_REQUEST;
|
||||
msg.n.nlmsg_seq = 0;
|
||||
msg.n.nlmsg_pid = nlmsg_pid;
|
||||
msg.g.cmd = genl_cmd;
|
||||
msg.g.version = 0x1;
|
||||
na = (struct nlattr *) GENLMSG_DATA(&msg);
|
||||
na->nla_type = nla_type;
|
||||
na->nla_len = nla_len + 1 + NLA_HDRLEN;
|
||||
memcpy(NLA_DATA(na), nla_data, nla_len);
|
||||
msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
|
||||
|
||||
buf = (char *) &msg;
|
||||
buflen = msg.n.nlmsg_len ;
|
||||
memset(&nladdr, 0, sizeof(nladdr));
|
||||
nladdr.nl_family = AF_NETLINK;
|
||||
while ((r = sendto(sd, buf, buflen, 0, (struct sockaddr *) &nladdr,
|
||||
sizeof(nladdr))) < buflen) {
|
||||
if (r > 0) {
|
||||
buf += r;
|
||||
buflen -= r;
|
||||
} else if (errno != EAGAIN)
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Probe the controller in genetlink to find the family id
|
||||
* for the TASKSTATS family
|
||||
*/
|
||||
int get_family_id(int sd)
|
||||
{
|
||||
struct {
|
||||
struct nlmsghdr n;
|
||||
struct genlmsghdr g;
|
||||
char buf[256];
|
||||
} ans;
|
||||
|
||||
int id, rc;
|
||||
struct nlattr *na;
|
||||
int rep_len;
|
||||
|
||||
strcpy(name, TASKSTATS_GENL_NAME);
|
||||
rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
|
||||
CTRL_ATTR_FAMILY_NAME, (void *)name,
|
||||
strlen(TASKSTATS_GENL_NAME)+1);
|
||||
|
||||
rep_len = recv(sd, &ans, sizeof(ans), 0);
|
||||
if (ans.n.nlmsg_type == NLMSG_ERROR ||
|
||||
(rep_len < 0) || !NLMSG_OK((&ans.n), rep_len))
|
||||
return 0;
|
||||
|
||||
na = (struct nlattr *) GENLMSG_DATA(&ans);
|
||||
na = (struct nlattr *) ((char *) na + NLA_ALIGN(na->nla_len));
|
||||
if (na->nla_type == CTRL_ATTR_FAMILY_ID) {
|
||||
id = *(__u16 *) NLA_DATA(na);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
void print_delayacct(struct taskstats *t)
|
||||
{
|
||||
printf("\n\nCPU %15s%15s%15s%15s\n"
|
||||
" %15llu%15llu%15llu%15llu\n"
|
||||
"IO %15s%15s\n"
|
||||
" %15llu%15llu\n"
|
||||
"MEM %15s%15s\n"
|
||||
" %15llu%15llu\n\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);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int c, rc, rep_len, aggr_len, len2, cmd_type;
|
||||
__u16 id;
|
||||
__u32 mypid;
|
||||
|
||||
struct nlattr *na;
|
||||
int nl_sd = -1;
|
||||
int len = 0;
|
||||
pid_t tid = 0;
|
||||
pid_t rtid = 0;
|
||||
|
||||
int fd = 0;
|
||||
int count = 0;
|
||||
int write_file = 0;
|
||||
int maskset = 0;
|
||||
char logfile[128];
|
||||
int loop = 0;
|
||||
|
||||
struct msgtemplate msg;
|
||||
|
||||
while (1) {
|
||||
c = getopt(argc, argv, "dw:r:m:t:p:v:l");
|
||||
if (c < 0)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'd':
|
||||
printf("print delayacct stats ON\n");
|
||||
print_delays = 1;
|
||||
break;
|
||||
case 'w':
|
||||
strncpy(logfile, optarg, MAX_FILENAME);
|
||||
printf("write to file %s\n", logfile);
|
||||
write_file = 1;
|
||||
break;
|
||||
case 'r':
|
||||
rcvbufsz = atoi(optarg);
|
||||
printf("receive buf size %d\n", rcvbufsz);
|
||||
if (rcvbufsz < 0)
|
||||
err(1, "Invalid rcv buf size\n");
|
||||
break;
|
||||
case 'm':
|
||||
strncpy(cpumask, optarg, sizeof(cpumask));
|
||||
maskset = 1;
|
||||
printf("cpumask %s maskset %d\n", cpumask, maskset);
|
||||
break;
|
||||
case 't':
|
||||
tid = atoi(optarg);
|
||||
if (!tid)
|
||||
err(1, "Invalid tgid\n");
|
||||
cmd_type = TASKSTATS_CMD_ATTR_TGID;
|
||||
print_delays = 1;
|
||||
break;
|
||||
case 'p':
|
||||
tid = atoi(optarg);
|
||||
if (!tid)
|
||||
err(1, "Invalid pid\n");
|
||||
cmd_type = TASKSTATS_CMD_ATTR_PID;
|
||||
print_delays = 1;
|
||||
break;
|
||||
case 'v':
|
||||
printf("debug on\n");
|
||||
dbg = 1;
|
||||
break;
|
||||
case 'l':
|
||||
printf("listen forever\n");
|
||||
loop = 1;
|
||||
break;
|
||||
default:
|
||||
printf("Unknown option %d\n", c);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (write_file) {
|
||||
fd = open(logfile, O_WRONLY | O_CREAT | O_TRUNC,
|
||||
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
if (fd == -1) {
|
||||
perror("Cannot open output file\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if ((nl_sd = create_nl_socket(NETLINK_GENERIC)) < 0)
|
||||
err(1, "error creating Netlink socket\n");
|
||||
|
||||
|
||||
mypid = getpid();
|
||||
id = get_family_id(nl_sd);
|
||||
if (!id) {
|
||||
printf("Error getting family id, errno %d", errno);
|
||||
goto err;
|
||||
}
|
||||
PRINTF("family id %d\n", id);
|
||||
|
||||
if (maskset) {
|
||||
rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
|
||||
TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
|
||||
&cpumask, sizeof(cpumask));
|
||||
PRINTF("Sent register cpumask, retval %d\n", rc);
|
||||
if (rc < 0) {
|
||||
printf("error sending register cpumask\n");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if (tid) {
|
||||
rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
|
||||
cmd_type, &tid, sizeof(__u32));
|
||||
PRINTF("Sent pid/tgid, retval %d\n", rc);
|
||||
if (rc < 0) {
|
||||
printf("error sending tid/tgid cmd\n");
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
int i;
|
||||
|
||||
rep_len = recv(nl_sd, &msg, sizeof(msg), 0);
|
||||
PRINTF("received %d bytes\n", rep_len);
|
||||
|
||||
if (rep_len < 0) {
|
||||
printf("nonfatal reply error: errno %d\n", errno);
|
||||
continue;
|
||||
}
|
||||
if (msg.n.nlmsg_type == NLMSG_ERROR ||
|
||||
!NLMSG_OK((&msg.n), rep_len)) {
|
||||
printf("fatal reply error, errno %d\n", errno);
|
||||
goto done;
|
||||
}
|
||||
|
||||
PRINTF("nlmsghdr size=%d, nlmsg_len=%d, rep_len=%d\n",
|
||||
sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len);
|
||||
|
||||
|
||||
rep_len = GENLMSG_PAYLOAD(&msg.n);
|
||||
|
||||
na = (struct nlattr *) GENLMSG_DATA(&msg);
|
||||
len = 0;
|
||||
i = 0;
|
||||
while (len < rep_len) {
|
||||
len += NLA_ALIGN(na->nla_len);
|
||||
switch (na->nla_type) {
|
||||
case TASKSTATS_TYPE_AGGR_TGID:
|
||||
/* Fall through */
|
||||
case TASKSTATS_TYPE_AGGR_PID:
|
||||
aggr_len = NLA_PAYLOAD(na->nla_len);
|
||||
len2 = 0;
|
||||
/* For nested attributes, na follows */
|
||||
na = (struct nlattr *) NLA_DATA(na);
|
||||
done = 0;
|
||||
while (len2 < aggr_len) {
|
||||
switch (na->nla_type) {
|
||||
case TASKSTATS_TYPE_PID:
|
||||
rtid = *(int *) NLA_DATA(na);
|
||||
if (print_delays)
|
||||
printf("PID\t%d\n", rtid);
|
||||
break;
|
||||
case TASKSTATS_TYPE_TGID:
|
||||
rtid = *(int *) NLA_DATA(na);
|
||||
if (print_delays)
|
||||
printf("TGID\t%d\n", rtid);
|
||||
break;
|
||||
case TASKSTATS_TYPE_STATS:
|
||||
count++;
|
||||
if (print_delays)
|
||||
print_delayacct((struct taskstats *) NLA_DATA(na));
|
||||
if (fd) {
|
||||
if (write(fd, NLA_DATA(na), na->nla_len) < 0) {
|
||||
err(1,"write error\n");
|
||||
}
|
||||
}
|
||||
if (!loop)
|
||||
goto done;
|
||||
break;
|
||||
default:
|
||||
printf("Unknown nested nla_type %d\n", na->nla_type);
|
||||
break;
|
||||
}
|
||||
len2 += NLA_ALIGN(na->nla_len);
|
||||
na = (struct nlattr *) ((char *) na + len2);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Unknown nla_type %d\n", na->nla_type);
|
||||
break;
|
||||
}
|
||||
na = (struct nlattr *) (GENLMSG_DATA(&msg) + len);
|
||||
}
|
||||
} while (loop);
|
||||
done:
|
||||
if (maskset) {
|
||||
rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
|
||||
TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
|
||||
&cpumask, sizeof(cpumask));
|
||||
printf("Sent deregister mask, retval %d\n", rc);
|
||||
if (rc < 0)
|
||||
err(rc, "error sending deregister cpumask\n");
|
||||
}
|
||||
err:
|
||||
close(nl_sd);
|
||||
if (fd)
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
181
Documentation/accounting/taskstats.txt
Normal file
181
Documentation/accounting/taskstats.txt
Normal file
@@ -0,0 +1,181 @@
|
||||
Per-task statistics interface
|
||||
-----------------------------
|
||||
|
||||
|
||||
Taskstats is a netlink-based interface for sending per-task and
|
||||
per-process statistics from the kernel to userspace.
|
||||
|
||||
Taskstats was designed for the following benefits:
|
||||
|
||||
- efficiently provide statistics during lifetime of a task and on its exit
|
||||
- unified interface for multiple accounting subsystems
|
||||
- extensibility for use by future accounting patches
|
||||
|
||||
Terminology
|
||||
-----------
|
||||
|
||||
"pid", "tid" and "task" are used interchangeably and refer to the standard
|
||||
Linux task defined by struct task_struct. per-pid stats are the same as
|
||||
per-task stats.
|
||||
|
||||
"tgid", "process" and "thread group" are used interchangeably and refer to the
|
||||
tasks that share an mm_struct i.e. the traditional Unix process. Despite the
|
||||
use of tgid, there is no special treatment for the task that is thread group
|
||||
leader - a process is deemed alive as long as it has any task belonging to it.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
To get statistics during a task's lifetime, userspace opens a unicast netlink
|
||||
socket (NETLINK_GENERIC family) and sends commands specifying a pid or a tgid.
|
||||
The response contains statistics for a task (if pid is specified) or the sum of
|
||||
statistics for all tasks of the process (if tgid is specified).
|
||||
|
||||
To obtain statistics for tasks which are exiting, the userspace listener
|
||||
sends a register command and specifies a cpumask. Whenever a task exits on
|
||||
one of the cpus in the cpumask, its per-pid statistics are sent to the
|
||||
registered listener. Using cpumasks allows the data received by one listener
|
||||
to be limited and assists in flow control over the netlink interface and is
|
||||
explained in more detail below.
|
||||
|
||||
If the exiting task is the last thread exiting its thread group,
|
||||
an additional record containing the per-tgid stats is also sent to userspace.
|
||||
The latter contains the sum of per-pid stats for all threads in the thread
|
||||
group, both past and present.
|
||||
|
||||
getdelays.c is a simple utility demonstrating usage of the taskstats interface
|
||||
for reporting delay accounting statistics. Users can register cpumasks,
|
||||
send commands and process responses, listen for per-tid/tgid exit data,
|
||||
write the data received to a file and do basic flow control by increasing
|
||||
receive buffer sizes.
|
||||
|
||||
Interface
|
||||
---------
|
||||
|
||||
The user-kernel interface is encapsulated in include/linux/taskstats.h
|
||||
|
||||
To avoid this documentation becoming obsolete as the interface evolves, only
|
||||
an outline of the current version is given. taskstats.h always overrides the
|
||||
description here.
|
||||
|
||||
struct taskstats is the common accounting structure for both per-pid and
|
||||
per-tgid data. It is versioned and can be extended by each accounting subsystem
|
||||
that is added to the kernel. The fields and their semantics are defined in the
|
||||
taskstats.h file.
|
||||
|
||||
The data exchanged between user and kernel space is a netlink message belonging
|
||||
to the NETLINK_GENERIC family and using the netlink attributes interface.
|
||||
The messages are in the format
|
||||
|
||||
+----------+- - -+-------------+-------------------+
|
||||
| nlmsghdr | Pad | genlmsghdr | taskstats payload |
|
||||
+----------+- - -+-------------+-------------------+
|
||||
|
||||
|
||||
The taskstats payload is one of the following three kinds:
|
||||
|
||||
1. Commands: Sent from user to kernel. Commands to get data on
|
||||
a pid/tgid consist of one attribute, of type TASKSTATS_CMD_ATTR_PID/TGID,
|
||||
containing a u32 pid or tgid in the attribute payload. The pid/tgid denotes
|
||||
the task/process for which userspace wants statistics.
|
||||
|
||||
Commands to register/deregister interest in exit data from a set of cpus
|
||||
consist of one attribute, of type
|
||||
TASKSTATS_CMD_ATTR_REGISTER/DEREGISTER_CPUMASK and contain a cpumask in the
|
||||
attribute payload. The cpumask is specified as an ascii string of
|
||||
comma-separated cpu ranges e.g. to listen to exit data from cpus 1,2,3,5,7,8
|
||||
the cpumask would be "1-3,5,7-8". If userspace forgets to deregister interest
|
||||
in cpus before closing the listening socket, the kernel cleans up its interest
|
||||
set over time. However, for the sake of efficiency, an explicit deregistration
|
||||
is advisable.
|
||||
|
||||
2. Response for a command: sent from the kernel in response to a userspace
|
||||
command. The payload is a series of three attributes of type:
|
||||
|
||||
a) TASKSTATS_TYPE_AGGR_PID/TGID : attribute containing no payload but indicates
|
||||
a pid/tgid will be followed by some stats.
|
||||
|
||||
b) TASKSTATS_TYPE_PID/TGID: attribute whose payload is the pid/tgid whose stats
|
||||
is being returned.
|
||||
|
||||
c) TASKSTATS_TYPE_STATS: attribute with a struct taskstsats as payload. The
|
||||
same structure is used for both per-pid and per-tgid stats.
|
||||
|
||||
3. New message sent by kernel whenever a task exits. The payload consists of a
|
||||
series of attributes of the following type:
|
||||
|
||||
a) TASKSTATS_TYPE_AGGR_PID: indicates next two attributes will be pid+stats
|
||||
b) TASKSTATS_TYPE_PID: contains exiting task's pid
|
||||
c) TASKSTATS_TYPE_STATS: contains the exiting task's per-pid stats
|
||||
d) TASKSTATS_TYPE_AGGR_TGID: indicates next two attributes will be tgid+stats
|
||||
e) TASKSTATS_TYPE_TGID: contains tgid of process to which task belongs
|
||||
f) TASKSTATS_TYPE_STATS: contains the per-tgid stats for exiting task's process
|
||||
|
||||
|
||||
per-tgid stats
|
||||
--------------
|
||||
|
||||
Taskstats provides per-process stats, in addition to per-task stats, since
|
||||
resource management is often done at a process granularity and aggregating task
|
||||
stats in userspace alone is inefficient and potentially inaccurate (due to lack
|
||||
of atomicity).
|
||||
|
||||
However, maintaining per-process, in addition to per-task stats, within the
|
||||
kernel has space and time overheads. To address this, the taskstats code
|
||||
accumalates each exiting task's statistics into a process-wide data structure.
|
||||
When the last task of a process exits, the process level data accumalated also
|
||||
gets sent to userspace (along with the per-task data).
|
||||
|
||||
When a user queries to get per-tgid data, the sum of all other live threads in
|
||||
the group is added up and added to the accumalated total for previously exited
|
||||
threads of the same thread group.
|
||||
|
||||
Extending taskstats
|
||||
-------------------
|
||||
|
||||
There are two ways to extend the taskstats interface to export more
|
||||
per-task/process stats as patches to collect them get added to the kernel
|
||||
in future:
|
||||
|
||||
1. Adding more fields to the end of the existing struct taskstats. Backward
|
||||
compatibility is ensured by the version number within the
|
||||
structure. Userspace will use only the fields of the struct that correspond
|
||||
to the version its using.
|
||||
|
||||
2. Defining separate statistic structs and using the netlink attributes
|
||||
interface to return them. Since userspace processes each netlink attribute
|
||||
independently, it can always ignore attributes whose type it does not
|
||||
understand (because it is using an older version of the interface).
|
||||
|
||||
|
||||
Choosing between 1. and 2. is a matter of trading off flexibility and
|
||||
overhead. If only a few fields need to be added, then 1. is the preferable
|
||||
path since the kernel and userspace don't need to incur the overhead of
|
||||
processing new netlink attributes. But if the new fields expand the existing
|
||||
struct too much, requiring disparate userspace accounting utilities to
|
||||
unnecessarily receive large structures whose fields are of no interest, then
|
||||
extending the attributes structure would be worthwhile.
|
||||
|
||||
Flow control for taskstats
|
||||
--------------------------
|
||||
|
||||
When the rate of task exits becomes large, a listener may not be able to keep
|
||||
up with the kernel's rate of sending per-tid/tgid exit data leading to data
|
||||
loss. This possibility gets compounded when the taskstats structure gets
|
||||
extended and the number of cpus grows large.
|
||||
|
||||
To avoid losing statistics, userspace should do one or more of the following:
|
||||
|
||||
- increase the receive buffer sizes for the netlink sockets opened by
|
||||
listeners to receive exit data.
|
||||
|
||||
- create more listeners and reduce the number of cpus being listened to by
|
||||
each listener. In the extreme case, there could be one listener for each cpu.
|
||||
Users may also consider setting the cpu affinity of the listener to the subset
|
||||
of cpus to which it listens, especially if they are listening to just one cpu.
|
||||
|
||||
Despite these measures, if the userspace receives ENOBUFS error messages
|
||||
indicated overflow of receive buffers, it should take measures to handle the
|
||||
loss of data.
|
||||
|
||||
----
|
||||
@@ -20,6 +20,7 @@ This driver is known to work with the following cards:
|
||||
* SA P400i
|
||||
* SA E200
|
||||
* SA E200i
|
||||
* SA E500
|
||||
|
||||
If nodes are not already created in the /dev/cciss directory, run as root:
|
||||
|
||||
|
||||
206
Documentation/connector/ucon.c
Normal file
206
Documentation/connector/ucon.c
Normal file
@@ -0,0 +1,206 @@
|
||||
/*
|
||||
* ucon.c
|
||||
*
|
||||
* Copyright (c) 2004+ Evgeniy Polyakov <johnpol@2ka.mipt.ru>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/poll.h>
|
||||
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <linux/connector.h>
|
||||
|
||||
#define DEBUG
|
||||
#define NETLINK_CONNECTOR 11
|
||||
|
||||
#ifdef DEBUG
|
||||
#define ulog(f, a...) fprintf(stdout, f, ##a)
|
||||
#else
|
||||
#define ulog(f, a...) do {} while (0)
|
||||
#endif
|
||||
|
||||
static int need_exit;
|
||||
static __u32 seq;
|
||||
|
||||
static int netlink_send(int s, struct cn_msg *msg)
|
||||
{
|
||||
struct nlmsghdr *nlh;
|
||||
unsigned int size;
|
||||
int err;
|
||||
char buf[128];
|
||||
struct cn_msg *m;
|
||||
|
||||
size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len);
|
||||
|
||||
nlh = (struct nlmsghdr *)buf;
|
||||
nlh->nlmsg_seq = seq++;
|
||||
nlh->nlmsg_pid = getpid();
|
||||
nlh->nlmsg_type = NLMSG_DONE;
|
||||
nlh->nlmsg_len = NLMSG_LENGTH(size - sizeof(*nlh));
|
||||
nlh->nlmsg_flags = 0;
|
||||
|
||||
m = NLMSG_DATA(nlh);
|
||||
#if 0
|
||||
ulog("%s: [%08x.%08x] len=%u, seq=%u, ack=%u.\n",
|
||||
__func__, msg->id.idx, msg->id.val, msg->len, msg->seq, msg->ack);
|
||||
#endif
|
||||
memcpy(m, msg, sizeof(*m) + msg->len);
|
||||
|
||||
err = send(s, nlh, size, 0);
|
||||
if (err == -1)
|
||||
ulog("Failed to send: %s [%d].\n",
|
||||
strerror(errno), errno);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int s;
|
||||
char buf[1024];
|
||||
int len;
|
||||
struct nlmsghdr *reply;
|
||||
struct sockaddr_nl l_local;
|
||||
struct cn_msg *data;
|
||||
FILE *out;
|
||||
time_t tm;
|
||||
struct pollfd pfd;
|
||||
|
||||
if (argc < 2)
|
||||
out = stdout;
|
||||
else {
|
||||
out = fopen(argv[1], "a+");
|
||||
if (!out) {
|
||||
ulog("Unable to open %s for writing: %s\n",
|
||||
argv[1], strerror(errno));
|
||||
out = stdout;
|
||||
}
|
||||
}
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
|
||||
if (s == -1) {
|
||||
perror("socket");
|
||||
return -1;
|
||||
}
|
||||
|
||||
l_local.nl_family = AF_NETLINK;
|
||||
l_local.nl_groups = 0x123; /* bitmask of requested groups */
|
||||
l_local.nl_pid = 0;
|
||||
|
||||
if (bind(s, (struct sockaddr *)&l_local, sizeof(struct sockaddr_nl)) == -1) {
|
||||
perror("bind");
|
||||
close(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
{
|
||||
int on = 0x57; /* Additional group number */
|
||||
setsockopt(s, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &on, sizeof(on));
|
||||
}
|
||||
#endif
|
||||
if (0) {
|
||||
int i, j;
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
data = (struct cn_msg *)buf;
|
||||
|
||||
data->id.idx = 0x123;
|
||||
data->id.val = 0x456;
|
||||
data->seq = seq++;
|
||||
data->ack = 0;
|
||||
data->len = 0;
|
||||
|
||||
for (j=0; j<10; ++j) {
|
||||
for (i=0; i<1000; ++i) {
|
||||
len = netlink_send(s, data);
|
||||
}
|
||||
|
||||
ulog("%d messages have been sent to %08x.%08x.\n", i, data->id.idx, data->id.val);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
pfd.fd = s;
|
||||
|
||||
while (!need_exit) {
|
||||
pfd.events = POLLIN;
|
||||
pfd.revents = 0;
|
||||
switch (poll(&pfd, 1, -1)) {
|
||||
case 0:
|
||||
need_exit = 1;
|
||||
break;
|
||||
case -1:
|
||||
if (errno != EINTR) {
|
||||
need_exit = 1;
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (need_exit)
|
||||
break;
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
len = recv(s, buf, sizeof(buf), 0);
|
||||
if (len == -1) {
|
||||
perror("recv buf");
|
||||
close(s);
|
||||
return -1;
|
||||
}
|
||||
reply = (struct nlmsghdr *)buf;
|
||||
|
||||
switch (reply->nlmsg_type) {
|
||||
case NLMSG_ERROR:
|
||||
fprintf(out, "Error message received.\n");
|
||||
fflush(out);
|
||||
break;
|
||||
case NLMSG_DONE:
|
||||
data = (struct cn_msg *)NLMSG_DATA(reply);
|
||||
|
||||
time(&tm);
|
||||
fprintf(out, "%.24s : [%x.%x] [%08u.%08u].\n",
|
||||
ctime(&tm), data->id.idx, data->id.val, data->seq, data->ack);
|
||||
fflush(out);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
close(s);
|
||||
return 0;
|
||||
}
|
||||
@@ -153,10 +153,13 @@ scaling_governor, and by "echoing" the name of another
|
||||
that some governors won't load - they only
|
||||
work on some specific architectures or
|
||||
processors.
|
||||
scaling_min_freq and
|
||||
scaling_min_freq and
|
||||
scaling_max_freq show the current "policy limits" (in
|
||||
kHz). By echoing new values into these
|
||||
files, you can change these limits.
|
||||
NOTE: when setting a policy you need to
|
||||
first set scaling_max_freq, then
|
||||
scaling_min_freq.
|
||||
|
||||
|
||||
If you have selected the "userspace" governor which allows you to
|
||||
|
||||
@@ -251,16 +251,24 @@ A: This is what you would need in your kernel code to receive notifications.
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static struct notifier_block foobar_cpu_notifer =
|
||||
static struct notifier_block __cpuinitdata foobar_cpu_notifer =
|
||||
{
|
||||
.notifier_call = foobar_cpu_callback,
|
||||
};
|
||||
|
||||
You need to call register_cpu_notifier() from your init function.
|
||||
Init functions could be of two types:
|
||||
1. early init (init function called when only the boot processor is online).
|
||||
2. late init (init function called _after_ all the CPUs are online).
|
||||
|
||||
In your init function,
|
||||
For the first case, you should add the following to your init function
|
||||
|
||||
register_cpu_notifier(&foobar_cpu_notifier);
|
||||
|
||||
For the second case, you should add the following to your init function
|
||||
|
||||
register_hotcpu_notifier(&foobar_cpu_notifier);
|
||||
|
||||
You can fail PREPARE notifiers if something doesn't work to prepare resources.
|
||||
This will stop the activity and send a following CANCELED event back.
|
||||
|
||||
|
||||
@@ -217,6 +217,12 @@ exclusive cpuset. Also, the use of a Linux virtual file system (vfs)
|
||||
to represent the cpuset hierarchy provides for a familiar permission
|
||||
and name space for cpusets, with a minimum of additional kernel code.
|
||||
|
||||
The cpus file in the root (top_cpuset) cpuset is read-only.
|
||||
It automatically tracks the value of cpu_online_map, using a CPU
|
||||
hotplug notifier. If and when memory nodes can be hotplugged,
|
||||
we expect to make the mems file in the root cpuset read-only
|
||||
as well, and have it track the value of node_online_map.
|
||||
|
||||
|
||||
1.4 What are exclusive cpusets ?
|
||||
--------------------------------
|
||||
|
||||
@@ -2565,10 +2565,10 @@ Your cooperation is appreciated.
|
||||
243 = /dev/usb/dabusb3 Fourth dabusb device
|
||||
|
||||
180 block USB block devices
|
||||
0 = /dev/uba First USB block device
|
||||
8 = /dev/ubb Second USB block device
|
||||
16 = /dev/ubc Thrid USB block device
|
||||
...
|
||||
0 = /dev/uba First USB block device
|
||||
8 = /dev/ubb Second USB block device
|
||||
16 = /dev/ubc Third USB block device
|
||||
...
|
||||
|
||||
181 char Conrad Electronic parallel port radio clocks
|
||||
0 = /dev/pcfclock0 First Conrad radio clock
|
||||
|
||||
@@ -35,15 +35,14 @@ the vendor should tie the parity status bits to 0 if they do not intend
|
||||
to generate parity. Some vendors do not do this, and thus the parity bit
|
||||
can "float" giving false positives.
|
||||
|
||||
The PCI Parity EDAC device has the ability to "skip" known flaky
|
||||
cards during the parity scan. These are set by the parity "blacklist"
|
||||
interface in the sysfs for PCI Parity. (See the PCI section in the sysfs
|
||||
section below.) There is also a parity "whitelist" which is used as
|
||||
an explicit list of devices to scan, while the blacklist is a list
|
||||
of devices to skip.
|
||||
[There are patches in the kernel queue which will allow for storage of
|
||||
quirks of PCI devices reporting false parity positives. The 2.6.18
|
||||
kernel should have those patches included. When that becomes available,
|
||||
then EDAC will be patched to utilize that information to "skip" such
|
||||
devices.]
|
||||
|
||||
EDAC will have future error detectors that will be added or integrated
|
||||
into EDAC in the following list:
|
||||
EDAC will have future error detectors that will be integrated with
|
||||
EDAC or added to it, in the following list:
|
||||
|
||||
MCE Machine Check Exception
|
||||
MCA Machine Check Architecture
|
||||
@@ -93,22 +92,24 @@ EDAC lives in the /sys/devices/system/edac directory. Within this directory
|
||||
there currently reside 2 'edac' components:
|
||||
|
||||
mc memory controller(s) system
|
||||
pci PCI status system
|
||||
pci PCI control and status system
|
||||
|
||||
|
||||
============================================================================
|
||||
Memory Controller (mc) Model
|
||||
|
||||
First a background on the memory controller's model abstracted in EDAC.
|
||||
Each mc device controls a set of DIMM memory modules. These modules are
|
||||
Each 'mc' device controls a set of DIMM memory modules. These modules are
|
||||
laid out in a Chip-Select Row (csrowX) and Channel table (chX). There can
|
||||
be multiple csrows and two channels.
|
||||
be multiple csrows and multiple channels.
|
||||
|
||||
Memory controllers allow for several csrows, with 8 csrows being a typical value.
|
||||
Yet, the actual number of csrows depends on the electrical "loading"
|
||||
of a given motherboard, memory controller and DIMM characteristics.
|
||||
|
||||
Dual channels allows for 128 bit data transfers to the CPU from memory.
|
||||
Some newer chipsets allow for more than 2 channels, like Fully Buffered DIMMs
|
||||
(FB-DIMMs). The following example will assume 2 channels:
|
||||
|
||||
|
||||
Channel 0 Channel 1
|
||||
@@ -234,23 +235,15 @@ Polling period control file:
|
||||
The time period, in milliseconds, for polling for error information.
|
||||
Too small a value wastes resources. Too large a value might delay
|
||||
necessary handling of errors and might loose valuable information for
|
||||
locating the error. 1000 milliseconds (once each second) is about
|
||||
right for most uses.
|
||||
locating the error. 1000 milliseconds (once each second) is the current
|
||||
default. Systems which require all the bandwidth they can get, may
|
||||
increase this.
|
||||
|
||||
LOAD TIME: module/kernel parameter: poll_msec=[0|1]
|
||||
|
||||
RUN TIME: echo "1000" >/sys/devices/system/edac/mc/poll_msec
|
||||
|
||||
|
||||
Module Version read-only attribute file:
|
||||
|
||||
'mc_version'
|
||||
|
||||
The EDAC CORE module's version and compile date are shown here to
|
||||
indicate what EDAC is running.
|
||||
|
||||
|
||||
|
||||
============================================================================
|
||||
'mcX' DIRECTORIES
|
||||
|
||||
@@ -284,35 +277,6 @@ Seconds since last counter reset control file:
|
||||
|
||||
|
||||
|
||||
DIMM capability attribute file:
|
||||
|
||||
'edac_capability'
|
||||
|
||||
The EDAC (Error Detection and Correction) capabilities/modes of
|
||||
the memory controller hardware.
|
||||
|
||||
|
||||
DIMM Current Capability attribute file:
|
||||
|
||||
'edac_current_capability'
|
||||
|
||||
The EDAC capabilities available with the hardware
|
||||
configuration. This may not be the same as "EDAC capability"
|
||||
if the correct memory is not used. If a memory controller is
|
||||
capable of EDAC, but DIMMs without check bits are in use, then
|
||||
Parity, SECDED, S4ECD4ED capabilities will not be available
|
||||
even though the memory controller might be capable of those
|
||||
modes with the proper memory loaded.
|
||||
|
||||
|
||||
Memory Type supported on this controller attribute file:
|
||||
|
||||
'supported_mem_type'
|
||||
|
||||
This attribute file displays the memory type, usually
|
||||
buffered and unbuffered DIMMs.
|
||||
|
||||
|
||||
Memory Controller name attribute file:
|
||||
|
||||
'mc_name'
|
||||
@@ -321,16 +285,6 @@ Memory Controller name attribute file:
|
||||
that is being utilized.
|
||||
|
||||
|
||||
Memory Controller Module name attribute file:
|
||||
|
||||
'module_name'
|
||||
|
||||
This attribute file displays the memory controller module name,
|
||||
version and date built. The name of the memory controller
|
||||
hardware - some drivers work with multiple controllers and
|
||||
this field shows which hardware is present.
|
||||
|
||||
|
||||
Total memory managed by this memory controller attribute file:
|
||||
|
||||
'size_mb'
|
||||
@@ -432,6 +386,9 @@ Memory Type attribute file:
|
||||
|
||||
This attribute file will display what type of memory is currently
|
||||
on this csrow. Normally, either buffered or unbuffered memory.
|
||||
Examples:
|
||||
Registered-DDR
|
||||
Unbuffered-DDR
|
||||
|
||||
|
||||
EDAC Mode of operation attribute file:
|
||||
@@ -446,8 +403,13 @@ Device type attribute file:
|
||||
|
||||
'dev_type'
|
||||
|
||||
This attribute file will display what type of DIMM device is
|
||||
being utilized. Example: x4
|
||||
This attribute file will display what type of DRAM device is
|
||||
being utilized on this DIMM.
|
||||
Examples:
|
||||
x1
|
||||
x2
|
||||
x4
|
||||
x8
|
||||
|
||||
|
||||
Channel 0 CE Count attribute file:
|
||||
@@ -522,10 +484,10 @@ SYSTEM LOGGING
|
||||
If logging for UEs and CEs are enabled then system logs will have
|
||||
error notices indicating errors that have been detected:
|
||||
|
||||
MC0: CE page 0x283, offset 0xce0, grain 8, syndrome 0x6ec3, row 0,
|
||||
EDAC MC0: CE page 0x283, offset 0xce0, grain 8, syndrome 0x6ec3, row 0,
|
||||
channel 1 "DIMM_B1": amd76x_edac
|
||||
|
||||
MC0: CE page 0x1e5, offset 0xfb0, grain 8, syndrome 0xb741, row 0,
|
||||
EDAC MC0: CE page 0x1e5, offset 0xfb0, grain 8, syndrome 0xb741, row 0,
|
||||
channel 1 "DIMM_B1": amd76x_edac
|
||||
|
||||
|
||||
@@ -610,64 +572,4 @@ Parity Count:
|
||||
|
||||
|
||||
|
||||
PCI Device Whitelist:
|
||||
|
||||
'pci_parity_whitelist'
|
||||
|
||||
This control file allows for an explicit list of PCI devices to be
|
||||
scanned for parity errors. Only devices found on this list will
|
||||
be examined. The list is a line of hexadecimal VENDOR and DEVICE
|
||||
ID tuples:
|
||||
|
||||
1022:7450,1434:16a6
|
||||
|
||||
One or more can be inserted, separated by a comma.
|
||||
|
||||
To write the above list doing the following as one command line:
|
||||
|
||||
echo "1022:7450,1434:16a6"
|
||||
> /sys/devices/system/edac/pci/pci_parity_whitelist
|
||||
|
||||
|
||||
|
||||
To display what the whitelist is, simply 'cat' the same file.
|
||||
|
||||
|
||||
PCI Device Blacklist:
|
||||
|
||||
'pci_parity_blacklist'
|
||||
|
||||
This control file allows for a list of PCI devices to be
|
||||
skipped for scanning.
|
||||
The list is a line of hexadecimal VENDOR and DEVICE ID tuples:
|
||||
|
||||
1022:7450,1434:16a6
|
||||
|
||||
One or more can be inserted, separated by a comma.
|
||||
|
||||
To write the above list doing the following as one command line:
|
||||
|
||||
echo "1022:7450,1434:16a6"
|
||||
> /sys/devices/system/edac/pci/pci_parity_blacklist
|
||||
|
||||
|
||||
To display what the whitelist currently contains,
|
||||
simply 'cat' the same file.
|
||||
|
||||
=======================================================================
|
||||
|
||||
PCI Vendor and Devices IDs can be obtained with the lspci command. Using
|
||||
the -n option lspci will display the vendor and device IDs. The system
|
||||
administrator will have to determine which devices should be scanned or
|
||||
skipped.
|
||||
|
||||
|
||||
|
||||
The two lists (white and black) are prioritized. blacklist is the lower
|
||||
priority and will NOT be utilized when a whitelist has been set.
|
||||
Turn OFF a whitelist by an empty echo command:
|
||||
|
||||
echo > /sys/devices/system/edac/pci/pci_parity_whitelist
|
||||
|
||||
and any previous blacklist will be utilized.
|
||||
|
||||
|
||||
31
Documentation/fb/imacfb.txt
Normal file
31
Documentation/fb/imacfb.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
What is imacfb?
|
||||
===============
|
||||
|
||||
This is a generic EFI platform driver for Intel based Apple computers.
|
||||
Imacfb is only for EFI booted Intel Macs.
|
||||
|
||||
Supported Hardware
|
||||
==================
|
||||
|
||||
iMac 17"/20"
|
||||
Macbook
|
||||
Macbook Pro 15"/17"
|
||||
MacMini
|
||||
|
||||
How to use it?
|
||||
==============
|
||||
|
||||
Imacfb does not have any kind of autodetection of your machine.
|
||||
You have to add the fillowing kernel parameters in your elilo.conf:
|
||||
Macbook :
|
||||
video=imacfb:macbook
|
||||
MacMini :
|
||||
video=imacfb:mini
|
||||
Macbook Pro 15", iMac 17" :
|
||||
video=imacfb:i17
|
||||
Macbook Pro 17", iMac 20" :
|
||||
video=imacfb:i20
|
||||
|
||||
--
|
||||
Edgar Hucek <gimli@dark-green.com>
|
||||
@@ -55,14 +55,6 @@ Who: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: remove EXPORT_SYMBOL(insert_resource)
|
||||
When: April 2006
|
||||
Files: kernel/resource.c
|
||||
Why: No modular usage in the kernel.
|
||||
Who: Adrian Bunk <bunk@stusta.de>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl])
|
||||
When: November 2005
|
||||
Files: drivers/pcmcia/: pcmcia_ioctl.c
|
||||
@@ -128,6 +120,13 @@ Who: Adrian Bunk <bunk@stusta.de>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: drivers depending on OSS_OBSOLETE_DRIVER
|
||||
When: options in 2.6.20, code in 2.6.22
|
||||
Why: OSS drivers with ALSA replacements
|
||||
Who: Adrian Bunk <bunk@stusta.de>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: pci_module_init(driver)
|
||||
When: January 2007
|
||||
Why: Is replaced by pci_register_driver(pci_driver).
|
||||
@@ -166,17 +165,6 @@ Who: Arjan van de Ven <arjan@linux.intel.com>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: remove EXPORT_SYMBOL(tasklist_lock)
|
||||
When: August 2006
|
||||
Files: kernel/fork.c
|
||||
Why: tasklist_lock protects the kernel internal task list. Modules have
|
||||
no business looking at it, and all instances in drivers have been due
|
||||
to use of too-lowlevel APIs. Having this symbol exported prevents
|
||||
moving to more scalable locking schemes for the task list.
|
||||
Who: Christoph Hellwig <hch@lst.de>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: mount/umount uevents
|
||||
When: February 2007
|
||||
Why: These events are not correct, and do not properly let userspace know
|
||||
@@ -266,3 +254,43 @@ Why: The interrupt related SA_* flags are replaced by IRQF_* to move them
|
||||
Who: Thomas Gleixner <tglx@linutronix.de>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: i2c-ite and i2c-algo-ite drivers
|
||||
When: September 2006
|
||||
Why: These drivers never compiled since they were added to the kernel
|
||||
tree 5 years ago. This feature removal can be reevaluated if
|
||||
someone shows interest in the drivers, fixes them and takes over
|
||||
maintenance.
|
||||
http://marc.theaimsgroup.com/?l=linux-mips&m=115040510817448
|
||||
Who: Jean Delvare <khali@linux-fr.org>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: Bridge netfilter deferred IPv4/IPv6 output hook calling
|
||||
When: January 2007
|
||||
Why: The deferred output hooks are a layering violation causing unusual
|
||||
and broken behaviour on bridge devices. Examples of things they
|
||||
break include QoS classifation using the MARK or CLASSIFY targets,
|
||||
the IPsec policy match and connection tracking with VLANs on a
|
||||
bridge. Their only use is to enable bridge output port filtering
|
||||
within iptables with the physdev match, which can also be done by
|
||||
combining iptables and ebtables using netfilter marks. Until it
|
||||
will get removed the hook deferral is disabled by default and is
|
||||
only enabled when needed.
|
||||
|
||||
Who: Patrick McHardy <kaber@trash.net>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: frame diverter
|
||||
When: November 2006
|
||||
Why: The frame diverter is included in most distribution kernels, but is
|
||||
broken. It does not correctly handle many things:
|
||||
- IPV6
|
||||
- non-linear skb's
|
||||
- network device RCU on removal
|
||||
- input frames not correctly checked for protocol errors
|
||||
It also adds allocation overhead even if not enabled.
|
||||
It is not clear if anyone is still using it.
|
||||
Who: Stephen Hemminger <shemminger@osdl.org>
|
||||
|
||||
|
||||
@@ -62,8 +62,8 @@ ramfs-rootfs-initramfs.txt
|
||||
- info on the 'in memory' filesystems ramfs, rootfs and initramfs.
|
||||
reiser4.txt
|
||||
- info on the Reiser4 filesystem based on dancing tree algorithms.
|
||||
relayfs.txt
|
||||
- info on relayfs, for efficient streaming from kernel to user space.
|
||||
relay.txt
|
||||
- info on relay, for efficient streaming from kernel to user space.
|
||||
romfs.txt
|
||||
- description of the ROMFS filesystem.
|
||||
smbfs.txt
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user