Commit Graph

50237 Commits

Author SHA1 Message Date
peter
7f88af1f93 Raise MAXDSIZ from 8G to 32G. The old limit was just an arbitary choice
that was greater than 4G.  I originally used the same values as i386 in
order to save opening a new PML4 page slot, but in the day of gigabytes
of memory, worrying about a 4K page seems futile.  Moving from 8 to 32G
moves the page to a different index, it doesn't increase the number of
pages used.
2004-10-27 17:21:15 +00:00
phk
56a7ee8e7f Move the syncer linkage from vnode to bufobj.
This is not quite a perfect separation: the syncer still think it knows
that everything is a vnode.
2004-10-27 08:05:02 +00:00
phk
f3795e5212 Eliminate unnecessary KASSERTs.
Don't use bp->b_vp in VOP_STRATEGY: the vnode is passed in as an argument.
2004-10-27 06:48:21 +00:00
phk
e5378319aa Eliminate unnecessary KASSERT.
Eliminate a printf which would never tell us anything anyway because the
KASSERT would have triggered.
2004-10-27 06:47:00 +00:00
phk
9d1a8435a9 Avoid using bp->b_vp when we already have the vnode by other means. 2004-10-27 06:45:52 +00:00
phk
a75ad58326 Eliminate unnecessary KASSERTS. 2004-10-27 06:45:06 +00:00
maxim
2425dcbcaa Fix a typo in a comparison appeared in rev. 1.125.
Submitted by:	JINMEI Tatuya
2004-10-27 05:37:58 +00:00
alc
2ed479ab98 Synchronize access to the vm page's PG_BUSY flag using the containing vm
object's lock.  In the same place, eliminate unnecessary checks for a NULL
vm object pointer.
2004-10-27 02:05:00 +00:00
le
d0679d2fde Give each plex a separate queue where held back bios are put on.
This lowers the CPU usage of the worker thread and prevents a
possible live lock on non-SMP machines.

MFC candidate.
2004-10-26 21:01:42 +00:00
phk
2678190fba KASSERT that we only get to prewrite() on writes. 2004-10-26 20:13:49 +00:00
phk
08b5d8832a White space changes. Add missing static. 2004-10-26 20:13:21 +00:00
phk
5e6094204e Replace single case switch() with if(). 2004-10-26 20:12:25 +00:00
phk
7cd4756a3b Vertically align comment. 2004-10-26 20:12:00 +00:00
phk
77a9300f94 Remove blank line which crept in. 2004-10-26 20:11:27 +00:00
phk
1b27d1d3b9 Also check that the sectormask is bigger than zero.
Wrap this overly long KASSERT and remove newline.
2004-10-26 19:51:57 +00:00
bms
7f25933194 Workaround for a recursive acquisition of the driver mutex during device
detach; triggered by ether_ifdetach() -> if_delmulti() -> vr_ioctl().
MFC candidate.

PR:		kern/62889
MFC after:	3 days
2004-10-26 19:49:45 +00:00
des
313e249d9e Uncomment DIRECTIO and NSWBUF_MIN. They are both positive options (i.e.
they enable rather than disable code), so they should be on in LINT.
2004-10-26 12:20:57 +00:00
phk
fd2239c999 The island council met and voted buf_prewrite() home.
Give ffs it's own bufobj->bo_ops vector and create a private strategy
routine, (currently misnamed for forwards compatibility), which is
just a copy of the generic bufstrategy routine except we call
softdep_disk_prewrite() directly instead of through the buf_prewrite()
indirection.

Teach UFS about the need for softdep_disk_prewrite() and call the
function directly in FFS.

Remove buf_prewrite() from the default bufstrategy() and from the
global bio_ops method vector.
2004-10-26 10:44:10 +00:00
phk
274ea3ac53 Fix syntax errors introduced by last commit.
Why isn't DIRECTIO in NOTES/LINT ?
2004-10-26 09:04:20 +00:00
rwatson
70db0bbc92 Add a matching tunable for net.inet.tcp.sack.enable sysctl. 2004-10-26 08:59:09 +00:00
phk
c66aa10c8e Put the I/O block size in bufobj->bo_bsize.
We keep si_bsize_phys around for now as that is the simplest way to pull
the number out of disk device drivers in devfs_open().  The correct solution
would be to do an ioctl(DIOCGSECTORSIZE), but the point is probably mooth
when filesystems sit on GEOM, so don't bother for now.
2004-10-26 07:39:12 +00:00
alc
343104d2b1 Hold the lock on the containing vm object when calling
vm_page_sleep_if_busy().
2004-10-26 06:58:26 +00:00
phk
630e140f65 Remove unused si_bsize_best field from struct cdev. 2004-10-26 06:53:00 +00:00
phk
e0db6b548c Degeneralize the per cdev copyonwrite callback. The only possible value
is ffs_copyonwrite() and the only place it can be called from is FFS which
would never want to call another filesystems copyonwrite method, should one
exist, so there is no reason why anything generic should know about this.
2004-10-26 06:25:56 +00:00
phk
ce49e5f19e Align comment 2004-10-26 06:15:39 +00:00
phk
76b805d6f4 Don't clear flags we just checked were not set. 2004-10-26 05:57:29 +00:00
bms
53c873427a Check that rt_mask(rt) is non-NULL before dereferencing it, in the
RTM_ADD case, thus avoiding a panic.

Submitted by:	Iasen Kostov
2004-10-26 03:31:58 +00:00
andre
4bbe5a2c0f IPDIVERT is a module now and tell the other parts of the kernel about it.
IPDIVERT depends on IPFIREWALL being loaded or compiled into the kernel.
2004-10-25 20:02:34 +00:00
alc
50d63268a9 Assert that the containing vm object is locked in vm_page_flash(). 2004-10-25 19:52:44 +00:00
obrien
7a008b17d1 Don the teflon coated jacket and use the same -O2 optimization options on
the 'i386' kernel that we do all our 64-bit kernels.
2004-10-25 18:24:39 +00:00
jmg
6cd4381f71 use NULL instead of 0 when casting/comparing w/ a pointer... 2004-10-25 17:04:40 +00:00
phk
7f97dbd113 Get rid of the magic "stash" of cdev structures, we no longer call
make_dev() before malloc works.
2004-10-25 13:12:06 +00:00
phk
fc5bad60e3 Use unit number allocation functions for GEOM minor numbers. 2004-10-25 12:28:28 +00:00
phk
064b8877b8 Add delete_unrhdr() function.
It will fail fatally if all allocated numbers have not been returned first.
2004-10-25 12:27:03 +00:00
yongari
4feceb845b Device driver for onboard CS4231 audio controller which is found
on UltraSPARC workstations. The driver is based on OpenBSD's SBus
cs4231 driver and heavily modified to incorporate into sound(4)
infrastructure. Due to the lack of APCDMA documentation, the DMA
code of SBus cs4231 came from OpenBSD's driver.
The driver runs without Giant lock and supports both SBus and EBus
based CS4231 audio controller. Special thanks to marius for providing
feedbacks during the driver writing. His feedback made it possible
to write hiccup free playback code under high system loads.

Approved by:	jake (mentor)
Reviewed by:	marius (initial version)
Tested by:	marius, kwm, Julian C. Dunn(jdunn AT opentrend DOT net)
2004-10-25 10:29:57 +00:00
phk
0e87ab8bc6 Loose the v_dirty* and v_clean* alias macros.
Check the count field where we just want to know the full/empty state,
rather than using TAILQ_EMPTY() or TAILQ_FIRST().
2004-10-25 09:14:03 +00:00
phk
3a8a530155 Remove vnode->v_bsize. This was a dead-end. 2004-10-25 07:50:59 +00:00
phk
5065a91152 Retire si_stripesize and si_stripeoffset they will not be needed in cdev
in the future.
2004-10-25 07:40:54 +00:00
alc
c0959741f7 Use VM_ALLOC_NOBUSY to eliminate vm_page_wakeup() calls and the acquisition
and release of the global page queues lock required to make the call.

Remove GIANT_REQUIRED from vm_hold_free_pages().  All of its VM operations
are properly synchronized.
2004-10-25 06:34:14 +00:00
phk
4ba53ec41b Collapse vnode->v_object and buf->b_object into bufobj->bo_object. 2004-10-25 06:02:57 +00:00
alc
774f792bae Assert that the containing vm object is locked in vm_page_busy() and
vm_page_wakeup().
2004-10-24 23:53:47 +00:00
rwatson
d961169e94 Move from using the socket reference count to the file reference
count to prevent sockets from being garbage collected during
socket-specific system calls.  This is the same approach used in
most VFS-specific system calls, as well as generic file descriptor
system calls such as read() and write().

To do this, add a utility function getsock(), which is logically
identical to getvnode() used for the same purpose in VFS.  Unlike
fgetsock(), it returns with the file reference count elevated, but
no bump of the socket reference count.  Replace matching calls to
fputsock() with fdrop().

This change is made to all socket system calls other than
sendfile() and accept(), but the approach should be applicable to
those system calls also.

This shaves about four mutex operations off of each of these
system calls, including send() and recv() variants, adding about
1% to pps on minimal UDP packets for UP using netblast, and 4% on
SMP.

Reviewed by:	pjd
2004-10-24 23:45:01 +00:00
alc
e24e0aa793 Use VM_ALLOC_NOBUSY instead of calling vm_page_wakeup(). 2004-10-24 20:09:59 +00:00
phk
1b25a59886 Move the buffer method vector (buf->b_op) to the bufobj.
Extend it with a strategy method.

Add bufstrategy() which do the usual VOP_SPECSTRATEGY/VOP_STRATEGY
song and dance.

Rename ibwrite to bufwrite().

Move the two NFS buf_ops to more sensible places, add bufstrategy
to them.

Add inlines for bwrite() and bstrategy() which calls through
buf->b_bufobj->b_ops->b_{write,strategy}().

Replace almost all VOP_STRATEGY()/VOP_SPECSTRATEGY() calls with bstrategy().
2004-10-24 20:03:41 +00:00
mlaier
a18af33877 Fix a panic discovered with some apache2 configure test (that seemed to
trigger a socket creation race some some kind). Checking for non-NULL socket
and credential is not a bad idea anyway. Unfortunatly too late for the
release.

Reported & tested by:	Gilbert Cao
MFC after:		2 weeks
2004-10-24 19:35:02 +00:00
alc
0041f5bef4 Acquire the vm object lock before rather than after calling
vm_page_sleep_if_busy().  (The motivation being to transition
synchronization of the vm_page's PG_BUSY flag from the global page queues
lock to the per-object lock.)
2004-10-24 19:32:19 +00:00
alc
17eb61eeb6 Use VM_ALLOC_NOBUSY instead of calling vm_page_wakeup(). 2004-10-24 18:46:32 +00:00
ru
5db2b9d5b3 For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
simokawa
feac68dce9 - Use quad_t for dcons buffer address and size.
- Allow read/write access to dcons buffer passed by loader(8).
2004-10-24 12:41:04 +00:00
simokawa
5c26c7535f Preserve dcons(4) buffer passed by loader(8). 2004-10-24 12:37:47 +00:00
ru
5548c1bc7a Collapse several adjacent .if's into .if/.elif. 2004-10-24 12:32:41 +00:00
nyan
0a4bbdbd31 ELF64 support is not needed on pc98. 2004-10-24 12:18:11 +00:00
nyan
7e8cc3ff98 MFi386: revision 1.4. 2004-10-24 12:16:18 +00:00
nyan
39595f1f47 MFi386: Set bi_basemem and bi_extmem variables.
Respect RB_MULTIPLE flag.
2004-10-24 12:15:07 +00:00
nyan
849321f886 MFi386: Add support for preloading ELF relocatable object format modules. 2004-10-24 12:14:05 +00:00
nyan
12f2a1322c Disable ed1 - ed12. 2004-10-24 12:07:02 +00:00
rse
3efdfbe8d6 Add identifiers for the HP Laserjet 2300d USB
printer and the HP ScanJet 4670v USB scanner.

MFC after:	1 week
2004-10-24 11:16:29 +00:00
scottl
3f4ffafdb8 Fix some warnings that only triggered in LINT. 2004-10-24 09:23:07 +00:00
scottl
ae662d81f3 Hook the hptmv driver up to the build. 2004-10-24 08:53:40 +00:00
scottl
16c58cc2c4 Embed the correct name. 2004-10-24 08:48:32 +00:00
scottl
3fd282d467 Clean up some messy Makefile stuff so that this can be built into the
kernel.
2004-10-24 08:38:29 +00:00
ru
7c32b1fe31 Hack around a problem with sys/tools/usbdevs2h.awk that generates
both usbdevs.h and usbdevs_data.h.  (The latter was not cleaned.)
2004-10-24 08:26:48 +00:00
ru
2e2bd36810 Curlies only work in target and sources specifications, but
not when passed to Bourne shell.  This unbreaks "make clean".
2004-10-24 07:54:44 +00:00
alc
63406cbbf6 Use VM_ALLOC_NOBUSY to eliminate an unneeded vm_page_wakeup() call and the
synchronization that one entails.
2004-10-24 07:31:07 +00:00
alc
15e3b9f750 Avoid repeated acquisition and release of the vm object lock inside of
two loops in agp_generic_bind_memory().  As an intended side-effect, all
of the calls to vm_page_wakeup() are now performed with the containing
vm object lock held.
2004-10-24 07:12:13 +00:00
ru
f411c99481 Sort SUBDIR. 2004-10-24 06:22:16 +00:00
alc
faeb949021 Introduce VM_ALLOC_NOBUSY, an option to vm_page_alloc() and vm_page_grab()
that indicates that the caller does not want a page with its busy flag set.
In many places, the global page queues lock is acquired and released just
to clear the busy flag on a just allocated page.  Both the allocation of
the page and the clearing of the busy flag occur while the containing vm
object is locked.  So, the busy flag might as well never be set.
2004-10-24 06:15:36 +00:00
scottl
7a9167aadd Import the HighPoint RocketRAID 182x driver. Thanks to HighPoint for
providing the original driver, and thanks to IronSystems for providing
hardware for testing.
2004-10-24 05:37:23 +00:00
phk
80dc3e1bc2 Don't call g_waitidle(), it happens automagically now. 2004-10-23 20:52:15 +00:00
phk
c93e5e1f96 Don't explicitly call g_waitidle(), it happens automagically now. 2004-10-23 20:50:06 +00:00
phk
93429f2778 Add a new per-thread private flag: TDP_GEOM.
This flag gets set whenever the thread posts an event on the GEOM
event queue, and if the flag is set when the thread is prepared
to return to userland from the kernel, g_waitidle() will be called
to make sure that the posted events have completed.

This can replace an insufficient number of g_waitidle() calls in
various other places, and has the advantage of being failsafe:  Any
system call which does a VOP_OPEN()/VOP_CLOSE will now correctly
wait for any geom events it posted as part of spoils or tastes.

Assert that topology and Giant is not held in g_waitidle().
2004-10-23 20:49:17 +00:00
phk
00ae1b0f02 Move the prototype for g_waitidle() to a more visible place. 2004-10-23 20:22:02 +00:00
phk
0317bd247e Drop Giant around the call to g_waitidle().
This is necessary to allow any geom events which need it to pick up Giant.
2004-10-23 20:21:05 +00:00
rwatson
e095dbaea3 Rebuild from FreeBSD32 syscalls.master:1.42. 2004-10-23 20:05:42 +00:00
rwatson
8bec59acae 32-bit FreeBSD ABI compatibility stubs from syscalls.master:1.178. 2004-10-23 20:04:56 +00:00
rwatson
01d196c132 Rebuild from syscalls.master:1.178. 2004-10-23 20:01:32 +00:00
rwatson
ef214ac3ad Add system call place-holders for the following system calls
implementing Sun's BSM Audit API on FreeBSD:

  audit()
  auditon()
  getauid()
  setauid()
  getaudit()
  setaudit()
  getaudit_addr()
  setaudit_addr()
  auditctl()

Submitted by:	Wayne Salamon <wsalamon at computer dot org>
Obtained from:	TrustedBSD Project
2004-10-23 20:00:43 +00:00
andre
5b45ea9068 socreate() does an early abort if either the protocol cannot be found,
or pru_attach is NULL.  With loadable protocols the SPACER dummy protocols
have valid function pointers for all methods to functions returning just
EOPNOTSUPP.  Thus the early abort check would not detect immediately that
attach is not supported for this protocol.  Instead it would correctly
get the EOPNOTSUPP error later on when it calls the protocol specific
attach function.

Add testing against the pru_attach_notsupp() function pointer to the
early abort check as well.
2004-10-23 19:06:43 +00:00
andre
1422b332e1 Aquire GIANT in pf_proto_[un]register() before manipulating the protosw. 2004-10-23 18:52:06 +00:00
rwatson
c00410266c /%x/%s/ -- mismerged DEBUGGER() printf() format stirng from the
TrustedBSD branch.

Submitted by:	bde
2004-10-23 15:12:34 +00:00
phk
5ff1936d8d use bioq_takefirst() 2004-10-23 12:45:39 +00:00
phk
36d79a570a Use bioq_takefirst() 2004-10-23 12:44:19 +00:00
davidxu
45aef9e6ad Remove P_STOPPED_TRACE bit if debugger dies without a chance to
detach debugged process.
2004-10-23 11:20:26 +00:00
rwatson
b8f5639e79 Add some basic KTR tracing to busdma on i386. This is likely not
the final set of traces -- someone with more busdma background
will probably want to review and expand this, as well as port to
other platforms.  This tracing is sufficient to identify key
busdma events on i386, and in particular to draw attention to
bounce buffering events that may have a substantial performance
impact.
2004-10-23 10:34:27 +00:00
mtm
6b252d3637 Locking cleanups to remove the need for a recursive mutex
o Instead of locking and unlocking all over the place, use
	  lock assertions to make certain that the bfe lock is held
	  where necessary.
	o Create locked and unlocked versions of bfe_init and bfe_start. These
	  functions can be called from outside the module and by functions
	  within the bfe module. The calls from outside the module don't
	  hold the bfe lock so the unlocked versions called by these functions
	  simple obtain the bfe lock and call the locked version.

- Fix a typo (scp) in the locking macros that only worked because in all the
  instances in which it was called the softc pointer happened to be named 'sc'.

- Mark the interrupt MPSAFE

Tested by: matusita, Dario Freni <saturnero@gufi.org>
Silence from: -net, wpaul
2004-10-23 08:33:10 +00:00
arr
b510c7b809 - Turn KASSERT()s into warning printf()'s in the g_class_load() routine.
This removes a panic that will occur if you build with GENERIC and
  attempt to kldload a GEOM module that is already in the kernel.

Reviewed by: phk
2004-10-22 22:16:24 +00:00
andre
a8987888fb Shave 40 unused bytes from struct tcpcb. 2004-10-22 19:55:04 +00:00
andre
42e8443fa1 When printing the initialization string and IPDIVERT is not compiled into the
kernel refer to it as "loadable" instead of "disabled".
2004-10-22 19:18:06 +00:00
andre
7c8480e7f1 Refuse to unload the ipdivert module unless the 'force' flag is given to kldunload.
Reflect the fact that IPDIVERT is a loadable module in the divert(4) and ipfw(8)
man pages.
2004-10-22 19:12:01 +00:00
phk
976462622a Properly handle failure to allocate isadma bounce buffer 2004-10-22 19:01:10 +00:00
njl
addc11daaf Remove a "needs Giant" flag from the /dev/apm compat device.
MFC after:	2 weeks
2004-10-22 17:17:12 +00:00
simokawa
d731e713ca Respect _BOOT flag. 2004-10-22 15:39:39 +00:00
simokawa
251f5975d3 Check _BOOT flag. 2004-10-22 15:03:22 +00:00
simokawa
115129ef7c Respect RB_MULTIPLE flag. 2004-10-22 14:57:28 +00:00
simokawa
8c6d777474 - Add FireWire subclass and OHCI interface.
- Add some PCI BIOS function calls.
	(find_devclass, read_config, write_config)
2004-10-22 14:56:23 +00:00
rwatson
fe8ddb95e0 Add an annotation to the comment for sysv_ipc.c to indicate that the
MAC Framework doesn't require checks in ipcperm() because checks
relating to System V IPC will be performed in individual IPC
implementations.
2004-10-22 12:12:40 +00:00
rwatson
00f1836c10 In osethostname(), don't need to call suser() directly as
userland_sysctl() will perform all necessary privilege checks for
the caller.
2004-10-22 12:10:50 +00:00
rwatson
9ca72eac8f Expand comments on various sections of the MAC Framework Policy API,
as well as document the properties of the mac_policy_conf structure.
Warn about the ABI risks in changing the structure without careful
consideration.

Obtained from:	TrustedBSD Project
Sponsored by:	SPAWAR
2004-10-22 11:29:30 +00:00
rwatson
3da3030dca Replace direct reference to kdb_enter() with a DEBUGGER() macro that
will call printf() if KDB isn't compiled into the kernel.

Obtained from:	TrustedBSD Project
Sponsored by:	SPAWAR
2004-10-22 11:24:50 +00:00
rwatson
0bd499671d Minor white space synchronization and line wrapping. 2004-10-22 11:15:47 +00:00