Distribute all but the most fundamental malloc types. This time I also
remembered the trick to making things static: Put "static" in front of
them.
A couple of finer points by: bde
much grieve to owners of IBM drives when used in conjunction with
tagged command queuing, and didn't serve any purpose at all (since
experiments have proven that it simply didn't work).
Instead, call scsi_start_unit() once in sd_attach(), so in case the
drive has been configured to `remote start', it will spin up there.
(If it has spun down later, it must have been because of administrator
action (scsi(8)) anyway.)
While i was at it, bump the timeout for scsi_start_unit() to 30
seconds. 10 seconds were way too few for most drives.
the struct kmemstats that describes the type.
This allows subsystems to declare their malloc types locally
and <sys/malloc.h> doesn't need tweaked everytime somebody
gets an idea. You can even have a type local to a lkm...
I don't know if we really need the longdesc, comments welcome.
TODO: There is a single nit in ext2fs, that will be fixed later,
and I intend to remove all unused malloc types and distribute
the rest closer to their use.
now corrected. New tunables/instrumentation added. The code is now
likely "good enough to use." I will add the userland support soon.
The "high performance" mode for raw devices is still missing, and will
be added next. POSIX system calls that now appear to work:
aio_cancel, aio_error, aio_read, aio_return, aio_suspend, aio_write,
lio_listio. Missing, but to be added soon: aio_fsync.
has a PS/2 port, this is a good thing. Note, older 386/486 boxes may
lockup the keyboard controller with this enabled, but most of these kinds
of machines don't run -current, so the benefits outweigh the downsides.
Discussed with: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
represent in the TCP header. The old code did effectively:
win = min(win, MAX_ALLOWED);
win = max(win, what_i_think_i_advertised_last_time);
so if what_i_think_i_advertised_last_time is bigger than can be
represented in the header (e.g. large buffers and no window scaling)
then we stuff a too-big number into a short. This fix reverses the
order of the comparisons.
PR: kern/4712
Introduce the SIOC[SG]IFGENERIC hooks that can be used to pass an
arbritrary ioctl subcommand into an interface driver. Surprisingly
enough, there was no provision for this already present (except of the
option of abusing SIOC[SG]IFMEDIA for this).
The idea is that an interface driver can establish ioctl subcommands
of its own that can't be meaningfully interpreted by the upper layer
interface ioctl function. Something like this is required to
implement a clean solution of passing down things like CHAP secrets or
PPP options to the /sys/net/if_sppp* files. (Yes, my CHAP is now
finally working with it, but i gotta update my kernel to the new
callout interface before being able to commit _that_.)
Reviewed by: peter [long ago, actually]
arbritrary ioctl subcommand into an interface driver. Surprisingly
enough, there was no provision for this already present (except of the
option of abusing SIOC[SG]IFMEDIA for this).
The idea is that an interface driver can establish ioctl subcommands
of its own that can't be meaningfully interpreted by the upper layer
interface ioctl function. Something like this is required to
implement a clean solution of passing down things like CHAP secrets or
PPP options to the /sys/net/if_sppp* files. (Yes, my CHAP is now
finally working with it, but i gotta update my kernel to the new
callout interface before being able to commit _that_.)
Reviewed by: peter [long ago, actually]
This driver includes the following patches submitted by:
1.0 Hideyuki Suzuki <hideyuki@sat.t.u-tokyo.ac.jp>
Japanese Cable support
2.0 Keith Sklower <sklower@CS.Berkeley.EDU>
Minor update to the BSDI section so it compiles cleanly on BSDI
3.0 Joao Carlos Mendes Luis <jonny@coppe.ufrj.br>
ioctl interface to select video format , NTSC, PAL, etc...
of the system to be rebuilt anyway, this is a good time to introduce
LOG_NTP.
The reasoning for a separate facility is that xntpd can sometimes
cause exaggerative log message at high prioritites which are,
depending on your environment and available clock sources, not
necessarily as important as other LOG_DAEMON messages. However, they
used to clutter log files and system console in the existing setup.
Note that this situation could not be resolved using the !xntpd option
(think about it).
xntpd(8) is supposed to automatically pick up the change, it had
already all necessary #ifdef's.
The chosen value does, as far as my inquiries yielded, not clash with
any other operating system.
pointy hat last? :-]
When one is selecting (or polling) for write, it helps if we use the
write side of the pipe when requesting wakeups instead of the read side.
This broke ghostview (at least) - I'm suprised it wasn't noticed for
so long.
Reviewed by: Greg Lehey <grog@lemis.com>
- CPU_CYRIX_NO_LOCK enables weak locking. If this option is not set and
FAILESAFE is defined, NO_LOCK bit of CCR1 is cleared.
- CPU_WT_ALLOC enables write-through allocation.
sysctl option 'fakes' like a card was removed and inserted when the
machine is brought up again from a suspend. It is disabled by default,
and the old code is used.
Obtained from: PAO
speaker. Cirrus Logic PCIC chips must enable this. There is also a Low
Power Dynamic Mode bit that claims to reduce power consumption by 30%,
so enable it and hope for the best.
PR: 4650
Submitted by: Nick Sayer <nsayer@quack.kfu.com>
instead of the first available, like Win95 does. This appears to help
on some machines, and avoids potential problems with built-in serial
ports which tend to live at IRQ 3, which is usually picked with the
old method.
in a P6 SMP system. Some MB bios'es don't set the registers up correctly
for the AP's. Additionally, set the memory between 0xa0000 and 0xbffff
as write combining.
savers are also modified so that they behave in the same way as the
blank saver on MDA and CGA, although it's not the way these screen
savers are supposed to work, but fading monitor and tickling green
monitor cannot be done on MDA and CGA, AFAIK. So, this is the second
best solution.
As of this change, the current state of support of screen savers is
summarized in the following table.
MDA CGA EGA VGA
blank OK OK NA OK
daemon OK OK OK OK
fade * * NA OK
green * * NA OK
snake OK OK OK OK
star OK OK OK OK
OK: works
NA: doesn't work, the module cannot be loaded for this adapter.
*: behave the same way as the blank saver.
As you can see, EGA is left out for now. But, we can do no better, as
EGA registers cannot be read...
Reviewed by: sos
shown to be harmful in that it results in the card not being detected
properly on warmboot due to the station address failing to be read
correctly from the NVRAM.
RST's being ignored, keeping a connection around until it times out, and
thus has the opposite effect of what was intended (which is to make the
system more robust to DoS attacks).
much like the scancode mode.
However the keys that (for no good reason) returns extension codes
etc, are translated into singlebyte codes.
Needed by libvgl. This makes life ALOT easier, also the XFree86
folks could use this.
overruns (not that it was a problem, but it could be):
1) Doubled the number of receive buffers in the DMA chain to 64.
2) Do packet receive processing before transmit in the interrupt routine.
if it is in 10Mbps mode and gets certain types of garbage prior to
the packet header. The work-around involves reprogramming the
multicast filter if nothing is received in some number of seconds
(currently set at 15). As a side effect, implemented complete support
for multicasting rather than the previous 'receive all multicasts'
hack, since we now have the ability to program the filter table.
Fixed a serious bug which crept in with the timeout() changes;
the cookie was only saved on the first timeout() call in fxp_init()
and wasn't updated in the most common place in fxp_stats_update()
when the timeout was rescheduled. This bug would have resulted in
an eventual panic if fxp_stop() was called (which happens when any
interface flags are changed, for example).
Fixed a bug in Alpha support that would have caused the TxCB
descriptor chain to span a page boundry, causing serious problems
if the pages didn't happen to be contiguous.
Removed some gratuitous bit masking that was left over from an
older implementation.
Fixed a bug where too much was copied from the configuration
template, spilling over into memory that followed it.
Fixed handling of if_timer...it was cleared too early in some cases.
It seems I didn't count my 0's properly when adding the new masks into
icu_vector.s pushing SWI_AST_MASK off the end of the array and screwing
up the indexing for SWI_CLOCK_MASK.
Fix the bug icu_vector.s and also reformat the code in both icu_vector.s and
apic_vector.s so that it will be much harder to make the same mistake in
the future.
Submitted by: Bruce Evans <bde@zeta.org.au>
machine generates an NMI for each floating point error, just like an old XT.
Since it is ISA only, reading the EISA status port yields 0xff, which would
give a spurious EISA panic. The simplest thing to do is to ignore the 0xff.
operands that are set during seqeuncer program download instead of at
assembly time.
Remove the REJBYTE sram variable. The host driver can just as easly
read the accumulator to get this value.
This should fix the reported problems with cards that don't have devices
attached to them failing with a stream of "Somone reset bus X" messages.
Doug Ledford determined the cause of the problem, fixes by me.
operands that are set during seqeuncer program download instead of at
assembly time.
Convert the sequencer code to use" downloaded constants" for four run time
constants that vary depending on the board type. This frees up 4 bytes
of sequencer scratch ram space where these constants used to be stored and
also removes the additional instructions required to load their values
into the accumulator prior to using them.
Remove the REJBYTE sram variable. The host driver can just as easly
read the accumulator to get this value.
The scratch ram savings is important as the old code used to clober the
SCSICONF register on 274X cards which sits near the top of scratch ram
space. The SCSICONF register controls bus termination, and clobbering
it is not a good thing. Now we have 4 bytes to spare.
This should fix the reported problems with cards that don't have devices
attached to them failing with a stream of "Somone reset bus X" messages.
Doug Ledford determined the cause of the problem, fixes by me.
1. Clustered I/O is switched by the MNT_NOCLUSTERR and MNT_NOCLUSTERW
bits of the mnt_flag. The sysctl variables, vfs.foo.doclusterread
and vfs.foo.doclusterwrite are deleted. Only mount option can
control clustered I/O from userland.
2. When foofs_mount mounts block device, foofs_mount checks D_CLUSTERR
and D_CLUSTERW bits of the d_flags member in the block device switch
table. If D_NOCLUSTERR / D_NOCLUSTERW are set, MNT_NOCLUSTERR /
MNT_NOCLUSTERW bits will be set. In this case, MNT_NOCLUSTERR and
MNT_NOCLUSTERW cannot be cleared from userland.
3. Vnode driver disables both clustered read and write.
4. Union filesystem disables clutered write.
Reviewed by: bde
- some addition of comments (for readability)
- iso-2022 G0 designation support. This does almost nothing. Just for
avoiding garbled screen when got "ESC ( B".
(how about G1/2/3 designation? I'm not sure)
(usually a couple of thousand) to 25. The measured impact on cache-hits
doesn't justify spending memory this way:
Target number of free vnodes versus namecache hit rate in % during a
make world:
10 98.5316
200 98.5479
500 98.5546
1000 98.5709
3000 98.6006
4000 98.6126
report slightly more than 64MB of total memory. This can happen due to the
total being the sum of both base and extended memory.
Submitted by: Alan Cox <alc@cs.rice.edu>
hash chain traversal isn't needed. This also allows untimeout to recompute
the hash to find the bucket that the entry to remove is stored in so
that each callout entry no longer needs to store that information.
Reviewed by: Nate Williams <nate@mt.sri.com>
buffer queue so I missed this when I changed buf_queue_head.
This probably fixes Soren's problem too, but he never mentioned
which CD driver he was using. 8-)
Submitted by: dave adkins <adkin003@tc.umn.edu>
Change the definition of a buffer queue so that bufqdisksort can
properly deal with bordered writes.
Add inline functions for accessing buffer queues. This should be
considered an opaque data structure by clients.
callout.h:
New callout implementation.
device.h:
Add support for CAM interrupts.
disk.h:
disklabel.h:
tqdisksort->bufqdisksort
kernel.h:
Add new configuration entries for configuration hooks and calling
cpu_rootconf and cpu_dumpconf.
param.h:
Add a priority for sleeping waiting on config hooks.
proc.h:
Update for new callout implementation.
queue.h:
Add TAILQ_HEAD_INITIALIZER from NetBSD.
systm.h:
Add prototypes for cpu_root/dumpconf, splcam, splsoftcam, etc..
Add support for "interrupt driven configuration hooks".
A component of the kernel can register a hook, most likely
during auto-configuration, and receive a callback once
interrupt services are available. This callback will occur before
the root and dump devices are configured, so the configuration
task can affect the selection of those two devices or complete
any tasks that need to be performed prior to launching init.
System boot is posponed so long as a hook is registered. The
hook owner is responsible for removing the hook once their task
is complete or the system boot can continue.
kern_acct.c kern_clock.c kern_exit.c kern_synch.c kern_time.c:
Change the interface and implementation for the kernel callout
service. The new implemntaion is based on the work of
Adam M. Costello and George Varghese, published in a technical
report entitled "Redesigning the BSD Callout and Timer Facilities".
The interface used in FreeBSD is a little different than the one
outlined in the paper. The new function prototypes are:
struct callout_handle timeout(void (*func)(void *),
void *arg, int ticks);
void untimeout(void (*func)(void *), void *arg,
struct callout_handle handle);
If a client wishes to remove a timeout, it must store the
callout_handle returned by timeout and pass it to untimeout.
The new implementation gives 0(1) insert and removal of callouts
making this interface scale well even for applications that
keep 100s of callouts outstanding.
See the updated timeout.9 man page for more details.
Add cpu_rootconf and cpu_dumpconf so that configuring these
two devices can be better controlled by the MI configuration
code.
machdep.c:
MD initialization code for the new callout interface.
trap.c:
Add support for printing out whether cam interrupts are masked
during a panic.
plus the previous changes to use the zone allocator decrease the useage
of malloc by half. The Zone allocator will be upgradeable to be able
to use per CPU-pools, and has more intelligent usage of SPLs. Additionally,
it has reasonable stats gathering capabilities, while making most calls
inline.
the normal CS4326 except that it's had it's ID's tweaked for some reason)
Also mark the device as alive in the attach routine so that the pnp system
doesn't think the attach failed.
possible. (This is not really a typographical improvement in the
case of the K6 it seems, but AMD appearantly want it too look
that way). Also if bootverbose, dump some more info about the
chip.
of multiple PCI IDE controllers(Dyson), and some updates and cleanups from
John Hood, who originally made our IDE DMA stuff work :-).
I have run tests with 7 IDE drives connected to my system, all in DMA
mode, with no errors. Modulo any bugs, this stuff makes IDE look
really good (within it's limitations.)
Submitted by: John Hood <cgull@smoke.marlboro.vt.us>
rather than extracting the diff from Mark's patch, but it turns out that
I was freeing one allocation twice due to a previous cut/paste braino.
My botch, not Mark's.
Pointed out by: Mark Valentine <mv@pobox.com>
internal modems. Currently detects a USR modem, and a couple Supra
modems... vendor id's for sio capabile cards welcomed...
document new option EXTRA_SIO that will increase sio's internal data
structures to support X more serial ports... these are used by the
PnP part of sio for attaching... If you don't have it specified, it
will default to 2... This is defaulted to 0 if you don't have PnP
compiled into your kernel...
also document that if you set the PnP flags (pnp x flags y) to 0x1 that
the modem will be refused to be recognized by the sio driver... this
is for people that want the traditional isa driver to probe and attach
the modem... (for keeping legacy sio numbering)
these structs for conflics...
it still exist that two PnP cards can colide, but this is up to the user
to make sure it doesn't happen...
other modifications to pnp.c to format output properly, and hide more
output behind bootverbose flag...
fix some bugons in pnp.h that would of made it difficult for inclusion
in external programs (for import of pnpinfo)
1. ffs_alloc() actually allowed writing one block less one frag (normally
7 frags or 7/8 blocks) beyond the limit.
2. freebufspace() gives the free space in frags, but `size' is in bytes,
so the change results in approximately `size' fragments too many being
reserved.
3. ffs_realloccg() has the same bug but wasn't changed.
PR: 3398
Submitted by: bde
Eyeballed by: phk
number of dma overruns/underruns for systems under heavy dma load.
As a side effect, broken enhanced floppy controllers that sometimes
don't detect dma overruns/underruns will give less errors.
Reviewed by: j@uriah.heep.sax.de (J Wunsch)
Sorted some declarations.
Fixed missing __P(())'s.
Removed `timeout_func_t (pointer to timeout function) typedef. It was
mainly used in bogus casts. The more useful `timeout_t' (timeout function)
typedef should be used instead.
Cleaned up callout declarations and comments.
extern in <sys/malloc.h> and it should not have been staticized for
the !(KMEMSTATS || DIAGNOSTIC) case.
Fixed the !(KMEMSTATS || DIAGNOSTIC) case. The MALLOC() and FREE()
macros are evil, but code generally doesn't allow for this and some code
involving else clauses did not compile.
Finished staticization.
or a partition is larger than the slice.
Now `disklabel -Brw sdX auto' should fail properly on sliced disks
without partition of type 165, e.g., on zip disks with the factory
default formatting. Previously it set a bogus in-core label for
the compatibility slice and used this to corrupt the MBR (the slice
has offset 0 and size 0, but setting the label in effect corrupted
its size to nonzero).
`disklabel -Brw sdX auto' already failed properly on normally (not
dangerously dedicated) sliced disks _with_ partition of type 165,
because the compatibility slice has a nonzero offset so the MBR
remained inaccessible when the size was corrupted.
This bug only affected in-core labels. On-disk labels are checked
carefully when they read and written.
Hide the bogus FDC ``chip type'' display behind a (mostly) undocumented
option, since people started to trust the bogus claim. Once we're going
to handle 2.88 MB controllers, we have to redo the chip detection, by
now just leave it hidden.
A couple of stylistic nits from Bruce.
If your libc contains version 1.11 or 1.12 of getcwd.c, (ie: if
you recompiled libc one of the last couple of days):
>>> Recompile LIBC before you boot a new kernel <<<
A new libc will deal with both old and new kernels.
files.i386.
We aren't sure if this new code and the old sound code will co-exist in a
kernel, so the device pcm0 line is left commented out in LINT.
Submitted-by: Luigi Rizzo
was 0.
PR: 4164
Submitted by: Joe Traister <traister@mojozone.org>
While i was at it, also fixed a broken return value for the VT_RELDISP
ioctl, iff the third arg was legally VT_TRUE, but the destination
screen was in process mode so the actual switch had to be deferred.
This was breaking the ability to directly toggle between two X servers
running on two VTs, since the server getting the bogus error return
was running wild, and competing with the other one for the hardware.
(Sigh, this was a very long-standing bug.)
adapted from NetBSD.. However, there are some differences in the tty
system that are big enough to cause their code to not fit comfortably.
Obtained from: NetBSD (I think)
detail is passed back and forwards). This mostly came from NetBSD, except
that our interfaces have changed a lot and this funciton is in a different
part of the kernel.
Obtained from: NetBSD
The implementation is done (unlike what i've originally been
contemplating) by reparenting kids of processes that have the
appropriate bit set to PID 1, and let PID 1 handle the zombie. This
is far less problematical than what would seem to be ``doing it
right'', for a number of reasons.
Of our currently shipping PID-1-intended programs, 50 % fail the above
assumption. ;-) (Read this: sysinstall doesn't do it right. This is
no problem as long as no program called by sysinstall actually uses
SA_NOCLDWAIT.)
ToDo: . clarify the correct SA_* flag inheritance, compared
to other systems,
. decide whether the compat cruft (osigvec(9)) should
deal with new system additions or not,
. merge OpenBSD's SA_SIGINFO implementation. ;)
Reviewed by: bde
entry when handling a fault. This is set by procfs whenever it wants
to write to a page, as a means of overriding `r-x COW' entries, but
causes failures in the `rwx' case.
Submitted by: bde
large (over 4KB) softc struct. The descriptor array is accessed by
busmaster dma and must be physically contiguous in memory. malloc() of
a block greater than a page is only virtually contiguous, and not
necessarily physically contigious.
contigmalloc() could do this, but that is a bit on the overkill side.
I'm not sure of the origins of the problem report and diagnosis, I learned
of the problem via mail forwarded from Jim Shankland <jas@flyingfox.com>.
Jim said that Matt Thomas's workaround was to reduce the number of
transmit descriptors from 128 to 32, but I was concerned that it might
cost performance. Anyway, this change is my fault, not Jim's. :-)
Reviewed by: davidg