gad [Fri, 31 Dec 2004 00:36:28 +0000 (00:36 +0000)]
Fix so all parts of lpd, lpc, lpq, and lprm will use the same algorithm
for calculating the job number for a job based on the control-file name.
We might receive cf-files named by other implementations of lpr, where
the job number shown by lpq would not match the job number that other
commands expected for the same name.
This also uses a newer algorithm for determining a job number, to avoid
problems caused when a control-file is named using an IP address, instead
of the hostname.
This also moved the declaration if isowner() from lp.h to rmjob.c. When I
went to change the parameters, I noticed that rmjob.c was the only source
file which uses it.
rwatson [Fri, 31 Dec 2004 00:32:50 +0000 (00:32 +0000)]
Update netstat(1) for recent conversion of netipx to queue(9) from
home-brew linked lists. Read in the ipxpcb_list structure first in
order to find the first pcb pointer. Then follow the chain as
before, only the termination condition is a NULL next pointer
rather than a next pointer equal to the original offset.
gad [Fri, 31 Dec 2004 00:18:42 +0000 (00:18 +0000)]
Do more extensive checking of the userid field which is read in from the
control-file for each print job. This is partially because the previous
checks still let through some characters which would cause trouble for
other applications which try to process the resulting userid -- such as
accounting programs.
But the main reason is to handle the case where some remote host sends a
print job where the given userid is an uppercase-version of the real userid.
For that case, lpd will now check for uppercase letters in the userid. If
there are any, it will check to see if the given userid (with the uppercase
letters) is a valid one. If it is *not* valid, then lpd will change the
userid to all-lowercase right when the job is received.
jhb [Thu, 30 Dec 2004 20:52:44 +0000 (20:52 +0000)]
Rework the interface between priority propagation (lending) and the
schedulers a bit to ensure more correct handling of priorities and fewer
priority inversions:
- Add two functions to the sched(9) API to handle priority lending:
sched_lend_prio() and sched_unlend_prio(). The turnstile code uses these
functions to ask the scheduler to lend a thread a set priority and to
tell the scheduler when it thinks it is ok for a thread to stop borrowing
priority. The unlend case is slightly complex in that the turnstile code
tells the scheduler what the minimum priority of the thread needs to be
to satisfy the requirements of any other threads blocked on locks owned
by the thread in question. The scheduler then decides where the thread
can go back to normal mode (if it's normal priority is high enough to
satisfy the pending lock requests) or it it should continue to use the
priority specified to the sched_unlend_prio() call. This involves adding
a new per-thread flag TDF_BORROWING that replaces the ULE-only kse flag
for priority elevation.
- Schedulers now refuse to lower the priority of a thread that is currently
borrowing another therad's priority.
- If a scheduler changes the priority of a thread that is currently sitting
on a turnstile, it will call a new function turnstile_adjust() to inform
the turnstile code of the change. This function resorts the thread on
the priority list of the turnstile if needed, and if the thread ends up
at the head of the list (due to having the highest priority) and its
priority was raised, then it will propagate that new priority to the
owner of the lock it is blocked on.
Some additional fixes specific to the 4BSD scheduler include:
- Common code for updating the priority of a thread when the user priority
of its associated kse group has been consolidated in a new static
function resetpriority_thread(). One change to this function is that
it will now only adjust the priority of a thread if it already has a
time sharing priority, thus preserving any boosts from a tsleep() until
the thread returns to userland. Also, resetpriority() no longer calls
maybe_resched() on each thread in the group. Instead, the code calling
resetpriority() is responsible for calling resetpriority_thread() on
any threads that need to be updated.
- schedcpu() now uses resetpriority_thread() instead of just calling
sched_prio() directly after it updates a kse group's user priority.
- sched_clock() now uses resetpriority_thread() rather than writing
directly to td_priority.
- sched_nice() now updates all the priorities of the threads after the
group priority has been adjusted.
Discussed with: bde
Reviewed by: ups, jeffr
Tested on: 4bsd, ule
Tested on: i386, alpha, sparc64
jhb [Thu, 30 Dec 2004 20:29:58 +0000 (20:29 +0000)]
Stop explicitly touching td_base_pri outside of the scheduler and simply
set a thread's priority via sched_prio() when that is the desired action.
The schedulers will start managing td_base_pri internally shortly.
jhb [Thu, 30 Dec 2004 19:24:49 +0000 (19:24 +0000)]
Call tty_close() at the very end of ttyclose() since otherwise NULL
deferences can occur since tty_close() may end up freeing the tty structure
if it drops the last reference to it.
- ipx_pcbnotify(), which is never called.
- ipx_rtchange(), which is never called, is incomplete inplemented, and
also #ifdef notdef.
- spx_fixmtu(), which is never called, is incompletely implemented, and
also #ifdef notdef.
rwatson [Thu, 30 Dec 2004 16:56:07 +0000 (16:56 +0000)]
Constify ipx_zeronet, ipx_zerohost, ipx_broadnet, ipx_broadhost.
Remove 'allones' since the values of the broadcast network and
host variables are set statically.
jhb [Thu, 30 Dec 2004 15:32:31 +0000 (15:32 +0000)]
Sync with i386 GENERIC some:
- Update comments to newer style (space after #)
- Bring across various comment updates.
- Add AHC_REG_PRETTY_PRINT, ADAPTIVE_GIANT, and rue(4).
jhb [Thu, 30 Dec 2004 15:30:23 +0000 (15:30 +0000)]
- Indent the comments beside the SMP options to the same level as all the
other comments. Clarify that the next two things needed for SMP are
two lines.
- Expand mii abbreviation to miibus for clarity in the USB ethernet
comment.
rwatson [Thu, 30 Dec 2004 13:56:34 +0000 (13:56 +0000)]
Make the sysctls kern.ipc.msgmnb and kern.ipc.msgtql into tunables as
is the case for most other sysctls in the System V IPC message queue
implementation.
anholt [Thu, 30 Dec 2004 07:18:58 +0000 (07:18 +0000)]
[1] Remove the generic bridge support from those drivers that had it. The
generic bridge support was biting us more than it helped, whenever a new chipset
came out from a vendor and misprogramming it caused strange hangs or corruption.
[2] Add a large number of PCI IDs based on what the linux drivers support.
Note that the new PCI IDs haven't been tested, they're just *likely* to work.
In particular the VIA AGP 8x chipsets are concerning, due to lack of testing,
possible issues (kern/69953), and not having a nice "does this bridge say it
would do 8x" function. However, this shouldn't make the situation worse, since
these chips would have probed in the past anyway.
davidxu [Thu, 30 Dec 2004 02:56:17 +0000 (02:56 +0000)]
Make umtx_wait and umtx_wake more like linux futex does, it is
more general than previous. It also lets me implement cancelable point
in thread library. Also in theory, umtx_lock and umtx_unlock can
be implemented by using umtx_wait and umtx_wake, all atomic operations
can be done in userland without kernel's casuptr() function.
kientzle [Wed, 29 Dec 2004 23:26:18 +0000 (23:26 +0000)]
Rewrite the code that hacks a short names to use in
the regular ustar entry. The old code sometimes created
a too-long name that overflowed the ustar fields and triggered
an internal assertion failure. This version should be more
robust.
Thanks to: Michal Listos Fixes: bin/74385
MFC after: 15 days
obrien [Wed, 29 Dec 2004 19:39:06 +0000 (19:39 +0000)]
Remove the special sparc64 time_t support.
If someone isn't running with a 64-bit time_t by now, they don't
track -CURRENT and would probably go to RELENG_5 vs. 6-CURRENT.
keramida [Wed, 29 Dec 2004 19:32:21 +0000 (19:32 +0000)]
A lot of people may want to submit PRs from systems that are not
connected to the Internet or systems that do not have a correctly
configured email subsystem. Now that the send-pr web interface has
antispam protection, mention that it is ok to use it for submitting
problem reports.
Ok by: linimon
Submitted by: Rob <spamrefuse@yahoo.com> on freebsd-doc
brueffer [Wed, 29 Dec 2004 14:25:41 +0000 (14:25 +0000)]
- call the driver 'bktr' instead of 'brooktree' throughout the document
- add a HARDWARE section
- add a more descriptive NAME section
- update for recently imported Pinnacle PCTV support
- add Branko Lankester, the original author of the PCTV patches,
to the AUTHORS section
- bump .Dd
Thanks to all multimedia@ readers who sent me information about
their supported hardware!
grehan [Wed, 29 Dec 2004 09:41:40 +0000 (09:41 +0000)]
Correctly initialise the 2nd kernel segment, and don't
forget to actually install it in the segment register.
This may fix some of the weird panics seen when kernel VM
is heavily used.
imp [Wed, 29 Dec 2004 06:21:41 +0000 (06:21 +0000)]
Move WINBOND 4 port hub to its proper location in the file. It belongs
in a section of its own, not arbitrarily grouped in the hawking section
just because hawking sells it...
alc [Wed, 29 Dec 2004 04:18:22 +0000 (04:18 +0000)]
Access to the page's busy field is (now) synchronized by the containing
object's lock. Therefore, the assertion that the page queues lock is held
can be removed from vm_page_io_start().
julian [Wed, 29 Dec 2004 01:21:18 +0000 (01:21 +0000)]
Rewrite ehci_abort_xfer() to use the method hinted at in the EHCI spec.
to remove a transaction from the async schedule. The previous method didn't
work well and led to the hardware writing to free'd buffers etc, as
it didn't always know that the transaction had been aborted.
Written after consultation with David Brownell who wrote the Linux
EHCI driver.
As part of this give the sqh structure a "previous" pointer.
jb [Tue, 28 Dec 2004 22:17:10 +0000 (22:17 +0000)]
Pass an explicit pointer to the bus structure in the 'usb' device ivar
rather than a softc pointer (with the bus structure at the start).
This is a non-functional change. It just helps when reading the code to
know that the ehci, ohci and uhci drivers share the bus structure, not the
entire softc.
dwmalone [Tue, 28 Dec 2004 21:58:54 +0000 (21:58 +0000)]
Some syslog messages delimit the program tag with whitespace rather
than a colon, so don't allow whitespace in program names. To be
consistent with hostnames, don't allow whitespace in the program
name specifiers in syslog.conf either.
(The first change is by Markus from the PR, the second is mine.)
jhb [Tue, 28 Dec 2004 21:21:27 +0000 (21:21 +0000)]
- Up the WITNESS_COUNT macro from 200 to 1024 to support the growing number
of lock types in the kernel. This results in an increase of witness
data usage from ~145k to ~280k on i386 for kernels with
'options WITNESS'.
- Remove the unused witness malloc bucket.
Submitted by: Michal Mertl mime at traveller dot cz (1)
glebius [Tue, 28 Dec 2004 12:11:32 +0000 (12:11 +0000)]
- Plug a memory leak in ng_netflow_cache_init().
- Initialize error to 0 in ng_netflow_flow_add() (a nop change).
- Update cache statistics holding workqueue mutex.
grehan [Tue, 28 Dec 2004 05:07:49 +0000 (05:07 +0000)]
Don't probe for a disk unless explicitly enabled by a tunable.
This allows boot to proceed on a real system until the issue
of calling back into certain OpenFirmware calls (e.g. finddevice)
in thread context is understood.
(this commit only affects psim users, of which I think I am the
only one...)
pjd [Mon, 27 Dec 2004 17:20:06 +0000 (17:20 +0000)]
Rewrite piece of code which I committed some time ago that allows to
show file name for 'mdconfig -l -u <x>' command.
This allows to preserve API/ABI compatibility with version 0 (that's why
I changed version number back to 0) and will allow to merge this change
to RELENG_5.
rwatson [Mon, 27 Dec 2004 10:47:08 +0000 (10:47 +0000)]
Attempt to slightly refine the print out from "show alllocks" -- list
the process and thread numbers/names on the same line rather than on
separate lines, and print the thread pointer not just the tid.
njl [Mon, 27 Dec 2004 06:15:03 +0000 (06:15 +0000)]
Restore the cpu_reset proxy code. It is needed if you want to reset the
system from an AP at runtime (i.e., calling cpu_reset from ddb). Someday,
if we move to an NMI for stopping cpus instead, we can do away with this.
jeff [Sun, 26 Dec 2004 22:56:08 +0000 (22:56 +0000)]
- Fix a long standing problem where an ithread would not honor sched_pin().
- Remove the sched_add wrapper that used sched_add_internal() as a backend.
Its only purpose was to interpret one flag and turn it into an int. Do
the right thing and interpret the flag in sched_add() instead.
- Pass the flag argument to sched_add() to kseq_runq_add() so that we can
get the SRQ_PREEMPT optimization too.
- Add a KEF_INTERNAL flag. If KEF_INTERNAL is set we don't adjust the SLOT
counts, otherwise the slot counts are adjusted as soon as we enter
sched_add() or sched_rem() rather than when the thread is actually placed
on the run queue. This greatly simplifies the handling of slots.
- Remove the explicit prevention of migration for ithreads on non-x86
platforms. This was never shown to have any real benefit.
- Remove the unused class argument to KSE_CAN_MIGRATE().
- Add ktr points for thread migration events.
- Fix a long standing bug on platforms which don't initialize the cpu
topology. The ksg_maxid variable was never correctly set on these
platforms which caused the long term load balancer to never inspect
more than the first group or processor.
- Fix another bug which prevented the long term load balancer from working
properly. If stathz != hz we can't expect sched_clock() to be called
on the exact tick count that we're anticipating.
- Rearrange sched_switch() a bit to reduce indentation levels.
rwatson [Sun, 26 Dec 2004 22:52:24 +0000 (22:52 +0000)]
Add "show alllocks" command to DDB, which dumps a list of processes
and threads currently holding sleep mutexes (and spin mutexes for
curthread). This can be quite useful in looking for a lock condition
summary for a system, as it avoids manually iterating through threads
and processes to find all the interesting locks.
NB: "alllocks" is up there with "lockedvnods" for a bad argument for
show.
darrenr [Sun, 26 Dec 2004 09:08:42 +0000 (09:08 +0000)]
* The #ifdef's to cause mutex's for freebsd to be declared were meant to pick
up on USE_MUTEX being defined, but this patch
* Remove some code that's in a #ifndef FreeBSD that's no longer used.
imp [Sun, 26 Dec 2004 07:48:46 +0000 (07:48 +0000)]
More minor diff reduction against netbsd:
ADVANCELOGIC->AVANCELOGIC (nothing in the tree uses it, so safe to do)
sort HAGIWARA vendor entry
sort ACTIONTAR vendor entry
Minor change to SYSTEMTALKS vendor entry.