summaryrefslogtreecommitdiffstats
path: root/sys/compat/linprocfs
Commit message (Collapse)AuthorAgeFilesLines
* Fix a few panics in linuxulator + VIMAGE due to curvnet not being set.zec2009-08-281-0/+2
| | | | | | | This change affects only options VIMAGE builds. Reviewed by: julian MFC after: 3 days
* Merge the remainder of kern_vimage.c and vimage.h into vnet.c andrwatson2009-08-011-1/+0
| | | | | | | | | | vnet.h, we now use jails (rather than vimages) as the abstraction for virtualization management, and what remained was specific to virtual network stacks. Minor cleanups are done in the process, and comments updated to reflect these changes. Reviewed by: bz Approved by: re (vimage blanket)
* Build on Jeff Roberson's linker-set based dynamic per-CPU allocatorrwatson2009-07-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (DPCPU), as suggested by Peter Wemm, and implement a new per-virtual network stack memory allocator. Modify vnet to use the allocator instead of monolithic global container structures (vinet, ...). This change solves many binary compatibility problems associated with VIMAGE, and restores ELF symbols for virtualized global variables. Each virtualized global variable exists as a "reference copy", and also once per virtual network stack. Virtualized global variables are tagged at compile-time, placing the in a special linker set, which is loaded into a contiguous region of kernel memory. Virtualized global variables in the base kernel are linked as normal, but those in modules are copied and relocated to a reserved portion of the kernel's vnet region with the help of a the kernel linker. Virtualized global variables exist in per-vnet memory set up when the network stack instance is created, and are initialized statically from the reference copy. Run-time access occurs via an accessor macro, which converts from the current vnet and requested symbol to a per-vnet address. When "options VIMAGE" is not compiled into the kernel, normal global ELF symbols will be used instead and indirection is avoided. This change restores static initialization for network stack global variables, restores support for non-global symbols and types, eliminates the need for many subsystem constructors, eliminates large per-subsystem structures that caused many binary compatibility issues both for monitoring applications (netstat) and kernel modules, removes the per-function INIT_VNET_*() macros throughout the stack, eliminates the need for vnet_symmap ksym(2) munging, and eliminates duplicate definitions of virtualized globals under VIMAGE_GLOBALS. Bump __FreeBSD_version and update UPDATING. Portions submitted by: bz Reviewed by: bz, zec Discussed with: gnn, jamie, jeff, jhb, julian, sam Suggested by: peter Approved by: re (kensmith)
* After cleaning up rt_tables from vnet.h and cleaning up opt_route.hbz2009-06-231-1/+0
| | | | | a lot of files no longer need route.h either. Garbage collect them. While here remove now unneeded vnet.h #includes as well.
* Get vnets from creds instead of threads where they're available, and fromjamie2009-06-151-1/+1
| | | | | | | passed threads instead of curthread. Reviewed by: zec, julian Approved by: bz (mentor)
* After r193232 rt_tables in vnet.h are no longer indirectly dependent onbz2009-06-081-1/+0
| | | | | | | | | the ROUTETABLES kernel option thus there is no need to include opt_route.h anymore in all consumers of vnet.h and no longer depend on it for module builds. Remove the hidden include in flowtable.h as well and leave the two explicit #includes in ip_input.c and ip_output.c.
* Add stuff to support upcoming BMC/IPMI flashing of newer Dell machineambrisko2009-03-261-0/+72
| | | | | | | | | | | | | | | | | | | | via the Linux tool. - Add Linux shim to ipmi(4) - Create a partitions file to linprocfs to make Linux fdisk see disks. This file is dynamic so we can see disks come and go. - Convert msdosfs to vfat in mtab since Linux uses that for msdosfs. - In the Linux mount path convert vfat passed in to msdosfs so Linux mount works on FreeBSD. Note that tasting works so that if da0 is a msdos file system /compat/linux/bin/mount /dev/da0 /mnt works. - fix a 64it bug for l_off_t. Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to /compat/linux/etc/mtab and then some careful unpacking of the Linux bmc update tool and hacking makes it work on newer Dell boxes. Note, probably if you can't figure out how to do this, then you probably shouldn't be doing it :-)
* For all files including net/vnet.h directly include opt_route.h andbz2009-02-271-0/+2
| | | | | | | | | | | | | | net/route.h. Remove the hidden include of opt_route.h and net/route.h from net/vnet.h. We need to make sure that both opt_route.h and net/route.h are included before net/vnet.h because of the way MRT figures out the number of FIBs from the kernel option. If we do not, we end up with the default number of 1 when including net/vnet.h and array sizes are wrong. This does not change the list of files which depend on opt_route.h but we can identify them now more easily.
* Fix a bug in the previous change to the mtab handler: use the path returnedjhb2009-02-131-1/+1
| | | | | | | by vn_fullpath() when vn_fullpath() succeeds instead of when it fails. Submitted by: Artem Belevich fbsdlist of src.cx MFC after: 3 days
* Replace couple of strcmp(cpu_vendor, "foo") with cpu_vendor_id for i386jkim2009-01-221-3/+9
| | | | and hide i386-specific code under #ifdef.
* vm_map_lock_read() does not increment map->timestamp, so we shouldkib2008-12-291-1/+1
| | | | | | | | | | compare map->timestamp with saved timestamp after map read lock is reacquired, not with saved timestamp + 1. The only consequence of the +1 was unconditional lookup of the next map entry, though. Tested by: pho Approved by: des MFC after: 2 weeks
* Reference the vmspace of the process being inspected by procfs, linprocfskib2008-12-121-1/+8
| | | | | | | | and sysctl kern_proc_vmmap handlers. Reported and tested by: pho Reviewed by: rwatson, des MFC after: 1 week
* Relock user map earlier, to have the lock held when break leaves thekib2008-12-101-1/+1
| | | | | | | loop earlier due to sbuf error. Pointy hat to: me Submitted by: dchagin
* Make two style changes to create new commit and document proper commitkib2008-12-081-2/+1
| | | | | | | | | | | | | | | | | | message for r185765. Noted by: rdivacky Requested by: des Commit message for r185765 should be: In procfs map handler, and in linprocfs maps handler, do not call vn_fullpath() while having vm map locked. This is done in anticipation of the vop_vptocnp commit, that would make vn_fullpath sometime acquire vnode lock. Also, in linprocfs, maps handler already acquires vnode lock. No objections from: des MFC after: 2 week
* Change the linprocfs <pid>/maps and procfs <pid>/map handlers to usekib2008-12-081-7/+23
| | | | | | | | | | | | sbuf instead of doing uiomove. This allows for reads from non-zero offsets to work. Patch is forward-ported des@' one, and was adopted to current code by dchagin@ and me. Reviewed by: des (linprocfs part) PR: kern/101453 MFC after: 1 week
* Rather than using hidden includes (with cicular dependencies),bz2008-12-021-0/+1
| | | | | | | | | | | directly include only the header files needed. This reduces the unneeded spamming of various headers into lots of files. For now, this leaves us with very few modules including vnet.h and thus needing to depend on opt_route.h. Reviewed by: brooks, gnn, des, zec, imp Sponsored by: The FreeBSD Foundation
* utf-8des2008-11-051-1/+1
| | | | MFC after: 3 weeks
* Don't leak a reference on the /compat/linux vnode everytimejhb2008-11-041-5/+7
| | | | | | the linprocfs 'mtab' file is read. MFC after: 1 month
* Change the linprocfs <pid>/maps and procfs <pid>/map handlers to usekib2008-10-041-29/+5
| | | | | | | | | | | | sbuf instead of doing uiomove. This allows for reads from non-zero offsets to work. Patch is forward-ported des@' one, and was adopted to current code by dchagin@ and me. Reviewed by: des (linprocfs part) PR: kern/101453 MFC after: 1 week
* Step 1.5 of importing the network stack virtualization infrastructurezec2008-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the vimage project, as per plan established at devsummit 08/08: http://wiki.freebsd.org/Image/Notes200808DevSummit Introduce INIT_VNET_*() initializer macros, VNET_FOREACH() iterator macros, and CURVNET_SET() context setting macros, all currently resolving to NOPs. Prepare for virtualization of selected SYSCTL objects by introducing a family of SYSCTL_V_*() macros, currently resolving to their global counterparts, i.e. SYSCTL_V_INT() == SYSCTL_INT(). Move selected #defines from sys/sys/vimage.h to newly introduced header files specific to virtualized subsystems (sys/net/vnet.h, sys/netinet/vinet.h etc.). All the changes are verified to have zero functional impact at this point in time by doing MD5 comparision between pre- and post-change object files(*). (*) netipsec/keysock.c did not validate depending on compile time options. Implemented by: julian, bz, brooks, zec Reviewed by: julian, bz, brooks, kris, rwatson, ... Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
* Advertise bit 26 as sse2.cognet2008-09-261-1/+1
| | | | Spotted out by: gahr
* Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed threadattilio2008-08-281-1/+1
| | | | | | was always curthread and totally unuseful. Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* All opt_x.h includes go at the top of other includes.julian2008-08-251-1/+2
|
* Commit step 1 of the vimage project, (network stack)bz2008-08-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | virtualization work done by Marko Zec (zec@). This is the first in a series of commits over the course of the next few weeks. Mark all uses of global variables to be virtualized with a V_ prefix. Use macros to map them back to their global names for now, so this is a NOP change only. We hope to have caught at least 85-90% of what is needed so we do not invalidate a lot of outstanding patches again. Obtained from: //depot/projects/vimage-commit2/... Reviewed by: brooks, des, ed, mav, julian, jamie, kris, rwatson, zec, ... (various people I forgot, different versions) md5 (with a bit of help) Sponsored by: NLnet Foundation, The FreeBSD Foundation X-MFC after: never V_Commit_Message_Reviewed_By: more people than the patch
* Add the support for the AT_FDCWD and fd-relative name lookups to thekib2008-03-311-0/+1
| | | | | | | | | namei(9). Based on the submission by rdivacky, sponsored by Google Summer of Code 2007 Reviewed by: rwatson, rdivacky Tested by: pho
* vn_lock() is currently only used with the 'curthread' passed as argument.attilio2008-01-101-1/+1
| | | | | | | | | | | | | | | | Remove this argument and pass curthread directly to underlying VOP_LOCK1() VFS method. This modify makes the code cleaner and in particular remove an annoying dependence helping next lockmgr() cleanup. KPI results, obviously, changed. Manpage and FreeBSD_version will be updated through further commits. As a side note, would be valuable to say that next commits will address a similar cleanup about VFS methods, in particular vop_lock1 and vop_unlock. Tested by: Diego Sardina <siarodx at gmail dot com>, Andrea Di Pasquale <whyx dot it at gmail dot com>
* Move the shared cp_time array (counts %sys, %user, %idle etc) to thepeter2007-11-291-5/+16
| | | | | | | | | | | | | | | | | | | | | | per-cpu area. cp_time[] goes away and a new function creates a merged cp_time-like array for things like linprocfs, sysctl etc. The atomic ops for updating cp_time[] in statclock go away, and the scope of the thread lock is reduced. sysctl kern.cp_time returns a backwards compatible cp_time[] array. A new kern.cp_times sysctl returns the individual per-cpu stats. I have pending changes to make top and vmstat optionally show per-cpu stats. I'm very aware that there are something like 5 or 6 other versions "out there" for doing this - but none were handy when I needed them. I did merge my changes with John Baldwin's, and ended up replacing a few chunks of my stuff with his, and stealing some other code. Reviewed by: jhb Partly obtained from: jhb
* Spelling fix for interupt -> interruptkevlo2007-10-121-1/+1
|
* Commit 14/14 of sched_lock decomposition.jeff2007-06-051-2/+2
| | | | | | | | | | | - Use thread_lock() rather than sched_lock for per-thread scheduling sychronization. - Use the per-process spinlock rather than the sched_lock for per-process scheduling synchronization. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
* Revert VMCNT_* operations introduction.attilio2007-05-311-9/+9
| | | | | | | | Probabilly, a general approach is not the better solution here, so we should solve the sched_lock protection problems separately. Requested by: alc Approved by: jeff (mentor)
* - define and use VMCNT_{GET,SET,ADD,SUB,PTR} macros for manipulatingjeff2007-05-181-9/+9
| | | | | | | | vmcnts. This can be used to abstract away pcpu details but also changes to use atomics for all counters now. This means sched lock is no longer responsible for protecting counts in the switch routines. Contributed by: Attilio Rao <attilio@FreeBSD.org>
* Synchronize vm map and object accesses.alc2007-05-011-8/+26
| | | | Approved by: des@
* Now that we're MPSAFE, tell namei() to acquire Giant if necessary.des2007-04-221-2/+4
|
* Whitespace cleanup.des2007-04-151-16/+18
|
* Fix kernel module dependency. linprocfs depends on sysvmsg and sysvsem.jkim2007-04-061-0/+2
| | | | Submitted by: nork
* Use underlying structures instead of kernel_sysctlbyname() for msginfo andjkim2007-03-301-34/+5
| | | | | | | | | seminfo because kernel_sysctlbyname() is slow. There is no dependency problem since linux module depends on both sysvmsg and sysvsem and linprocfs depends on it in turn. Pointed out by: des Reviewed by: des
* Add a pn_destroy field to pfs_node. This field points to a destructordes2007-03-121-36/+36
| | | | | | | | | | | | | function which is called from pfs_destroy() before the node is reclaimed. Modify pfs_create_{dir,file,link}() to accept a pointer to a destructor function in addition to the usual attr / fill / vis pointers. This breaks both the programming and binary interfaces between pseudofs and its consumers. It is believed that there are no pseudofs consumers outside the source tree, so that the impact of this change is minimal. Submitted by: Aniruddha Bohra <bohra@cs.rutgers.edu>
* MFP4: 113090, 113130, 113132jkim2007-03-021-3/+100
| | | | Add Linux kernel version strings to /proc/sys/kernel.
* Use a printf-modifier which doesn't need a cast.netchild2007-01-211-2/+2
| | | | Submitted by: scottl
* Fix tinderbox build on amd64.netchild2007-01-201-2/+2
|
* Ooops, fix the ratelimit.netchild2007-01-201-1/+3
|
* Convert a KASSERT into a runtime warning (rate limited) + failsafe fallback.netchild2007-01-201-4/+12
| | | | | | | Because of a stupid bug (also fixed with this commit) the KASSERT was triggered when runnung the linux top. Pointy hat to: netchild
* MFP4: Change 109654jkim2006-11-271-0/+60
| | | | | | | | | | | | | | | | Add two linprocfs entries for Linux IPC: /proc/sys/kernel/msgmni -> kern.ipc.msgmni /proc/sys/kernel/sem -> kern.ipc.semmsl kern.ipc.semmns kern.ipc.semopm kern.ipc.semmni This fixes msgget03 and semget05 from Linux Test Project (LTP) test suite. msgctl08 and msgctl09 also use /proc/sys/kernel/msgmni but another fix is required from p4 (Change 110179). Requested by: netchild
* style(9)netchild2006-10-291-0/+1
| | | | Noticed by: rwatson
* Spell proc/sys/kernel/pid_max correctly in a comment.keramida2006-10-111-1/+1
| | | | Submitted by: rdivacky
* Implement /proc/sys/kernel/pid_max.netchild2006-10-081-0/+19
| | | | | Submitted by: rdivacky Tested with: LTP
* Lock the vnode around the call to VOP_GETATTR. Move the locked codekib2006-08-081-5/+16
| | | | | | | | | | | | and vn_fullpath (that call malloc(..., M_WAITOK)) from under the vm object lock, since sleep is not allowed while holding the mutex. Being there, wrap VOP_GETATTR call with conditional Giant aquire. Currently this is (almost) noop because pseudofs is Giant-locked. Tested by: kris Approved by: pjd (mentor) MFC after: 2 weeks
* Improve linprovfs to provide/fix thenetchild2006-06-271-27/+51
| | | | | | | | | | | | | | | | | | | | | | | | | - process state (idle, sleeping, running, ...) [1] - the process group ID of the process which owns the connected tty - some page fault stats - time spend in kernel/userland - priority/nice value - starttime [1] - memory/swap stats - scheduling policy Additionally add some new fields and correct some not filled out ones. This brings us down to 15 dummy fields. The fields marked with [1] are needed to get Oracle 10 running. The starttime field is not completely right, since it displays the _same_ starttime for _every_ process, but at least it is not 0 and Oracle accepts this. This is a RELENG_x_y candidate. Noticed by: Dmitry Ganenko <dima@apk-inform.com> [1] Reviewed by: des, rdivacky MFC after: 1 week
* Add the model name, obtained from the hw.model sysctl variable.des2006-06-121-2/+12
| | | | MFC after: 3 weeks
* As far as I can tell, the correct CPU family for amd64 (which Linux callsdes2006-06-021-2/+2
| | | | | | x86_64) is 15, not 6. MFC after: 3 weeks
OpenPOWER on IntegriCloud