Merge branch 'proc' of git://git.kernel.org/pub/scm/linux/kernel/git/adobriyan/proc
* 'proc' of git://git.kernel.org/pub/scm/linux/kernel/git/adobriyan/proc: proc: remove kernel.maps_protect proc: remove now unneeded ADDBUF macro [PATCH] proc: show personality via /proc/pid/personality [PATCH] signal, procfs: some lock_task_sighand() users do not need rcu_read_lock() proc: move PROC_PAGE_MONITOR to fs/proc/Kconfig proc: make grab_header() static proc: remove unused get_dma_list() proc: remove dummy vmcore_open() proc: proc_sys_root tweak proc: fix return value of proc_reg_open() in "too late" case Fixed up trivial conflict in removed file arch/sparc/include/asm/dma_32.h
This commit is contained in:
commit
20272c8994
|
@ -1331,13 +1331,6 @@ determine whether or not they are still functioning properly.
|
||||||
Because the NMI watchdog shares registers with oprofile, by disabling the NMI
|
Because the NMI watchdog shares registers with oprofile, by disabling the NMI
|
||||||
watchdog, oprofile may have more registers to utilize.
|
watchdog, oprofile may have more registers to utilize.
|
||||||
|
|
||||||
maps_protect
|
|
||||||
------------
|
|
||||||
|
|
||||||
Enables/Disables the protection of the per-process proc entries "maps" and
|
|
||||||
"smaps". When enabled, the contents of these files are visible only to
|
|
||||||
readers that are allowed to ptrace() the given process.
|
|
||||||
|
|
||||||
msgmni
|
msgmni
|
||||||
------
|
------
|
||||||
|
|
||||||
|
|
|
@ -25,23 +25,6 @@ EXPORT_SYMBOL(dma_spin_lock);
|
||||||
|
|
||||||
static dma_t dma_chan[MAX_DMA_CHANNELS];
|
static dma_t dma_chan[MAX_DMA_CHANNELS];
|
||||||
|
|
||||||
/*
|
|
||||||
* Get dma list for /proc/dma
|
|
||||||
*/
|
|
||||||
int get_dma_list(char *buf)
|
|
||||||
{
|
|
||||||
dma_t *dma;
|
|
||||||
char *p = buf;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0, dma = dma_chan; i < MAX_DMA_CHANNELS; i++, dma++)
|
|
||||||
if (dma->lock)
|
|
||||||
p += sprintf(p, "%2d: %14s %s\n", i,
|
|
||||||
dma->d_ops->type, dma->device_id);
|
|
||||||
|
|
||||||
return p - buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Request DMA channel
|
* Request DMA channel
|
||||||
*
|
*
|
||||||
|
|
|
@ -57,3 +57,13 @@ config PROC_SYSCTL
|
||||||
As it is generally a good thing, you should say Y here unless
|
As it is generally a good thing, you should say Y here unless
|
||||||
building a kernel for install/rescue disks or your system is very
|
building a kernel for install/rescue disks or your system is very
|
||||||
limited in memory.
|
limited in memory.
|
||||||
|
|
||||||
|
config PROC_PAGE_MONITOR
|
||||||
|
default y
|
||||||
|
depends on PROC_FS && MMU
|
||||||
|
bool "Enable /proc page monitoring" if EMBEDDED
|
||||||
|
help
|
||||||
|
Various /proc files exist to monitor process memory utilization:
|
||||||
|
/proc/pid/smaps, /proc/pid/clear_refs, /proc/pid/pagemap,
|
||||||
|
/proc/kpagecount, and /proc/kpageflags. Disabling these
|
||||||
|
interfaces will reduce the size of the kernel by approximately 4kb.
|
||||||
|
|
|
@ -86,11 +86,6 @@
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
/* Gcc optimizes away "strlen(x)" for constant x */
|
|
||||||
#define ADDBUF(buffer, string) \
|
|
||||||
do { memcpy(buffer, string, strlen(string)); \
|
|
||||||
buffer += strlen(string); } while (0)
|
|
||||||
|
|
||||||
static inline void task_name(struct seq_file *m, struct task_struct *p)
|
static inline void task_name(struct seq_file *m, struct task_struct *p)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -261,7 +256,6 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p)
|
||||||
sigemptyset(&ignored);
|
sigemptyset(&ignored);
|
||||||
sigemptyset(&caught);
|
sigemptyset(&caught);
|
||||||
|
|
||||||
rcu_read_lock();
|
|
||||||
if (lock_task_sighand(p, &flags)) {
|
if (lock_task_sighand(p, &flags)) {
|
||||||
pending = p->pending.signal;
|
pending = p->pending.signal;
|
||||||
shpending = p->signal->shared_pending.signal;
|
shpending = p->signal->shared_pending.signal;
|
||||||
|
@ -272,7 +266,6 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p)
|
||||||
qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur;
|
qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur;
|
||||||
unlock_task_sighand(p, &flags);
|
unlock_task_sighand(p, &flags);
|
||||||
}
|
}
|
||||||
rcu_read_unlock();
|
|
||||||
|
|
||||||
seq_printf(m, "Threads:\t%d\n", num_threads);
|
seq_printf(m, "Threads:\t%d\n", num_threads);
|
||||||
seq_printf(m, "SigQ:\t%lu/%lu\n", qsize, qlim);
|
seq_printf(m, "SigQ:\t%lu/%lu\n", qsize, qlim);
|
||||||
|
|
|
@ -148,9 +148,6 @@ static unsigned int pid_entry_count_dirs(const struct pid_entry *entries,
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int maps_protect;
|
|
||||||
EXPORT_SYMBOL(maps_protect);
|
|
||||||
|
|
||||||
static struct fs_struct *get_fs_struct(struct task_struct *task)
|
static struct fs_struct *get_fs_struct(struct task_struct *task)
|
||||||
{
|
{
|
||||||
struct fs_struct *fs;
|
struct fs_struct *fs;
|
||||||
|
@ -164,7 +161,6 @@ static struct fs_struct *get_fs_struct(struct task_struct *task)
|
||||||
|
|
||||||
static int get_nr_threads(struct task_struct *tsk)
|
static int get_nr_threads(struct task_struct *tsk)
|
||||||
{
|
{
|
||||||
/* Must be called with the rcu_read_lock held */
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
@ -471,14 +467,10 @@ static int proc_pid_limits(struct task_struct *task, char *buffer)
|
||||||
|
|
||||||
struct rlimit rlim[RLIM_NLIMITS];
|
struct rlimit rlim[RLIM_NLIMITS];
|
||||||
|
|
||||||
rcu_read_lock();
|
if (!lock_task_sighand(task, &flags))
|
||||||
if (!lock_task_sighand(task,&flags)) {
|
|
||||||
rcu_read_unlock();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
memcpy(rlim, task->signal->rlim, sizeof(struct rlimit) * RLIM_NLIMITS);
|
memcpy(rlim, task->signal->rlim, sizeof(struct rlimit) * RLIM_NLIMITS);
|
||||||
unlock_task_sighand(task, &flags);
|
unlock_task_sighand(task, &flags);
|
||||||
rcu_read_unlock();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* print the file header
|
* print the file header
|
||||||
|
@ -2443,6 +2435,13 @@ static int proc_tgid_io_accounting(struct task_struct *task, char *buffer)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_TASK_IO_ACCOUNTING */
|
#endif /* CONFIG_TASK_IO_ACCOUNTING */
|
||||||
|
|
||||||
|
static int proc_pid_personality(struct seq_file *m, struct pid_namespace *ns,
|
||||||
|
struct pid *pid, struct task_struct *task)
|
||||||
|
{
|
||||||
|
seq_printf(m, "%08x\n", task->personality);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Thread groups
|
* Thread groups
|
||||||
*/
|
*/
|
||||||
|
@ -2459,6 +2458,7 @@ static const struct pid_entry tgid_base_stuff[] = {
|
||||||
REG("environ", S_IRUSR, environ),
|
REG("environ", S_IRUSR, environ),
|
||||||
INF("auxv", S_IRUSR, pid_auxv),
|
INF("auxv", S_IRUSR, pid_auxv),
|
||||||
ONE("status", S_IRUGO, pid_status),
|
ONE("status", S_IRUGO, pid_status),
|
||||||
|
ONE("personality", S_IRUSR, pid_personality),
|
||||||
INF("limits", S_IRUSR, pid_limits),
|
INF("limits", S_IRUSR, pid_limits),
|
||||||
#ifdef CONFIG_SCHED_DEBUG
|
#ifdef CONFIG_SCHED_DEBUG
|
||||||
REG("sched", S_IRUGO|S_IWUSR, pid_sched),
|
REG("sched", S_IRUGO|S_IWUSR, pid_sched),
|
||||||
|
@ -2794,6 +2794,7 @@ static const struct pid_entry tid_base_stuff[] = {
|
||||||
REG("environ", S_IRUSR, environ),
|
REG("environ", S_IRUSR, environ),
|
||||||
INF("auxv", S_IRUSR, pid_auxv),
|
INF("auxv", S_IRUSR, pid_auxv),
|
||||||
ONE("status", S_IRUGO, pid_status),
|
ONE("status", S_IRUGO, pid_status),
|
||||||
|
ONE("personality", S_IRUSR, pid_personality),
|
||||||
INF("limits", S_IRUSR, pid_limits),
|
INF("limits", S_IRUSR, pid_limits),
|
||||||
#ifdef CONFIG_SCHED_DEBUG
|
#ifdef CONFIG_SCHED_DEBUG
|
||||||
REG("sched", S_IRUGO|S_IWUSR, pid_sched),
|
REG("sched", S_IRUGO|S_IWUSR, pid_sched),
|
||||||
|
@ -3088,9 +3089,7 @@ static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct
|
||||||
generic_fillattr(inode, stat);
|
generic_fillattr(inode, stat);
|
||||||
|
|
||||||
if (p) {
|
if (p) {
|
||||||
rcu_read_lock();
|
|
||||||
stat->nlink += get_nr_threads(p);
|
stat->nlink += get_nr_threads(p);
|
||||||
rcu_read_unlock();
|
|
||||||
put_task_struct(p);
|
put_task_struct(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,7 @@ static int proc_reg_open(struct inode *inode, struct file *file)
|
||||||
if (!pde->proc_fops) {
|
if (!pde->proc_fops) {
|
||||||
spin_unlock(&pde->pde_unload_lock);
|
spin_unlock(&pde->pde_unload_lock);
|
||||||
kfree(pdeo);
|
kfree(pdeo);
|
||||||
return rv;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
pde->pde_users++;
|
pde->pde_users++;
|
||||||
open = pde->proc_fops->open;
|
open = pde->proc_fops->open;
|
||||||
|
|
|
@ -45,8 +45,6 @@ do { \
|
||||||
extern int nommu_vma_show(struct seq_file *, struct vm_area_struct *);
|
extern int nommu_vma_show(struct seq_file *, struct vm_area_struct *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int maps_protect;
|
|
||||||
|
|
||||||
extern int proc_tid_stat(struct seq_file *m, struct pid_namespace *ns,
|
extern int proc_tid_stat(struct seq_file *m, struct pid_namespace *ns,
|
||||||
struct pid *pid, struct task_struct *task);
|
struct pid *pid, struct task_struct *task);
|
||||||
extern int proc_tgid_stat(struct seq_file *m, struct pid_namespace *ns,
|
extern int proc_tgid_stat(struct seq_file *m, struct pid_namespace *ns,
|
||||||
|
|
|
@ -68,7 +68,6 @@
|
||||||
extern int get_hardware_list(char *);
|
extern int get_hardware_list(char *);
|
||||||
extern int get_stram_list(char *);
|
extern int get_stram_list(char *);
|
||||||
extern int get_exec_domain_list(char *);
|
extern int get_exec_domain_list(char *);
|
||||||
extern int get_dma_list(char *);
|
|
||||||
|
|
||||||
static int proc_calc_metrics(char *page, char **start, off_t off,
|
static int proc_calc_metrics(char *page, char **start, off_t off,
|
||||||
int count, int *eof, int len)
|
int count, int *eof, int len)
|
||||||
|
|
|
@ -66,7 +66,7 @@ static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ctl_table_header *grab_header(struct inode *inode)
|
static struct ctl_table_header *grab_header(struct inode *inode)
|
||||||
{
|
{
|
||||||
if (PROC_I(inode)->sysctl)
|
if (PROC_I(inode)->sysctl)
|
||||||
return sysctl_head_grab(PROC_I(inode)->sysctl);
|
return sysctl_head_grab(PROC_I(inode)->sysctl);
|
||||||
|
@ -395,10 +395,10 @@ static struct dentry_operations proc_sys_dentry_operations = {
|
||||||
.d_compare = proc_sys_compare,
|
.d_compare = proc_sys_compare,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct proc_dir_entry *proc_sys_root;
|
|
||||||
|
|
||||||
int proc_sys_init(void)
|
int proc_sys_init(void)
|
||||||
{
|
{
|
||||||
|
struct proc_dir_entry *proc_sys_root;
|
||||||
|
|
||||||
proc_sys_root = proc_mkdir("sys", NULL);
|
proc_sys_root = proc_mkdir("sys", NULL);
|
||||||
proc_sys_root->proc_iops = &proc_sys_dir_operations;
|
proc_sys_root->proc_iops = &proc_sys_dir_operations;
|
||||||
proc_sys_root->proc_fops = &proc_sys_dir_file_operations;
|
proc_sys_root->proc_fops = &proc_sys_dir_file_operations;
|
||||||
|
|
|
@ -210,9 +210,6 @@ static int show_map(struct seq_file *m, void *v)
|
||||||
dev_t dev = 0;
|
dev_t dev = 0;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
|
|
||||||
return -EACCES;
|
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
|
struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
|
||||||
dev = inode->i_sb->s_dev;
|
dev = inode->i_sb->s_dev;
|
||||||
|
@ -742,22 +739,11 @@ const struct file_operations proc_pagemap_operations = {
|
||||||
#ifdef CONFIG_NUMA
|
#ifdef CONFIG_NUMA
|
||||||
extern int show_numa_map(struct seq_file *m, void *v);
|
extern int show_numa_map(struct seq_file *m, void *v);
|
||||||
|
|
||||||
static int show_numa_map_checked(struct seq_file *m, void *v)
|
|
||||||
{
|
|
||||||
struct proc_maps_private *priv = m->private;
|
|
||||||
struct task_struct *task = priv->task;
|
|
||||||
|
|
||||||
if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
|
|
||||||
return -EACCES;
|
|
||||||
|
|
||||||
return show_numa_map(m, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct seq_operations proc_pid_numa_maps_op = {
|
static const struct seq_operations proc_pid_numa_maps_op = {
|
||||||
.start = m_start,
|
.start = m_start,
|
||||||
.next = m_next,
|
.next = m_next,
|
||||||
.stop = m_stop,
|
.stop = m_stop,
|
||||||
.show = show_numa_map_checked
|
.show = show_numa_map,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int numa_maps_open(struct inode *inode, struct file *file)
|
static int numa_maps_open(struct inode *inode, struct file *file)
|
||||||
|
|
|
@ -110,11 +110,6 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
|
||||||
static int show_map(struct seq_file *m, void *_vml)
|
static int show_map(struct seq_file *m, void *_vml)
|
||||||
{
|
{
|
||||||
struct vm_list_struct *vml = _vml;
|
struct vm_list_struct *vml = _vml;
|
||||||
struct proc_maps_private *priv = m->private;
|
|
||||||
struct task_struct *task = priv->task;
|
|
||||||
|
|
||||||
if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
|
|
||||||
return -EACCES;
|
|
||||||
|
|
||||||
return nommu_vma_show(m, vml->vma);
|
return nommu_vma_show(m, vml->vma);
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,14 +165,8 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
|
||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int open_vmcore(struct inode *inode, struct file *filp)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const struct file_operations proc_vmcore_operations = {
|
const struct file_operations proc_vmcore_operations = {
|
||||||
.read = read_vmcore,
|
.read = read_vmcore,
|
||||||
.open = open_vmcore,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct vmcore* __init get_new_element(void)
|
static struct vmcore* __init get_new_element(void)
|
||||||
|
|
10
init/Kconfig
10
init/Kconfig
|
@ -779,16 +779,6 @@ config MARKERS
|
||||||
|
|
||||||
source "arch/Kconfig"
|
source "arch/Kconfig"
|
||||||
|
|
||||||
config PROC_PAGE_MONITOR
|
|
||||||
default y
|
|
||||||
depends on PROC_FS && MMU
|
|
||||||
bool "Enable /proc page monitoring" if EMBEDDED
|
|
||||||
help
|
|
||||||
Various /proc files exist to monitor process memory utilization:
|
|
||||||
/proc/pid/smaps, /proc/pid/clear_refs, /proc/pid/pagemap,
|
|
||||||
/proc/kpagecount, and /proc/kpageflags. Disabling these
|
|
||||||
interfaces will reduce the size of the kernel by approximately 4kb.
|
|
||||||
|
|
||||||
endmenu # General setup
|
endmenu # General setup
|
||||||
|
|
||||||
config HAVE_GENERIC_DMA_COHERENT
|
config HAVE_GENERIC_DMA_COHERENT
|
||||||
|
|
|
@ -333,12 +333,10 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int num_threads = 1;
|
int num_threads = 1;
|
||||||
|
|
||||||
rcu_read_lock();
|
|
||||||
if (lock_task_sighand(p, &flags)) {
|
if (lock_task_sighand(p, &flags)) {
|
||||||
num_threads = atomic_read(&p->signal->count);
|
num_threads = atomic_read(&p->signal->count);
|
||||||
unlock_task_sighand(p, &flags);
|
unlock_task_sighand(p, &flags);
|
||||||
}
|
}
|
||||||
rcu_read_unlock();
|
|
||||||
|
|
||||||
SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, p->pid, num_threads);
|
SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, p->pid, num_threads);
|
||||||
SEQ_printf(m,
|
SEQ_printf(m,
|
||||||
|
|
|
@ -80,7 +80,6 @@ extern int pid_max_min, pid_max_max;
|
||||||
extern int sysctl_drop_caches;
|
extern int sysctl_drop_caches;
|
||||||
extern int percpu_pagelist_fraction;
|
extern int percpu_pagelist_fraction;
|
||||||
extern int compat_log;
|
extern int compat_log;
|
||||||
extern int maps_protect;
|
|
||||||
extern int latencytop_enabled;
|
extern int latencytop_enabled;
|
||||||
extern int sysctl_nr_open_min, sysctl_nr_open_max;
|
extern int sysctl_nr_open_min, sysctl_nr_open_max;
|
||||||
#ifdef CONFIG_RCU_TORTURE_TEST
|
#ifdef CONFIG_RCU_TORTURE_TEST
|
||||||
|
@ -807,16 +806,6 @@ static struct ctl_table kern_table[] = {
|
||||||
.mode = 0644,
|
.mode = 0644,
|
||||||
.proc_handler = &proc_dointvec,
|
.proc_handler = &proc_dointvec,
|
||||||
},
|
},
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_PROC_FS
|
|
||||||
{
|
|
||||||
.ctl_name = CTL_UNNUMBERED,
|
|
||||||
.procname = "maps_protect",
|
|
||||||
.data = &maps_protect,
|
|
||||||
.maxlen = sizeof(int),
|
|
||||||
.mode = 0644,
|
|
||||||
.proc_handler = &proc_dointvec,
|
|
||||||
},
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
.ctl_name = CTL_UNNUMBERED,
|
.ctl_name = CTL_UNNUMBERED,
|
||||||
|
|
Loading…
Reference in a new issue