Joerg Sonnenberger [Thu, 30 Jun 2005 15:57:27 +0000 (15:57 +0000)]
Use if_printf, especially for DPRINTF. Merge two DPRINTF statements
to assist this. Remove sc_dev and sc_unit. Remove unimplemented prototype.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Simon Schubert [Thu, 30 Jun 2005 15:56:56 +0000 (15:56 +0000)]
Remove unreferenced files. Seems they now live in sys/boot/common...
Simon Schubert [Thu, 30 Jun 2005 15:55:17 +0000 (15:55 +0000)]
Fix references to bzip2
Simon Schubert [Wed, 29 Jun 2005 23:03:22 +0000 (23:03 +0000)]
Fix bzip2 vulnerability.
Thanks to Colin Percival for giving us a heads-up!
Obtained-from: Steve Grubb via RedHat via FreeBSD
Simon Schubert [Wed, 29 Jun 2005 22:41:34 +0000 (22:41 +0000)]
remove old bzip2
Simon Schubert [Wed, 29 Jun 2005 22:40:20 +0000 (22:40 +0000)]
Switch to bzip2-1.0.3
Simon Schubert [Wed, 29 Jun 2005 22:38:10 +0000 (22:38 +0000)]
Merge from vendor branch BZIP:
Import bzip2-1.0.3 modulo unneeded files.
Simon Schubert [Wed, 29 Jun 2005 22:38:10 +0000 (22:38 +0000)]
Import bzip2-1.0.3 modulo unneeded files.
Simon Schubert [Wed, 29 Jun 2005 22:38:10 +0000 (22:38 +0000)]
Import bzip2-1.0.3 modulo unneeded files.
Sascha Wildner [Wed, 29 Jun 2005 17:24:35 +0000 (17:24 +0000)]
For quickrel, use our quick{world,kernel} targets.
Matthew Dillon [Wed, 29 Jun 2005 01:25:10 +0000 (01:25 +0000)]
Yet more scheduler work. Revamp the batch detection heuristic and fix a few
things here and there. Test the algorithm against buildworlds, mozilla,
gnome-terminal, and pine all running at once.
* Fix a bug in how I handle p_slptime.
* Move the ++p_cptime out of usched_bsd4 and into kern_clock.c.
* Redo the batch heuristic, boost the cost of doing a fork, and
slowly decrement p_origcpu to compensate for long-running
processes.
* Use an instantanious load instead of a time-averaged load in the
decay calculation.
TODO: the SMP support will be virtually identical across all schedulers
and should probably be abstracted out of usched_*.c.
Simon Schubert [Wed, 29 Jun 2005 00:24:49 +0000 (00:24 +0000)]
Sync with FreeBSD to fix (a genuine DragonFly) bug that printed
the size instead of the time.
Noticed-by: Joseph Garcia <bsd_usr@yahoo.com>
Joerg Sonnenberger [Tue, 28 Jun 2005 18:38:06 +0000 (18:38 +0000)]
Hack in support for ar(4) based devices.
Matthew Dillon [Tue, 28 Jun 2005 07:15:38 +0000 (07:15 +0000)]
The recent commit to propogate kernel options to modules enabled the
ACPI cx state code, which had a big fast KKASSERT(0) in it (panic on
boot). Fix it.
Matthew Dillon [Mon, 27 Jun 2005 22:32:00 +0000 (22:32 +0000)]
Remove an assertion that does not compile due to a lack of a KERNLOAD
variable.
Found-by: walt <wa1ter@myrealbox.com>
Jeremy C. Reed [Mon, 27 Jun 2005 22:27:36 +0000 (22:27 +0000)]
testing cvs commit
Matthew Dillon [Mon, 27 Jun 2005 20:27:38 +0000 (20:27 +0000)]
Allow the CTYPE macros to be disabled, forcing procedure calls to be used
instead.
Disable the CTYPE macros in libskey, libutil, and libcrypt. This allows
pre-1.3 programs linked against libc.so.3 to use the PAM modules in HEAD.
these modules indirectly reference libskey, libutil, and libcrypt, which
then fail to dynamically link against libc.so.3 due to references to
ctype globals that do not exist in libc.so.3.
This is a hack, I know, but we have to make upgrades as compatible as
possible with older programs.
Matthew Dillon [Mon, 27 Jun 2005 19:24:52 +0000 (19:24 +0000)]
Print out additional information for a magic number failure assertion.
Matthew Dillon [Mon, 27 Jun 2005 18:38:03 +0000 (18:38 +0000)]
* Remove a procedural layer in the scheduler clock code by having
kern_clock call the usched scheduler clock function directly.
* Move p_estcpu to scheduler-specific code.
* Have kern_synch's one-second timer call into the scheduler instead of
trying to figure it out itself.
* Decay p_estcpu whenever a user process is scheduled as well as once
per second, leading to (hopefully) better performance under load and
better handling of adverse conditions (a nice +20 process running in the
face of a nice -20 process).
* No longer assume that one second has elapsed in the one-second callback.
Instead calculate the elapsed time on a per-process basis. This should
reduce instances of batch processes 'glitching' interactive processes.
* Remove the old round-robin code and instead just have the scheduler
figure it out internally in the scheduler clock function.
* Revamp the scheduler algorithms, making everything #define constant
driven. Retain the NICE-based base-priority and decay algorithms but
narrow the decay range from the process nice value. Retain the child
estcpu inheritance algorithm.
Feedback-provided-by: walt <wa1ter@myrealbox.com>
Liam J. Foy [Mon, 27 Jun 2005 14:48:29 +0000 (14:48 +0000)]
- Introduce new -g option. This allows for the broadcast time to be reduced
below 3 minutes, but no higher due to a three minute downtime assumption.
- When polling, use .events (noted by Peter @ NetBSD)
Ok: Joerg
Discussed with: sjg
Joerg Sonnenberger [Mon, 27 Jun 2005 12:24:46 +0000 (12:24 +0000)]
Remove redundant verbosity. The description of the parent just costs space
in the dmesg buffer, it doesn't add any value since it was printed before.
Simon Schubert [Mon, 27 Jun 2005 11:28:54 +0000 (11:28 +0000)]
Remove references to NBPFILTER. We unconditionally use bpf.
While being here, use opt_inet.h from the kernel build.
Requested-by: joerg
Simon Schubert [Mon, 27 Jun 2005 11:03:43 +0000 (11:03 +0000)]
If compiling a module with the kernel, suck in opt_global.h.
Simon Schubert [Mon, 27 Jun 2005 10:58:22 +0000 (10:58 +0000)]
Don't unconditionally compile in ALTQ.
Discovered-by: Andreas Hauser
Sascha Wildner [Mon, 27 Jun 2005 02:27:10 +0000 (02:27 +0000)]
Remove PC98 support.
Sascha Wildner [Mon, 27 Jun 2005 01:49:59 +0000 (01:49 +0000)]
Change spl*() to critical sections.
Sascha Wildner [Mon, 27 Jun 2005 01:43:15 +0000 (01:43 +0000)]
Fix wrong list head which crept in with the last commit.
Matthew Dillon [Sun, 26 Jun 2005 22:03:29 +0000 (22:03 +0000)]
Move more scheduler-specific defines from various places into usched_bsd4.c
and revamp our scheduler algorithms.
* Get rid of the multiple layers of abstraction in the nice and frequency
calculations.
* Increase the scheduling freqency from 20hz to 50hz.
* Greatly reduce the number of scheduling ticks that occur before a
reschedule is issued.
* Fix a bug where the scheduler was not rescheduling when estcpu drops
a process into a lower priority queue.
* Implement a new batch detection algorithm. This algorithm gives
forked children slightly more batchness then their parents (which
is recovered quickly if the child is interactive), and propogates
estcpu data from exiting children to future forked children (which
handles fork/exec/wait loops such as used by make, scripts, etc).
* Change the way NICE priorities effect process execution. The NICE
value is used in two ways: First, it determines the initial process
priority. The estcpu will have a tendancy to correct for this so the NICE
value is also used to control estcpu's decay rate.
This means that niced processes will have both an initial penalty for
startup and stabilization, and an ongoing penalty if they become cpu
bound.
Examples from cpu-bound loops:
CPU PRI NI PID %CPU TIME COMMAND
42 159 -20 706 20.5 0:38.88 /bin/csh /tmp/dowhile
37 159 -15 704 17.6 0:35.09 /bin/csh /tmp/dowhile
29 157 -10 702 15.3 0:30.41 /bin/csh /tmp/dowhile
28 160 -5 700 13.0 0:26.73 /bin/csh /tmp/dowhile
23 160 0 698 11.5 0:20.52 /bin/csh /tmp/dowhile
18 160 5 696 9.2 0:16.85 /bin/csh /tmp/dowhile
13 160 10 694 7.1 0:10.82 /bin/csh /tmp/dowhile
3 160 20 692 1.5 0:02.14 /bin/csh /tmp/dowhile
Matthew Dillon [Sun, 26 Jun 2005 04:36:35 +0000 (04:36 +0000)]
Move remaining scheduler-specific functions into the usched abstraction.
This also involves rearranging a number of fields in the proc structure,
changing the proc structure (actually making it a bit smaller due to better
packing). A complete rebuild is required.
Matthew Dillon [Sat, 25 Jun 2005 21:18:42 +0000 (21:18 +0000)]
Cleanup indentation, no operational changes.
Matthew Dillon [Sat, 25 Jun 2005 20:03:34 +0000 (20:03 +0000)]
Associate a userland scheduler control structure with every process and
call userland scheduling functions through that structure. Note that the
proc structure already had a field reserved for this purpose so it actually
doesn't change size.
The child of a fork() inherits the parent's userland scheduler control
structure pointer.
Move uio_yield() to a scheduler-independant file, and do some minor
cleanups of already #ifdef'd out code.
Repo-Rename usched_4bsd.c to usched_bsd4.c, so the file matches the function
prefixes I want to use.
Believe it or not, this should not represent any operational code changes
other then changing some previously direct function calls into indirect
calls through the new p_usched field in the process structure.
Matthew Dillon [Sat, 25 Jun 2005 19:54:55 +0000 (19:54 +0000)]
Remove unused variables (from prior spl->critical section conversion)
Matthew Dillon [Sat, 25 Jun 2005 19:12:27 +0000 (19:12 +0000)]
Repo-copy kern_switch.c to usched_4bsd.c, remove kern_switch.c, and point
the kernel build at usched_4bsd.c in preparation for creating a switchable
userland scheduling API.
Matthew Dillon [Sat, 25 Jun 2005 19:06:22 +0000 (19:06 +0000)]
Do a quick cleanup pass on the userland scheduler and move resetpriority()
from kern_synch.c to kern_switch.c. No code changes.
Matthew Dillon [Sat, 25 Jun 2005 19:04:37 +0000 (19:04 +0000)]
Fix a race between fork() and ^Z. If the ^Z is handled just as the forked
child is returning from the fork trampoline, the current process designation
is not released and the system stops scheduling userland processes. Also
fix an initial priority bug.
Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Max Okumoto [Wed, 22 Jun 2005 22:03:36 +0000 (22:03 +0000)]
Renamed struct MakeFlags to struct CLI.
Max Okumoto [Wed, 22 Jun 2005 22:03:19 +0000 (22:03 +0000)]
Split Dir_Init() into two functions.
Max Okumoto [Wed, 22 Jun 2005 22:03:03 +0000 (22:03 +0000)]
Move sections of init code that do not take any input into the
above section.
Max Okumoto [Wed, 22 Jun 2005 22:02:43 +0000 (22:02 +0000)]
Cleanup Dir_Init*() functions.
Joerg Sonnenberger [Wed, 22 Jun 2005 20:11:59 +0000 (20:11 +0000)]
Instead of emulating a userland system call via stackgap, use
kern_open directly.
Joerg Sonnenberger [Wed, 22 Jun 2005 20:09:34 +0000 (20:09 +0000)]
Defancy the infinite loop. Fix a bug where the loop wasn't left when
all ptys have been processed.
Matthew Dillon [Wed, 22 Jun 2005 19:58:44 +0000 (19:58 +0000)]
The recent file descriptor work is significant enough to deserve a
DragonFly copyright.
Suggested-by: Hiten Pandya <hmp@backplane.com>
Matthew Dillon [Wed, 22 Jun 2005 19:55:30 +0000 (19:55 +0000)]
Document cleanvar_enable in rc.conf.5 and document the purge code
in cleanvar.
Submitted-by: "George Georgalis" <george@galis.org>
Matthew Dillon [Wed, 22 Jun 2005 19:40:35 +0000 (19:40 +0000)]
Randomize the initial stack pointer for a user process. Introduce a
sysctl, kern.stackgrap_random, to specify the random range. The value must
be a power of two.
Submitted-by: Craig Dooley <xlnxminusx@gmail.com>
Adapted-from: OpenBSD
Max Okumoto [Wed, 22 Jun 2005 18:04:49 +0000 (18:04 +0000)]
Remove extra semi colin and a few remove redundent checks.
Max Okumoto [Wed, 22 Jun 2005 18:04:13 +0000 (18:04 +0000)]
Some cleanup
o constify input to Main_ParseArgLine()
o split complex if-statement into seperate assignment and if-statements
o use strsep()
Joerg Sonnenberger [Wed, 22 Jun 2005 15:27:45 +0000 (15:27 +0000)]
SuSE includes a special .note.SuSE section descriping the version of
the distribution the binary is from. This is a problem because they
forget to use a note type other than 1, which is used for ABI tag
sections.
Using a second match function is the easiest solution, otherwise we
would have to scan either the header section list or the full section
list twice. As long as no other vendor created such idiosyncrasy,
this is faster.
Matthew Dillon [Wed, 22 Jun 2005 02:08:19 +0000 (02:08 +0000)]
Synchronize the ipfilter contrib code with recent file descriptor cleanups.
Matthew Dillon [Wed, 22 Jun 2005 01:51:40 +0000 (01:51 +0000)]
Synchronize libkcore with recent file descriptor cleanups.
Matthew Dillon [Wed, 22 Jun 2005 01:50:03 +0000 (01:50 +0000)]
Synchronize the fstat program with recent file descriptor cleanups.
Matthew Dillon [Wed, 22 Jun 2005 01:33:34 +0000 (01:33 +0000)]
File descriptor cleanup stage 2, remove the separate arrays for file
pointers, fileflags, and allocation counts and replace the mess with a
single structural array. Also revamp the code that checks whether the
file descriptor array is built-in or allocated.
Note that the removed malloc's were doing something weird, allocating
'nf * OFILESIZE + 1' bytes instead of 'nf * OFILESIZE' bytes. I could
not find any reason at all why it was doing that. It's gone now anyway.
Jeffrey Hsu [Tue, 21 Jun 2005 23:58:53 +0000 (23:58 +0000)]
Replace the linear search in file descriptor allocation with an O(log N)
algorithm based on full in-place binary search trees augmented with
subtree free file descriptor counts.
Idea from: Solaris
Max Okumoto [Tue, 21 Jun 2005 21:06:24 +0000 (21:06 +0000)]
Use strsep() instead of custom loop.
Max Okumoto [Tue, 21 Jun 2005 21:05:54 +0000 (21:05 +0000)]
Move compatMake test up.
Max Okumoto [Tue, 21 Jun 2005 21:04:49 +0000 (21:04 +0000)]
cleanup ReadInputFiles()
Max Okumoto [Tue, 21 Jun 2005 21:04:32 +0000 (21:04 +0000)]
fix comments
Max Okumoto [Tue, 21 Jun 2005 20:59:42 +0000 (20:59 +0000)]
Move code from main into subroutine.
Max Okumoto [Tue, 21 Jun 2005 20:59:00 +0000 (20:59 +0000)]
cleanup built_stuff()
moving function description comment
move exit status, the code will be moved into the called function.
Matthew Dillon [Tue, 21 Jun 2005 17:59:47 +0000 (17:59 +0000)]
Bump fd_lastfile, freefile, and refcnt to 32 bit ints. Also bump cmask
(though that doesn't fix any particular bug). lastfile and freefile were
previously unsigned shorts which caused the system to become very confused
when any single user process had more then 65535 open file descriptors.
Reported-by: Jeffrey Hsu <hsu@leaf.dragonflybsd.org>
Joerg Sonnenberger [Tue, 21 Jun 2005 15:27:55 +0000 (15:27 +0000)]
Add BCM5751.
Submitted-by: Pablo Méndez Hernández <pablomh@gmail.com>
Joerg Sonnenberger [Tue, 21 Jun 2005 15:25:56 +0000 (15:25 +0000)]
Regen.
Joerg Sonnenberger [Tue, 21 Jun 2005 15:24:04 +0000 (15:24 +0000)]
Add BCM5751.
Submitted-by: Pablo Méndez Hernández <pablomh@gmail.com>
Joerg Sonnenberger [Tue, 21 Jun 2005 12:35:14 +0000 (12:35 +0000)]
Restore copy of revid in softc.
Problem-reported-by: walt <wa1ter@myrealbox.com>
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
David Xu [Tue, 21 Jun 2005 07:47:01 +0000 (07:47 +0000)]
Fix off-by-one error.
Matthew Dillon [Tue, 21 Jun 2005 06:50:28 +0000 (06:50 +0000)]
Have ktrdump run 'nm' on the kernel execfile and translate the caller1,2
pointers into symbols, unless the -n (numeric only) option is specified.
If no display options are specified, enable a few of them by default.
Reverse the printing order from caller1, caller2 to caller2, caller1,
so the procedural display order matches the procedure chain order.
Matthew Dillon [Tue, 21 Jun 2005 05:25:17 +0000 (05:25 +0000)]
Add KTR support to the IPIQ code.
Matthew Dillon [Tue, 21 Jun 2005 05:03:12 +0000 (05:03 +0000)]
Add additional sanity checks to IPIQ processing, do some cleanups,
and make minor changes to the function dispatch.
Matthew Dillon [Tue, 21 Jun 2005 00:47:07 +0000 (00:47 +0000)]
Rewrite a good chunk of the ktrdump utility to work with the new DragonFly
KTR facility.
Matthew Dillon [Mon, 20 Jun 2005 23:21:34 +0000 (23:21 +0000)]
Correct KTR masks for memory logging.
Matthew Dillon [Mon, 20 Jun 2005 21:12:49 +0000 (21:12 +0000)]
Correct a missing macro element for the NON-KTR case.
Matthew Dillon [Mon, 20 Jun 2005 21:11:13 +0000 (21:11 +0000)]
Add KTR support to the slab allocator. Track malloc's, free's, oversized
chunks, and IPI operations.
Matthew Dillon [Mon, 20 Jun 2005 20:49:14 +0000 (20:49 +0000)]
Include a bitmap of allocated entries when built with INVARIANTS. I
considered making this a separate option but decided it was too important
to leave out of a basic INVARIANTS build.
The kernel will panic if it tries to allocate memory that has already
been allocated or free memory that has already been freed.
Matthew Dillon [Mon, 20 Jun 2005 20:38:01 +0000 (20:38 +0000)]
Use KTR's built-in call chain recording rather then hacking it up ourselves.
Matthew Dillon [Mon, 20 Jun 2005 20:37:28 +0000 (20:37 +0000)]
Add a caller backtrace feature (enabled by default), which records part of
the call chain leading up to the traced function. Two call chain instruction
addresses are recorded.
Matthew Dillon [Mon, 20 Jun 2005 18:00:28 +0000 (18:00 +0000)]
Use the KTR facility to trace token operations.
Matthew Dillon [Mon, 20 Jun 2005 17:59:33 +0000 (17:59 +0000)]
Reimplement the kernel tracepoint facility. The new implementation is
completely generic and very easy to implement in modules. Compile-time
optimizations are retained and sysctl generation is completely automatic.
Only the DDB command code has been retained from FreeBSD.
The logging macros are designed to allow subsystems to trivially declare
and use the facility.
This implementation is not quite complete, we also want to integrate a
stack backtrace logging facility.
Matthew Dillon [Mon, 20 Jun 2005 17:43:39 +0000 (17:43 +0000)]
Introduce an ultra-simple, non-overlapping, int-aligned bcopy called bcopyi().
Joerg Sonnenberger [Mon, 20 Jun 2005 16:48:02 +0000 (16:48 +0000)]
queue(3) for if_multiaddrs.
Joerg Sonnenberger [Mon, 20 Jun 2005 15:10:41 +0000 (15:10 +0000)]
Use queue(3) macros for if_multiaddrs.
Joerg Sonnenberger [Mon, 20 Jun 2005 13:56:08 +0000 (13:56 +0000)]
Setup interrupt last in txp_attach. Protect against concurrent interrupts
in txp_detach. Use M_WAITOK in txp_attach.
Joerg Sonnenberger [Mon, 20 Jun 2005 13:51:54 +0000 (13:51 +0000)]
Common PCI probe style.
Joerg Sonnenberger [Mon, 20 Jun 2005 13:49:52 +0000 (13:49 +0000)]
Explicitly set error before jumping to fail.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:41:51 +0000 (13:41 +0000)]
Use local storage for MAC instead of arpcom.ac_enaddr.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:39:17 +0000 (13:39 +0000)]
Use ether_crc32_be.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:30:53 +0000 (13:30 +0000)]
Use queue(3).
Joerg Sonnenberger [Mon, 20 Jun 2005 13:26:15 +0000 (13:26 +0000)]
Use PCI accessor functions, don't change memory / port bit manually.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:24:14 +0000 (13:24 +0000)]
- pass dev directly to txp_release_resources, call it only once
- use only if_printf outside of txp_attach.
- remove sc_dev, sc_cold, TXP_DEVNAME
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:08:01 +0000 (13:08 +0000)]
Use vr_detach as common error path.
Setup interrupt last in vr_attach.
Use M_WAITOK for contigmalloc, now that we don't have to protect
against concurrent interrupts.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:04:52 +0000 (13:04 +0000)]
Use ether_crc32_be.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Obtained-from: FreeBSD
Joerg Sonnenberger [Mon, 20 Jun 2005 13:02:48 +0000 (13:02 +0000)]
Use PCI accessor functions. Stop changing port / memory bits manually.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:01:15 +0000 (13:01 +0000)]
- initialise interface name early
- use common PCI probe style
- remove unused vr_info and vr_type field from softc
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Matthew Dillon [Mon, 20 Jun 2005 07:58:39 +0000 (07:58 +0000)]
Add a DEBUG_TOKENS option which causes token operations to be logged to
a static array, suitable for post-morten investigation.
Matthew Dillon [Mon, 20 Jun 2005 07:40:30 +0000 (07:40 +0000)]
Tokens are recursive in the context of the same thread. This also means
that fast interrupts such as IPIs cannot safely use any token function.
Assert this requirement in the implementation.
Add miscellanious other assertions to enforce correct operation.
Remove the 'no giveaway' warning. This warning was being used to determine
where recursive tokens were being used. It turns out that they are used
in the mountlist scan code (which has historically been rather buggy). Now
that we know where they are used and we fixed the recursion release bug in
a prior commit, this printf() can be removed.
Matthew Dillon [Mon, 20 Jun 2005 07:31:05 +0000 (07:31 +0000)]
Fix a serious SMP bug. The RWLOCK support used by dev/raid/aac,
ACPI, and dev/drm improperly tries to use a token in lwkt_schedule().
Because lwkt_schedule() can be called from an IPI in the context of
the current thread it cannot safely manipulate the current thread,
much less the td_toks field.
To fix this problem the RW lock functions in lwkt_rwlock.c have to be
covered by a critical section as well as the token, and lwkt_schedule()
then simply checks to see if the token is owned by the current cpu. RWLocks
may require some rethinking.
The token code is designed to operate mostly without having to use a
critical section, but in order for this to work it depends on the td_toks
list not being ripped out from under it. The nested trytoken/release
call in lwkt_schedule() should not have caused mainline token code to
fail as it restored td_toks to the same state it was in on entry, but
we can't take that chance.
Matthew Dillon [Mon, 20 Jun 2005 02:56:09 +0000 (02:56 +0000)]
Add a missing crit_exit(). The code path in question only got executed
if an error occurs.
Matthew Dillon [Sun, 19 Jun 2005 22:43:32 +0000 (22:43 +0000)]
Fix a bug in the physmap[] array limit calculation and rewrite portions of
the physmap code to try to clean up some of the mess. Increase the number
of physmap entries supported to 10.
Matthew Dillon [Sun, 19 Jun 2005 22:07:17 +0000 (22:07 +0000)]
Add more magic numbers for the token code.
Matthew Dillon [Sun, 19 Jun 2005 21:50:50 +0000 (21:50 +0000)]
Fix two bugs in the LWKT token code.
(1) When releasing a token reference we cannot give away the token to
another cpu if we are still holding it via a another reference. This
can cause recursive token references to silently fail when the inner
reference is released. It is unclear where such references exist and
a temporary printf has been added to identify occurances.
(2) When obtaining a token reference if the underlying token was not owned
by the current cpu we spun to gain ownership, but then failed to check
whether the token was being held by a preempted thread.
This can result in a preempting thread holding a token also being held
by an underyling thread. Theoretically, this case can only
occur if the preempted thread was is the process of obtaining the
token in question since otherwise (by definition) our cpu will already
own the token. On return the preempted thread will check and obtain
ownership. However, the situation is complex enough that we really
need to check unconditionally.
Joerg Sonnenberger [Sun, 19 Jun 2005 17:13:59 +0000 (17:13 +0000)]
Also include files in the .OBJDIR.
Joerg Sonnenberger [Sun, 19 Jun 2005 16:45:32 +0000 (16:45 +0000)]
Fix some glitches.