Commit Graph

130 Commits

Author SHA1 Message Date
kevlo
7a9f1e285b Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
jeff
91d1501790 Commit 14/14 of sched_lock decomposition.
- 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)
2007-06-05 00:00:57 +00:00
attilio
7dd8ed88a9 Revert VMCNT_* operations introduction.
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)
2007-05-31 22:52:15 +00:00
jeff
e1996cb960 - define and use VMCNT_{GET,SET,ADD,SUB,PTR} macros for manipulating
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>
2007-05-18 07:10:50 +00:00
alc
9c008bb303 Synchronize vm map and object accesses.
Approved by: des@
2007-05-01 03:09:57 +00:00
des
c494d6613e Now that we're MPSAFE, tell namei() to acquire Giant if necessary. 2007-04-22 08:41:52 +00:00
des
4d29cf6f60 Whitespace cleanup. 2007-04-15 17:02:03 +00:00
jkim
bbfc500036 Fix kernel module dependency. linprocfs depends on sysvmsg and sysvsem.
Submitted by:	nork
2007-04-06 18:15:56 +00:00
jkim
5657d675b3 Use underlying structures instead of kernel_sysctlbyname() for msginfo and
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
2007-03-30 17:56:44 +00:00
des
3d3e50beaf Add a pn_destroy field to pfs_node. This field points to a destructor
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>
2007-03-12 12:16:52 +00:00
jkim
bad5e1f23b MFP4: 113090, 113130, 113132
Add Linux kernel version strings to /proc/sys/kernel.
2007-03-02 01:10:26 +00:00
netchild
1542e0642c Use a printf-modifier which doesn't need a cast.
Submitted by:	scottl
2007-01-21 13:18:52 +00:00
netchild
023c3ce346 Fix tinderbox build on amd64. 2007-01-20 19:32:23 +00:00
netchild
d1c3c94c60 Ooops, fix the ratelimit. 2007-01-20 11:31:14 +00:00
netchild
22ce9c2574 Convert a KASSERT into a runtime warning (rate limited) + failsafe fallback.
Because of a stupid bug (also fixed with this commit) the KASSERT was
triggered when runnung the linux top.

Pointy hat to:	netchild
2007-01-20 11:07:41 +00:00
jkim
8b7cde4e1a MFP4: Change 109654
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
2006-11-27 21:10:55 +00:00
netchild
40c28e1f50 style(9)
Noticed by:	rwatson
2006-10-29 09:50:55 +00:00
keramida
18f94ee242 Spell proc/sys/kernel/pid_max correctly in a comment.
Submitted by:	rdivacky
2006-10-11 20:32:46 +00:00
netchild
eefbee99be Implement /proc/sys/kernel/pid_max.
Submitted by:	rdivacky
Tested with:	LTP
2006-10-08 16:55:27 +00:00
kib
ecc9acd268 Lock the vnode around the call to VOP_GETATTR. Move the locked code
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
2006-08-08 12:29:26 +00:00
netchild
b9c4ec80c0 Improve linprovfs to provide/fix the
- 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
2006-06-27 20:11:58 +00:00
des
1cdc0bca4f Add the model name, obtained from the hw.model sysctl variable.
MFC after:	3 weeks
2006-06-12 18:14:49 +00:00
des
77a3ee6587 As far as I can tell, the correct CPU family for amd64 (which Linux calls
x86_64) is 15, not 6.

MFC after:	3 weeks
2006-06-02 13:01:25 +00:00
jhb
0f921e0992 Remove various bits of conditional Alpha code and fixup a few comments. 2006-05-12 05:04:46 +00:00
ambrisko
31b22ce017 Enhance the Linux emulation layer to make MegaRAID SAS managements tool happy.
Add back in a scheme to emulate old type major/minor numbers via hooks into
stat, linprocfs to return major/minors that Linux app's expect.  Currently
only /dev/null is always registered.  Drivers can register via the Linux
type shim similar to the ioctl shim but by using
linux_device_register_handler/linux_device_unregister_handler functions.
The structure is:

    struct linux_device_handler {
        char    *bsd_driver_name;
        char    *linux_driver_name;
        char    *bsd_device_name;
        char    *linux_device_name;
        int     linux_major;
        int     linux_minor;
        int     linux_char_device;
    };

Linprocfs uses this to display the major number of the driver.  The
soon to be available linsysfs will use it to fill in the driver name.
Linux_stat uses it to translate the major/minor into Linux type values.

Note major numbers are dynamically assigned via passing in a -1 for
the major number so we don't need to keep track of them.

This is somewhat needed due to us switching to our devfs.  MegaCli
will not run until I add in the linsysfs and mfi Linux compat changes.

Sponsored by:	IronPort Systems
2006-05-05 16:10:45 +00:00
mlaier
a5a3178da8 Fix calculation of meminfo's swaptotal and swapfree on at least amd64.
MFC after:	3 days
2005-12-11 21:37:42 +00:00
rodrigc
a5e716d31f Remove MNT_NODEV mount option. In RELENG_6, MNT_NODEV was a no-op.
The presence of MNT_NODEV was confusing the am-utils autoconf scripts.

PR:	conf/79715
2005-11-29 00:28:17 +00:00
sobomax
6f0b5d23e8 Always produce cpuX entries, even in the case when there is only one CPU
in the system. This is consistent with what real linuxes do.

PR:		kern/75848
Submitted by:	Andriy Gapon <avg@icyb.net.ua>
MFC after:	3 days
2005-03-06 22:28:14 +00:00
obrien
98e2482a94 Match the LINUX32's style with existing style
Submitted by:	Jung-uk Kim <jkim@niksun.com>

Use positive, not negative logic.
2005-01-14 04:44:56 +00:00
imp
362fcfc1e2 Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
cperciva
ebbf4e4bde Fix unvalidated pointer dereference. This is FreeBSD-SA-04:17.procfs. 2004-12-01 21:33:02 +00:00
phk
d09bec0098 Pick up the inode number using VOP_GETATTR() rather than caching it
in all vnodes on the off chance that linprocfs needs it.  If we can afford
to call vn_fullpath() we can afford the much cheaper VOP_GETATTR().
2004-11-10 07:25:37 +00:00
tjr
33d20b8677 Add support for 32-bit Linux binary emulation on amd64:
- include <machine/../linux32/linux.h> instead of <machine/../linux/linux.h>
  if building with the COMPAT_LINUX32 option.
- make minimal changes to the i386 linprocfs_docpuinfo() function to support
  amd64. We return a fake CPU family of 6 for now.
2004-08-16 08:19:18 +00:00
pjd
a003db5b61 Remove ps_argsopen from this check, because of two reasons:
1. This check if wrong, because it is true by default
   (kern.ps_argsopen is 1 by default) (p_cansee() is not even checked).
2. Sysctl kern.ps_argsopen is going away.
2004-04-01 00:04:23 +00:00
des
d02b8b76ae Remove VFS_STATFS() call which violated the lock order and wasn't
really required anyway.

PR:		kern/61994
Submitted by:	Bjoern Groenvall <bg@sics.se>
2004-02-09 20:33:42 +00:00
rwatson
86b7a1a180 Correct for proper vn_fullpath() failure mode: "== -1" -> "!= 0"
Discussed with:	des
2004-01-12 03:14:37 +00:00
alc
7d2f8d32ae Lock the traversal of the vm object list. Use TAILQ_FOREACH consistently. 2004-01-02 19:29:31 +00:00
des
98e94a9c10 Use mp_ncpus instead of the hw.ncpu sysctl. 2003-12-07 17:38:20 +00:00
cognet
18fc7b26c7 Various style and type fixes in my last commit.
Suggested by:	mux
2003-10-20 04:10:20 +00:00
cognet
82c805f917 Implement partially /proc/<pid>/maps.
It looks enough to make SImics run.

Reviewed by:	des
2003-10-19 14:13:51 +00:00
gallatin
8f2de8390a make kernel_sysctl()'s args match its prototype in order to fix the
alpha build
2003-10-08 18:05:59 +00:00
des
9af19ad623 Fix a (fortunately harmless) signed / unsigned bug. 2003-09-30 13:35:19 +00:00
des
1dcdf9246c Previous commit contained too-smart-for-its-own-good code that might
produce incorrect (though harmless) output on single-CPU systems.
2003-09-22 16:05:11 +00:00
des
111a6744cd Fake multi-cpu statistics for proc/stat by dividing the totals by the
number of CPUs.

PR:		kern/27522
2003-09-22 15:52:32 +00:00
des
5dcdf0638c Fix some broken comments. 2003-09-09 19:22:55 +00:00
des
ea3cbbe49d Add cwd, root and statm (modeled on a 2.4.20 kernel). De-obfuscate
linprocfs_init() a little and remove some gratuitous whitespace.
2003-09-09 08:19:06 +00:00
des
1bccee947e Whitespace cleanup. 2003-08-18 13:30:15 +00:00
marcel
7db6a715d6 Cleanup <machine/cpu.h> by moving MD prototypes to <machine/md_var.h>
like we have on other platforms. Move savectx() to <machine/pcb.h>.
A lot of files got these MD prototypes through the indirect inclusion
of <machine/cpu.h> and now need to include <machine/md_var.h>. The
number of which is unexpectedly large...

osf1_misc.c especially is tricky because szsigcode is redefined in
one of the osf1 header files. Reordering of the include files was
needed.

linprocfs.c now needs an explicit extern declaration.

Tested with: LINT
2003-08-17 06:42:08 +00:00
des
f907274e33 Add support for multiple CPUs to cpuinfo. 2003-08-04 10:55:22 +00:00
phk
5fa40a3265 Add a new function swap_pager_status() which reports the total size of the
paging space and how much of it is in use (in pages).

Use this interface from the Linuxolator instead of groping around in the
internals of the swap_pager.
2003-07-18 10:26:09 +00:00