| Age | Commit message (Collapse) | Author |
|
The presence of /proc/kcore is supposed to be configurable.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
This patch moves the following files in /proc:
/proc/net/rt_cache_stat /proc/net/stat/rt_cache
/proc/net/ip_conntrack_stat /proc/net/stat/ip_conntrack
/proc/net/arp_cache_stat /proc/net/stat/arp_cache
/proc/net/clip_arp_cache_stat /proc/net/stat/clip_arp_cache
/proc/net/dn_neigh_cache_stat /proc/net/stat/dn_neigh_cache
This allows a generic statistics tool to scan for all available statistics
by doing readdir(2) on /proc/net/stat
It also adds a special first 'template' line to rt_cache and ip_conntrack
in order to facilitate compatibility once somebody adds new fields to the
output lines.
WARNING:
This breaks existing rtstat.c and ctstat.c userspace programs
(hopefully for the last time). rtstat is non-existant or broken in
major distributions anyway, and ctstat is too new for any distros
having it picked up. Therefore, we justify this breakage.
A new unified statistics tool for routing cache, connection tracking and
neighbour cache is under development and will be included with iproute2.
Signed-off-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
The last parameter of proc_symlink is usually a "const char *", but the
stub in <linux/proc_fs.h> for CONFIG_PROC_FS=n omits the const and makes
its last parameter a "char *". This causes a warning about discarding
qualifiers for any code that passes something const for that last
parameter.
This patch fixes that up and also, for neatness's sake, makes the stub for
create_proc_read_entry() match the usual prototype more exactly (use
read_proc_t rather than the underlying function pointer type).
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Merely removing down_read(&mm->mmap_sem) from task_vsize() is too
half-assed to let stand. The following patch removes the vma iteration
as well as the down_read(&mm->mmap_sem) from both task_mem() and
task_statm() and callers for the CONFIG_MMU=y case in favor of
accounting the various stats reported at the times of vma creation,
destruction, and modification. Unlike the 2.4.x patches of the same
name, this has no per-pte-modification overhead whatsoever.
This patch quashes end user complaints of top(1) being slow as well as
kernel hacker complaints of per-pte accounting overhead simultaneously.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
task_vsize() doesn't need mm->mmap_sem for the CONFIG_MMU case; the
semaphore doesn't prevent mm->total_vm from going stale or getting
inconsistent with other numbers regardless. Also, KSTK_EIP() and
KSTK_ESP() don't want or need protection from mm->mmap_sem either. So this
pushes mm->mmap_sem to task_vsize() in the CONFIG_MMU=n task_vsize().
Also, hoist the prototype of task_vsize() into proc_fs.h
The net result of this is a small speedup of procps for CONFIG_MMU.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
From: Matt Mackall <mpm@selenic.com>
Delete obsolete comment and kill test of obsolete define.
|
|
From: Nathan Lynch <nathanl@austin.ibm.com>
On some larger ppc64 configurations /proc/device-tree is exhausting procfs'
dynamic (non-pid) inode range (16K). This patch makes the dynamic inode
range 0xf0000000-0xffffffff and changes the inode number allocator to use
the idr.c allocator for the first-fit allocations.
|
|
The proc_rtas_init call in procfs was removed (replaced with an
initcall) but the prototype was still hiding. Kill it.
|
|
Lynch
From: Anton Blanchard <anton@samba.org>
- nop out proc_device_tree_add_node if CONFIG_PROC_DEVICETREE=n
- stubs for procfs-related functions when CONFIG_PROC_DEVICETREE=n
|
|
From: Anton Blanchard <anton@samba.org>
Minor fixes to make the UP case compile, export cpu_possible_map, fix up
whitespace etc.
|
|
Lynch
From: Anton Blanchard <anton@samba.org>
support for runtime updates of /proc/device-tree, from Nathan Lynch
|
|
From: Chris Wright <chrisw@osdl.org>
Fix for CAN-2003-0461: /proc/tty/driver/serial in Linux 2.4.x reveals the
exact number of characters used in serial links, which could allow local
users to obtain potentially sensitive information such as the length of
passwords.
|
|
|
|
From: Adrian Bunk <bunk@fs.tum.de>
Remove CONFIG_KCORE_AOUT: the ability to present /proc/kcore in a.out
format.
I've checked with various arch maintainers. It won't be missed.
|
|
We get a linkage error with CONFIG_KCORE_AOUT because there is no
implementation of kclist_add() and kclist_del().
Also fix a warning in the a.out version of read_kcore().
Maybe we should just remove kcore a.out support. m68knommu and h8300 are
setting CONFIG_KCORE_AOUT in their defconfigs though.
|
|
From: Christoph Hellwig <hch@lst.de>
It's not used anymore since ALSA switched to traditional devices and device
nodes in procfs are a bad idea in general..
Also update the docs.
|
|
- Add open intent information to the 'struct nameidata'.
- Pass the struct nameidata as an optional parameter to the
lookup() inode operation.
- Pass the struct nameidata as an optional parameter to the
d_revalidate() dentry operation.
- Make link_path_walk() set the LOOKUP_CONTINUE flag in nd->flags instead
of passing it as an extra parameter to d_revalidate().
- Make open_namei(), and sys_uselib() set the open()/create() intent
data.
|
|
From Bartlomiej Zolnierkiewicz
With !CONFIG_PROC_FS, ieee1394_core fails to compile because the argument to
this inline is still evaluated. But it doesn't exist.
A general fix is to not evaluate the arg at all.
|
|
From: Adrian Bunk <bunk@fs.tum.de>
|
|
From: Tony Luck <tony.luck@intel.com>
/proc/kcore has been broken on some architectures for a long time. Problems
surround the fact that some architectures allocate memory for vmalloc() and
thus modules at addresses below PAGE_OFFSET, which results in negative file
offsets in the virtual core file image provided by /proc/kcore. There are
also pending problems for discontig memory systems as /proc/kcore just
pretends that there are no holes between "PAGE_OFFSET" and "high_memory", so
an unwary user (ok super-user) can read non-existant memory which may do bad
things. There may also be kernel objects that would be nice to view in
/proc/kcore, but do not show up there.
A pending change on ia64 to allow booting on machines that don't have
physical memory in any convenient pre-determined place will make things even
worse, because the kernel itself won't show up in the current implementation
of /proc/kcore!
The patch attached provides enough hooks that each architecture should be
able to make /proc/kcore useful. The patch is INCOMPLETE in that *use* of
those hooks is ONLY PROVIDED FOR IA64.
Here's how it works. The default code in fs/proc/kcore.c doesn't set up any
"elf_phdr" sections ... it is left to each architecture to make appropriate
calls to "kclist_add()" to specify a base address and size for each piece of
kernel virtual address space that needs to be made accessible through
/proc/kcore. To get the old functionality, you'll need two calls that look
something like:
kclist_add(&kcore_mem, __va(0),
max_low_pfn * PAGE_SIZE);
kclist_add(&kcore_vmem, (void *)VMALLOC_START,
VMALLOC_END-VMALLOC_START);
The first makes all of memory visible (__i386__, __mc68000__ and __x86_64__
should use __va(PAGE_SIZE) to duplicate the original lack of access to page
0). The second provides a single map for all "vmalloc" space (the code still
searches the vmlist to see what actually exists before accessing it).
Other blocks of kernel virtual space can be added as needed, and removed
again (with kclist_del()). E.g. discontiguous memory machines can add an
entry for each block of memory. Architectures that allocate memory for
modules someplace outside of vmalloc-land can add/remove entries on module
insert and remove.
The second piece of abstraction is the kc_vaddr_to_offset() and
kc_offset_to_vaddr() macros. These provide mappings from kernel virtual
addresses to offsets in the virtual file that /proc/kcore instantiates. I
hope they are sufficient to avoid negative offset problems that plagued the
old /proc/kcore. Default versions are provided for the old behaviour
(mapping simply adds/subtracts PAGE_OFFSET). For ia64 I just need to use a
different offset as all kernel virtual allocations are in the high 37.5% of
the 64-bit virtual address space. x86_64 was the other architecture with
this problem. I don't know enough (anything) about the kernel memory map on
x86_64, so I hope these provide a big enough hook. I'm hoping that you have
some low stuff, and some high stuff with a big hole in the middle ... in
which case the macros might look something like:
#define kc_vaddr_to_offset(v) ((v) < 0x1000000000000000 ? (v) : \
((v) - 0xF000000000000000))
But if you have interesting stuff scattered across *every* part of the
unsigned address range, then you won't be able to squeeze it all into a
signed file offset.
There are a couple of bug fixes too:
1) get_kcore_size() didn't account for the elf_prstatus, elf_prpsinfo
and task_struct that are placed in the PT_NOTE section that is
part of the header. We were saved on most configurations by the
round-up to PAGE_SIZE ... but it's possible that some architectures
or machines corrupted memory beyond the space allocated for the
header.
2) The size of the PT_NOTES section was incorrectly set to the size
of the last note, rather than the sum of the sizes of all the notes.
|
|
From: Manfred Spraul <manfred@colorfullife.com>
three build fixes for CONFIG_PROC_FS=n:
include/linux/procfs.h:
- add missing proc_pid_unhash, proc_pid_flush declarations. static
inline functions that do nothing.
- move semicolons around for kclist_{add,del}. gcc-3.2.2 doesn't like
the current syntax.
drivers/net/pppoe.c:
- proc_net doesn't exist if CONFIG_PROC_FS=n.
drivers/scsi/scsi_priv.h:
- add missing brackets to macro definition.
|
|
__unhash_process acquires the dcache_lock while holding the
tasklist_lock for writing. This can deadlock. Additionally,
fs/proc/base.c incorrectly assumed that p->pid would be set to 0 during
release_task.
The patch fixes that by adding a new spinlock to the task structure and
fixing all references to (!p->pid).
The alternative to the new spinlock would be to hold dcache_lock around
__unhash_process.
- fs/proc/base.c assumed that p->pid is reset to 0 during exit. This is
not the case anymore. I now look at the count of the pid structure for
PIDTYPE_PID.
- de_thread now tested - as broken as it was before: open handles to
/proc/<pid> are either stale or invalid after an exec of a nptl process,
if the exec was call from a secondary thread.
- a few lock_kernels removed - that part of /proc doesn't need it.
- additional instances of 'if(current->pid)' replaced with pid_alive.
|
|
|
|
|
|
|
|
Define container_of which cast from member to struct with some type checking.
This is much like list_entry but is cearly for things other than lists.
List_entry now uses container_of.
|
|
When compiling 2.5.20 (and ealier, likely) without procfs, the declaration
for struct tty_driver is missing in proc_fs.h, causing many compiler warnings
that are fixed by this patch.
|
|
- preparation for sane policy for /proc/<pid>/fd/* - don't store
struct file * in these inodes anymore.
|
|
Unfortunately the proc filesystem has a limit on the number of dynamic
proc entries it can create. On large systems we can exhaust the default
(4096) very quickly. The following patch increases the default to
something more reasonable.
|
|
|
|
convert procfs to ->get_sb(). Similar to ext2, except that we use
get_sb_single() instead of get_sb_bdev(). Notice the we _don't_ keep
FS_SINGLE in flags - as the matter of fact, with ->get_sb() FS_SINGLE is
useless.
|
|
procfs switched to alloc_inode/destroy_inode.
|
|
- Jens Axboe: more bio updates, fix some request list bogosity under load
- Al Viro: export seq_xxx functions
- Manfred Spraul: include file cleanups, pc110pad compile fix
- David Woodhouse: fix JFFS2 write error handling
- Dave Jones: start merging up with 2.4.x patches
- Manfred Spraul: coredump fixes, FS event counter cleanups
- me: fix SCSI CD-ROM sectorsize BIO breakage
|
|
- merge with Alan (USB, zoran, sony motion-eye, rio, dmi-scan)
|
|
- Russell King: ARM updates
- Al Viro: more init cleanups
- Cort Dougan: more PPC updates
- David Miller: cleanups, pci mmap updates
- Neil Brown: raid resync by sector
- Alan Cox: more merging with -ac
- Johannes Erdfelt: USB updates
- Kai Germaschewski: ISDN updates
- Tobias Ringstrom: dmfe.c network driver update
- Trond Myklebust: NFS client updates and cleanups
|
|
- Chris Mason: daemonize reiserfs commit thread
- Alan Cox: syncup (AFFS might even work, and official VIA workarounds)
- Jeff Garzik: network driver updates
- Paul Mackerras: PPP update
- David Howells: more rw-sem cleanups, updates. Slowly getting somewhere.
|
|
- Mike Phillips: olympic driver update
- Alan Cox: continued resyncing (lots of small stuff, big NTFS merge from Anton)
- Martin Dalecki: cleanup (remove unused and unnecessary get_hardblocksize)
- Chris Mason: fix potential reiserfs journal overflow
- Jeff Garzik: network driver updates
- David Miller: sparc fixes, some network cleanups
|
|
- Jens: better ordering of requests when unable to merge
- Neil Brown: make md work as a module again (we cannot autodetect
in modules, not enough background information)
- Neil Brown: raid5 SMP locking cleanups
- Neil Brown: nfsd: handle Irix NFS clients named pipe behavior and
dentry leak fix
- maestro3 shutdown fix
- fix dcache hash calculation that could cause bad hashes under certain
circumstances (Dean Gaudet)
- David Miller: networking and sparc updates
- Jeff Garzik: include file cleanups
- Andy Grover: ACPI update
- Coda-fs error return fixes
- rth: alpha Jensen update
|
|
|