Commit Graph

7869 Commits

Author SHA1 Message Date
phk
d632cb3d94 Move the bit of the syncer which deals with vnodes into a separate
function.
2004-11-14 15:24:38 +00:00
phk
7339a0b3dc Rearrange memory management for ioctl arguments to use stronger checks
for illegal values and don't store them on the stack any more.
2004-11-14 14:34:12 +00:00
phk
39a0a1611e style polish. 2004-11-14 12:04:34 +00:00
phk
c61620e47e Move #define up. 2004-11-14 09:21:01 +00:00
phk
b99ff6bbb6 Eliminate vop_revoke() function now that devfs_revoke() does the entire job. 2004-11-13 23:38:13 +00:00
phk
9c54a75d69 The default VOP_REVOKE() should be vop_panic() as we should never
get here in the first place.
2004-11-13 22:59:52 +00:00
phk
d5fcd8fb46 Polish two functions a bit so that it is easier to wrap them in
locks if/when we need that.
2004-11-13 17:21:26 +00:00
phk
216166ee0d Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.
Use this in all the places where sleeping with the lock held is not
an issue.

The distinction will become significant once we finalize the exact
lock-type to use for this kind of case.
2004-11-13 11:53:02 +00:00
rwatson
5f3907b408 Correct two incorrectly merged changes introduced in sysv_sem.c:1.71:
return EINVAL rather than setting error, and don't free sops
unconditionally.  The first change was merged accidentally as part of
the larger set of changes to introduce MAC labels and access control,
and potentially lead to continued processing of a request even after
it was determined to be invalid.  The second change was due to changes
in the semaphore code since the original work was performed.

Pointed out by:	truckman
2004-11-13 08:06:40 +00:00
rwatson
891fcc9766 Second of several commits to allow kernel System V IPC data structures
to be modified and extended without breaking the user space ABI:

Use _kernel variants on _ds structures for System V sempahores, message
queues, and shared memory.  When interfacing with userspace, export
only the _ds subsets of the _kernel data structures.  A lot of search
and replace.

Define the message structure in the _KERNEL portion of msg.h so that it
can be used by other kernel consumers, but not exposed to user space.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research
2004-11-12 13:23:47 +00:00
jeff
311bbf4546 - Temporarily disable the nice -20 throttling code. It has some interaction
with APM that I do not understand yet.

Reported & Tested by:	glebius
2004-11-11 19:48:57 +00:00
glebius
6e5bd296a6 - Introduce protosw_init().
- Utilize it in net_init_domain().
- Utilize it pf_proto_register(), fixing panic on
  natd start.

Reviewed by:	ru, phk, obrien
2004-11-11 19:19:54 +00:00
dds
a701823f99 Return POLLERR rather than POLLIN/POLLOUT on TS_ZOMBIE ttys.
PR:		kern/73821
MFC after:	4 weeks
2004-11-11 16:10:54 +00:00
phk
4a69aafbc4 remove unused variable 2004-11-10 09:56:28 +00:00
phk
16982b2183 Remove hack which mounts the root filesystem R/W if the device is
named 'md<something>'.  While convenient, it does not belong here,
if anywhere at all.
2004-11-10 07:36:09 +00:00
phk
9fdf027988 Slim vnodes by another four bytes by eliminating the (now) unused field
v_cachedid.
2004-11-10 07:31:06 +00:00
phk
cea5000057 Remove vn_todev() 2004-11-10 07:17:28 +00:00
phk
6f9f259ced Make getdiskbyname() static to vfs_mount.c.
Eliminate use of vn_todev() while here.
2004-11-09 23:03:34 +00:00
phk
7bef55364a Remove vnode->v_cachedfs.
It was only used for the highly dangerous "export all vnodes with a sysctl"
function.
2004-11-09 22:51:03 +00:00
glebius
9e1a271f2f Since sb_timeo type was increased to int, use INT_MAX instead of SHRT_MAX.
This also gives us ability to close PR.

PR:		kern/42352
Approved by:	julian (mentor)
MFC after:	1 week
2004-11-09 18:35:26 +00:00
rwatson
bd4e6ffd55 Bump MAC Framework version to 2 in preparation for the upcoming API/ABI
changes associated with adding System V IPC support.  This will prevent
old modules from being used with the new kernel, and new modules from
being used with the old kernel.
2004-11-09 11:28:40 +00:00
jmg
17a80e7f16 clean up some tunables that should of been removed a while ago... 2004-11-09 06:46:14 +00:00
des
fe29d052b3 Retire TUNABLE_QUAD_*. 2004-11-08 18:22:22 +00:00
des
e836fd23ea #include <vm/vm_param.h> instead of <machine/vmparam.h> (the former
includes the latter, but also declares variables which are defined
in kern/subr_param.c).

Change som VM parameters from quad_t to unsigned long.  They refer to
quantities (size limits for text, heap and stack segments) which must
necessarily be smaller than the size of the address space, so long is
adequate on all platforms.

MFC after:	1 week
2004-11-08 18:20:02 +00:00
phk
027fce30f5 Initialize struct pr_userreqs in new/sparse style and fill in common
default elements in net_init_domain().

This makes it possible to grep these structures and see any bogosities.
2004-11-08 14:44:54 +00:00
phk
d24107be6b Use more intuitive pointer for fdinit() and fdcopy().
Change fdcopy() to take unlocked filedesc.
2004-11-08 12:43:23 +00:00
alc
8461ec98de Eliminate an unused argument to vm_pgmoveco(). 2004-11-08 06:57:31 +00:00
marcel
71335ce1f2 Bind to cpu0 for boot() processing on all platforms again. 2004-11-08 04:52:26 +00:00
marcel
c361afa258 Increase default HZ for ia64 to 1000. 2004-11-08 04:50:02 +00:00
alc
279c442e7b Introduce two new options, "CPU private" and "no wait", to sf_buf_alloc().
Change the spelling of the "catch" option to be consistent with the new
options.  Implement the "no wait" option.  An implementation of the "CPU
private" for i386 will be committed at a later date.
2004-11-08 00:43:46 +00:00
rwatson
ab85f61559 Add basic critical section tracing to KTR using event type KTR_CRITICAL.
This generates a KTR event for each critical section entered and exited.

It would be desirable to also log the filename and line number of the
source entering or exiting the critical section, but this requires
hacking up the critical section API, so I've not done that yet.
2004-11-07 23:11:32 +00:00
phk
52da2f8e34 Introduce fdclose() which will clean an entry in a filedesc.
Replace homerolled versions with call to fdclose().

Make fdunused() static to kern_descrip.c
2004-11-07 22:16:07 +00:00
phk
cad3685bce Use fget_locked() instead of homerolled 2004-11-07 16:09:56 +00:00
phk
02a22fcc9e Move fdinit() related stuff from .h to .c 2004-11-07 15:34:45 +00:00
phk
418eb9d34b Allow fdinit() to be called with a NULL fdp argument so we can use
it when setting up init.

Make fdinit() lock the fdp argument as needed.
2004-11-07 12:39:28 +00:00
njl
d8a46083bd Add comments to clarify why we need to run shutdown code on the BSP, update
an old comment about boot() being MI, and note that splhigh() no longer
disables interrupts.
2004-11-07 06:58:45 +00:00
phk
296b8c7706 When we open /dev/null for stdin/out/err for safety reasons, do it right:
we should preserve f_data and f_ops if they are already set.
2004-11-06 23:36:09 +00:00
phk
723cc1105c Properly implement a default version of VOP_GETWRITEMOUNT.
Remove improper access to vop_stdgetwritemount() which should and
will instead rely on the VOP default path.
2004-11-06 11:41:22 +00:00
phk
e582d20cf5 Increase default HZ for i386 to 1000 2004-11-06 11:33:43 +00:00
alc
4030274372 Move a call to wakeup() from vm_object_terminate() to vnode_pager_dealloc()
because this call is only needed to wake threads that slept when they
discovered a dead object connected to a vnode.  To eliminate unnecessary
calls to wakeup() by vnode_pager_dealloc(), introduce a new flag,
OBJ_DISCONNECTWNT.

Reviewed by: tegge@
2004-11-06 05:33:02 +00:00
davidxu
ab5ce77983 Respect TDF_SINTR, don't suspend uninterruptible thread. 2004-11-05 22:40:33 +00:00
davidxu
b917394798 Backout previous commit, the P_STOPPED_BOUNDARY flag was already
cleared at the begin of thread_single() when needed.
2004-11-05 22:31:20 +00:00
jhb
080b7e2408 - Store threads on sleep queues in FIFO order rather than sorted by
priority.  The sleep queues don't get updated when the priority of
  threads changes, so sleepq_signal() might not always wakeup the
  highest priority thread.  Updating the queues when thread priorities
  change cannot be easily done due to lock orders, so instead we do an
  O(n) walk of the queue for a sleepq_signal() operation instead of O(1).
  On the other hand, adding a thread to a sleep queue now goes from O(n)
  to O(1) so it ends up as an even tradeoff.  The correctness here with
  regards to priorities is actually fairly important.  msleep() gives
  interactive threads their priority "boost" after they are placed on the
  queue, but before this fix that "boost" wasn't used to determine the
  highest priority thread that sleepq_signal() awoke.
- Fix up some comments.

Inspired by:	ups, bde
2004-11-05 20:19:58 +00:00
jhb
c19696c197 - Make setting of IT_ENTROPY a bit simpler in ithread_update().
- Tweak the updating of the ithread name in ithread_update() so that the
  '+' and '*' characters for device names that were too short only get
  added at the end after as many device names as possible were fit into
  the allocated space.  Prior to this, some long devices would result
  in '+' chars showing up between two different devices rather than at the
  end.
2004-11-05 19:11:24 +00:00
peter
262d759361 Restrict the sched_bind to cpu 0 to i386 and amd64 for now. I forgot that
alpha still doesn't use logical cpu id's.
2004-11-05 19:00:23 +00:00
peter
667f6bfd57 Bind to cpu0 for boot() processing. (Note this is reboot, not startup)
This means we'll always call the event hooks, device_shutdown etc on the
BSP and theoretically means we can de-cruftify the cpu_reset_proxy stuff.
2004-11-05 18:29:10 +00:00
alc
2f382957a7 Two changes to vm_pgmoveco():
- Eliminate an initialized but unused variable.
 - Eliminate an unnecessary call to clear the page's PG_BUSY flag.  (The
   call to vm_page_rename() already clears the page's PG_BUSY flag through
   its call to vm_page_remove().)
2004-11-05 06:52:29 +00:00
davidxu
bc6688df2f Don't forget to turn off P_SINGLE_BOUNDARY for thread_single(SINGLE_EXIT),
otherwise a threaded process which calls execv() will hang in kernel and
may can not be killed!
2004-11-04 22:13:16 +00:00
phk
e5715b2cc1 Retire b_magic now, we have the bufobj containing the same hint. 2004-11-04 09:48:18 +00:00
phk
e9aa533e84 Change buf->b_object to buf->b_bufobj->bo_object
some whitespace fixes.
2004-11-04 09:06:54 +00:00