Commit Graph

886 Commits

Author SHA1 Message Date
Bruce Evans
d9927d1118 Eliminated i586_ctr_rate. Use i586_ctr_freq instead.
Changed i586_ctr_bias from long long to u_int.  Only the low 32 bits
are used now that microtime uses a multiplication to do the scaling.
Previously the high 32 bits had to match those of rdtsc() to prevent
overflow traps and invalid timeval adjustments.
1996-08-02 21:16:13 +00:00
Garrett Wollman
13f588f83e Add an fls() inline function which does the opposite operation to
ffs().  (That is to say, it searches in the opposite direction.)
1996-08-01 20:29:28 +00:00
Bruce Evans
85acc6887d Eliminated pcb_inl. It was always 0 because context switches don't occur
in interrupt handlers.
1996-07-31 12:36:11 +00:00
David Greenman
b1508c72f4 Converted timer/run queues to 4.4BSD queue style. Removed old and unused
sleep(). Implemented wakeup_one() which may be used in the future to combat
the "thundering herd" problem for some special cases.

Reviewed by:	dyson
1996-07-31 09:26:54 +00:00
Bruce Evans
3817d2ffa1 Fixed longstanding bug of not checking dumpdev' or setting dumplo'
early enough when the dump device is specified in the config file.

Removed stale comment about configuration root and swap devices.

Don't bother clearing dumplo when dumpdev is set to NODEV.  Everything
is controlled by dumpdev.

Fixed the kern.dumpdev sysctl.  Writes were handle bogusly.
1996-07-30 20:30:49 +00:00
Bruce Evans
33ded19fc2 Fixed the machdep.i8254_freq and machdep.i586_freq sysctls. Writes were
handled bogusly.

Centralized the setting of all the frequency variables.  Set these
variables atomically.  Some new ones aren't used yet.
1996-07-30 19:26:55 +00:00
John Dyson
67bf686897 Backed out the recent changes/enhancements to the VM code. The
problem with the 'shell scripts' was found, but there was a 'strange'
problem found with a 486 laptop that we could not find.  This commit
backs the code back to 25-jul, and will be re-entered after the snapshot
in smaller (more easily tested) chunks.
1996-07-30 03:08:57 +00:00
John Dyson
78d4346178 Fix a problem with a DEBUG section of code. 1996-07-29 14:22:46 +00:00
John Dyson
b7fb357273 Fix an error in statement order in pmap_remove_pages, remove the pmap
pte hint (for now), and general code cleanup.
1996-07-29 03:08:51 +00:00
John Dyson
da54aa7fc4 Fix a problem that pmap update was not being done for kernel_pmap. Also
remove some (currently) gratuitious tests for PG_V...  This bug could
have caused various anomolous (temporary) behavior.
1996-07-28 20:31:27 +00:00
John Dyson
4f4d35edf0 This commit is meant to solve a couple of VM system problems or
performance issues.

	1) The pmap module has had too many inlines, and so the
	   object file is simply bigger than it needs to be.
	   Some common code is also merged into subroutines.
	2) Removal of some *evil* PHYS_TO_VM_PAGE macro calls.
	   Unfortunately, a few have needed to be added also.
	   The removal caused the need for more vm_page_lookups.
	   I added lookup hints to minimize the need for the
	   page table lookup operations.
	3) Removal of some bogus performance improvements, that
	   mostly made the code more complex (tracking individual
	   page table page updates unnecessarily).  Those improvements
	   actually hurt 386 processors perf (not that people who
	   worry about perf use 386 processors anymore :-)).
	4) Changed pv queue manipulations/structures to be TAILQ's.
	5) The pv queue code has had some performance problems since
	   day one.  Some significant scalability issues are resolved
	   by threading the pv entries from the pmap AND the physical
	   address instead of just the physical address.  This makes
	   certain pmap operations run much faster.  This does
	   not affect most micro-benchmarks, but should help loaded system
	   performance *significantly*.  DG helped and came up with most
	   of the solution for this one.
	6) Most if not all pmap bit operations follow the pattern:
		pmap_test_bit();
		pmap_clear_bit();
	   That made for twice the necessary pv list traversal.   The
	   pmap interface now supports only pmap_tc_bit type operations:
	   pmap_[test/clear]_modified, pmap_[test/clear]_referenced.
	   Additionally, the modified routine now takes a vm_page_t arg
	   instead of a phys address.  This eliminates a PHYS_TO_VM_PAGE
	   operation.
	7) Several rewrites of routines that contain redundant code to
	   use common routines, so that there is a greater likelihood of
	   keeping the cache footprint smaller.
1996-07-27 03:24:10 +00:00
Satoshi Asami
92b4f2e0df Update to current state of PC98 world.
Submitted by:	The FreeBSD(98) development team
1996-07-23 07:46:59 +00:00
Joerg Wunsch
3135240845 Post-commit review by Bruce. Mostly stylistic changes.
Submitted by:	bde
1996-07-21 08:20:51 +00:00
Joerg Wunsch
99211adf2c Major cleanup of the timerX_{acquire,release} stuff. In particular,
make it more intelligible, improve the partially bogus locking, and
allow for a ``quick re-acquiration'' from a pending release of timer 0
that happened ``recently'', so it was not processed yet by clkintr().
This latter modification now finally allows to play XBoing over
pcaudio without losing sounds or getting complaints. ;-)  (XBoing
opens/writes/closes the sound device all over the day.)

Correct locking for sysbeep().

Extensively (:-) reviewed by:	bde
1996-07-20 18:47:23 +00:00
Bruce Evans
65d98215ea Fixed adjustment of `time' when timer0 is released. 27465 was 27645 in
a comment and in code that was only used when pcaudio was closed.  The
maximum error was 66 usec.
1996-07-17 11:26:05 +00:00
Nate Williams
20073b6d10 Moved declaration of zbuf outside of #ifdef DEVFS code. 1996-07-15 18:22:07 +00:00
Bruce Evans
6450111c1b Quick fix for previous commit: don't free zbuf on close since it may be
in use in another process that blocked in uiomove().
1996-07-15 05:23:04 +00:00
John Dyson
f381a0c010 Almost gratuitious improvement of the performance of reading
/dev/zero.
1996-07-14 06:05:53 +00:00
Bruce Evans
73571d2d9e Removed "optimization" using gcc's builtin memcpy instead of bcopy.
There is little difference now since the amount copied is large,
and bcopy will become much faster on some machines.
1996-07-12 07:18:12 +00:00
Bruce Evans
82ffff7ab3 Renamed upa to p0upa to match p0upt.
Cleaned up some comments.
1996-07-12 06:48:55 +00:00
Bruce Evans
3222e6db68 Export `dumpmag' to utilities but not to the kernel.
Restored a truncated comment.
1996-07-12 06:09:49 +00:00
Bruce Evans
f3460ead96 Fixed cloned comments about npx traps to match context. 1996-07-12 06:03:14 +00:00
Bruce Evans
0873c1f1c7 Fixed operand order for shld and shrd.
Finished the constant poisoning that was begun in rev.1.14.  Consts
aren't very poisonous (or useful) unless -Wcast-qual is in CFLAGS,
and it isn't in the default CFLAGS.
1996-07-12 04:40:21 +00:00
Bruce Evans
6ab46d52a5 Don't use NULL in non-pointer contexts. 1996-07-12 04:12:25 +00:00
Jordan K. Hubbard
0375cce8bc Merge. 1996-07-11 11:18:45 +00:00
Jordan K. Hubbard
9f5c1d518e Clean out some historical cruft. 1996-07-10 03:35:59 +00:00
Garrett Wollman
b184bc75f3 Fix something that's been bugging me for a long time: move the CPU
type identification code out of machdep.c and into a new file of its
own.  Hopefully other grot can be moved out of machdep.c as well
(by other people) into more descriptively-named files.
1996-07-08 19:44:39 +00:00
Bruce Evans
7baccf64d3 Fixed lots of warnings about unportable casts of pointers to volatile
variables: don't depend on the compiler generating atomic code to set
the variables - use inline asm to specify the atomic instruction(s)
explicitly.
1996-07-01 20:16:10 +00:00
Bruce Evans
a111a7f827 Moved declarations of non-cpu things from <machine/cpufunc.h> to better
places.
1996-07-01 18:12:24 +00:00
Bruce Evans
d2700ee639 Use the standard timer (interrupt) frequency while calibrating the clocks.
Testing with the high frequency of 20000 Hz (to find problems) only found
the problem that this frequency is too high for slow i386's.

Disable interrupts while setting the timer frequency.  This was unnecessary
before rev.1.57 and forgotten in rev.1.57.  The critical (i8254) interrupts
are disabled in another way at boot time but not in the sysctl to change
the frequency.
1996-07-01 18:00:47 +00:00
Joerg Wunsch
c683ac7c95 Enable ktrace by default, accompanied by a small reminder about the
implications (4 KB bloat, slight slowdown of syscalls).

Reviewed by:	freebsd-hackers
1996-06-30 09:39:29 +00:00
John Dyson
f43467241e When page table pages were removed from process address space, the
resident page stats were not being decremented.  This mode corrects
that problem.
1996-06-26 05:05:52 +00:00
Bruce Evans
c673fe98d7 Added #include of <machine/md_var.h>. This will be needed when
some declarations are moved from <machine/cpufunc.h> to better
places.
1996-06-25 20:31:01 +00:00
Bruce Evans
79df6d8597 trap.c:
Fixed profiling of system times.  It was pre-4.4Lite and didn't support
statclocks.  System times were too small by a factor of 8.

Handle deferred profiling ticks the 4.4Lite way: use addupc_task() instead
of addupc().  Call addupc_task() directly instead of using the ADDUPC()
macro.

Removed vestigial support for PROFTIMER.

switch.s:
Removed addupc().

resourcevar.h:
Removed ADDUPC() and declarations of addupc().

cpu.h:
Updated a comment.  i386's never were tahoe's, and the deferred profiling
tick became (possibly) multiple ticks in 4.4Lite.

Obtained from:	mostly from NetBSD
1996-06-25 20:02:16 +00:00
Bruce Evans
93f4b1bf1b Save John Polstra's initial fix for profiling for reference. The
multiplication in addupc() overflowed for addresses >= 256K, assuming
the usual profil(2) scale parameter of 0x8000.  addupc() will go away
soon.

Submitted by:	John Polstra <jdp@polstra.com>
1996-06-25 19:25:25 +00:00
John Dyson
cb87c9be58 Limit the scan for preloading pte's to the end of an object. 1996-06-25 00:39:21 +00:00
David Greenman
1293685583 Properly account for non-page aligned buffers. 1996-06-20 08:07:30 +00:00
David Greenman
ac269d78be Minor KNF formatting change to vmapbuf() and vunmapbuf(). 1996-06-20 01:47:21 +00:00
John Dyson
0157d6d925 Clean up vmapbuf and vunmapbuf significantly. The previous code was
very rough.
1996-06-19 03:39:24 +00:00
Bruce Evans
9b2b0822b7 Removed unused #includes of <i386/isa/icu.h> and <i386/isa/icu.h>. icu.h
is only used by the icu support modules and by a few drivers that know
too much about the icu (most only use it to convert `n' to `IRQn').  isa.h
is only used by ioconf.c and by a few drivers that know too much about
isa addresses (a few have to, because config is deficient).
1996-06-18 01:22:40 +00:00
Bruce Evans
16263f7a8b In getit(), use read_eflags()/write_eflags() to preserve the interrupt
enable flag instead of enable_intr() to restore it to its usual state.
getit() is only called from DELAY() so there is no point in optimising
its speed (this wasn't so clear when it was extern), and using
enable_intr() made it inconvenient to call DELAY() from probes that need
to run with interrupts disabled.
1996-06-17 12:50:22 +00:00
John Dyson
ef743ce6ed Several bugfixes/improvements:
1) Make it much less likely to miss a wakeup in vm_page_free_wakeup
	2) Create a new entry point into pmap: pmap_ts_referenced, eliminates
	   the need to scan the pv lists twice in many cases.  Perhaps there
	   is alot more to do here to work on minimizing pv list manipulation
	3) Minor improvements to vm_pageout including the use of pmap_ts_ref.
	4) Major changes and code improvement to pmap.  This code has had
	   several serious bugs in page table page manipulation.  In order
	   to simplify the problem, and hopefully solve it for once and all,
	   page table pages are no longer "managed" with the pv list stuff.
	   Page table pages are only (mapped and held/wired) or
	   (free and unused) now.  Page table pages are never inactive,
	   active or cached.  These changes have probably fixed the
	   hold count problems, but if they haven't, then the code is
	   simpler anyway for future bugfixing.
	5) The pmap code has been sorely in need of re-organization, and I
	   have taken a first (of probably many) steps.  Please tell me
	   if you have any ideas.
1996-06-17 03:35:40 +00:00
Joerg Wunsch
9306343284 Explain the options for the `od' driver. 1996-06-16 20:04:47 +00:00
Satoshi Asami
ad63a118b2 The Great PC98 Merge.
All new code is "#ifdef PC98"ed so this should make no difference to
PC/AT (and its clones) users.

Ok'd by:	core
Submitted by:	FreeBSD(98) development team
1996-06-14 11:02:28 +00:00
Stefan Eßer
21219d2116 Change CONF1_ENABLE_MSK to 0x7ff00000 in another attempt to decide
whether a system could possibly support PCI configuration mechanism 1
(or whether it rather is an EISA only system ...).
1996-06-13 21:50:41 +00:00
Satoshi Asami
d7629dff3b A fast memory copy for Pentiums using floating point registers.
It is called from copyin and copyout.

The new routine is conditioned on I586_CPU and I586_FAST_BCOPY, so you
need

options "I586_FAST_BCOPY"

(quotes essenstial) in your kernel config file.

Also, if you have other kernel types configured in your kernel, an
additional check to make sure it is running on a Pentium is inserted.
(It is not clear why it doesn't help on P6s, it may be just that the
 Orion chipset doesn't prefetch as efficiently as Tritons and friends.)

Bruce can now hack this away. :)
1996-06-13 07:17:21 +00:00
John Dyson
419702a468 Fix a very significant cnt.v_wire_count leak in vm_page.c, and some
minor leaks in pmap.c.  Bruce Evans made me aware of this problem.
1996-06-12 06:52:12 +00:00
Gary Palmer
c23670e294 Clean up -Wunused warnings.
Reviewed by:		bde
1996-06-12 05:11:41 +00:00
Paul Traina
8f33d986bc Move warning messages under bootverbose 1996-06-11 16:11:27 +00:00
Paul Traina
6d715e951e Put clock calibration #defines in opt_clock.h to ease reconfiguration 1996-06-11 16:02:55 +00:00