Commit Graph

109112 Commits

Author SHA1 Message Date
Olivier Houchard
432f5e3ab9 Disable interrupts for atomic_cmpset_32, this one is just not atomic.
Don't export it to userland.
2004-11-05 23:48:12 +00:00
David Xu
8acf605790 Respect TDF_SINTR, don't suspend uninterruptible thread. 2004-11-05 22:40:33 +00:00
Pawel Jakub Dawidek
4a9a72aa33 Note that sysctls documentation is missing. 2004-11-05 22:38:14 +00:00
David Xu
64895117a0 Backout previous commit, the P_STOPPED_BOUNDARY flag was already
cleared at the begin of thread_single() when needed.
2004-11-05 22:31:20 +00:00
John Baldwin
bd1d11f5dc - Store threads on sleep queues in FIFO order rather than sorted by
priority.  The sleep queues don't get updated when the priority of
  threads changes, so sleepq_signal() might not always wakeup the
  highest priority thread.  Updating the queues when thread priorities
  change cannot be easily done due to lock orders, so instead we do an
  O(n) walk of the queue for a sleepq_signal() operation instead of O(1).
  On the other hand, adding a thread to a sleep queue now goes from O(n)
  to O(1) so it ends up as an even tradeoff.  The correctness here with
  regards to priorities is actually fairly important.  msleep() gives
  interactive threads their priority "boost" after they are placed on the
  queue, but before this fix that "boost" wasn't used to determine the
  highest priority thread that sleepq_signal() awoke.
- Fix up some comments.

Inspired by:	ups, bde
2004-11-05 20:19:58 +00:00
John Baldwin
6ac27fe1e6 Don't change the priority to PUSER when sleeping, just keep the current
priority.
2004-11-05 20:15:06 +00:00
Olivier Houchard
bd366a3cd4 Copy the syscall args in a tmp variable instead of directly using the
trapframe, as it can be modified in the syscall.
Call thread_user_enter() when appropriate.
2004-11-05 19:57:10 +00:00
Olivier Houchard
8ecf6f65d9 Save a few cycles in context switch.
Update comments to reflect reality.
2004-11-05 19:54:13 +00:00
Olivier Houchard
90f794aaaf If we're still running at the physical address, jump to the virtual address
instead before calling initarm().
This removes the need to map virtual == physical in initarm().
2004-11-05 19:52:55 +00:00
Olivier Houchard
321c47170e Be more verbose about cache capacities. 2004-11-05 19:51:23 +00:00
Olivier Houchard
d20a408be7 Implement casuptr. 2004-11-05 19:50:48 +00:00
Olivier Houchard
1214c18d4e Call pmap_pte_init_arm9 instead of pmap_pte_init_generic if
ARM9_CACHE_WRITE_THROUGH is defined.
2004-11-05 19:48:40 +00:00
John Baldwin
1aafbc01f9 - Add a new MD per-CPU field for Alpha 'pal_id' which is the PAL ID
associated with each processor.  This ID is inferred from the index
  of the pcs structure in the hwprb.
- Give Alpha CPUs FreeBSD CPU IDs more like other architectures where the
  boot processor is always CPU 0 and the other processors are numbered
  1 ... N.  List active CPUs in the system in cpu_mp_announce() as well.

Silence on:	alpha@
2004-11-05 19:16:44 +00:00
John Baldwin
57ea1265bd - Set the priority of the page zeroing thread using sched_prio() when the
thread is created rather than adjusting the priority in the main
  function.  (kthread_create() should probably take the initial priority
  as an argument.)
- Only yield the CPU in the !PREEMPTION case if there are any other
  runnable threads.  Yielding when there isn't anything else better to do
  just wastes time in pointless context switches (albeit while the system
  is idle.)
2004-11-05 19:14:02 +00:00
John Baldwin
0811d60abc - Make setting of IT_ENTROPY a bit simpler in ithread_update().
- Tweak the updating of the ithread name in ithread_update() so that the
  '+' and '*' characters for device names that were too short only get
  added at the end after as many device names as possible were fit into
  the allocated space.  Prior to this, some long devices would result
  in '+' chars showing up between two different devices rather than at the
  end.
2004-11-05 19:11:24 +00:00
Peter Wemm
0de3e7280f Restrict the sched_bind to cpu 0 to i386 and amd64 for now. I forgot that
alpha still doesn't use logical cpu id's.
2004-11-05 19:00:23 +00:00
Olivier Houchard
b5128f416a Walk through the snp softc list instead of abusing tp->ts_c to find the
snp attached to a tty.
This fixes the panic that happens when using snp.
2004-11-05 18:32:14 +00:00
Olivier Houchard
bd245b9bd4 In cpu_critical_fork_exit(), make sure to set td_md.md_critnest so that
interrupts will be enabled.

Spotted out by:	jhb
2004-11-05 18:29:45 +00:00
Peter Wemm
20e25d7de5 Bind to cpu0 for boot() processing. (Note this is reboot, not startup)
This means we'll always call the event hooks, device_shutdown etc on the
BSP and theoretically means we can de-cruftify the cpu_reset_proxy stuff.
2004-11-05 18:29:10 +00:00
Peter Wemm
9ad69266e1 MFi386 1.238 (jhb): Allow hints to disable cpus 2004-11-05 18:25:22 +00:00
Peter Wemm
7681443a26 MFi386:
rev 1.61 (scottl):  Add KTR tracing
rev 1.62 (scottl):  Optimize (td->pmap, inlines, etc)
2004-11-05 18:24:01 +00:00
Pawel Jakub Dawidek
9bb09163fc Don't forget to make sure that there are no not-finished requests before
marking components as clean.

Pointed out by:	scottl
2004-11-05 17:18:39 +00:00
Pawel Jakub Dawidek
4d006a98d1 - Mark all raid3 components as clean after kern.geom.raid3.idletime seconds.
- Make kern.geom.raid3.timeout variable tunable.
2004-11-05 13:12:58 +00:00
Pawel Jakub Dawidek
9da3072cae Mark raid3 devices as clean on shutdown (after all file systems are
unmounted).

Suggested by:	scottl
2004-11-05 13:01:25 +00:00
Pawel Jakub Dawidek
79e614937e - Use ->index consumer's field to track number of in-flight requests.
- Remove unused #include.
2004-11-05 12:42:16 +00:00
Pawel Jakub Dawidek
d04ecb5f44 Stop method for swap1 script was introduced, because gmirror needed it.
Now gmirror use shutdown hooks to mark mirrors as clean on shutdown,
so this is not needed anymore.
2004-11-05 12:38:27 +00:00
Pawel Jakub Dawidek
6349471be3 Use shutdown hooks to mark mirrors as clean after all file systems are
unmounted.

Suggested by:	scottl
2004-11-05 12:35:21 +00:00
Pawel Jakub Dawidek
127cf38ee4 Remove unused #include. 2004-11-05 12:31:32 +00:00
Hartmut Brandt
afa99554de Now with the remote job support removed there can be no remote jobs and
no jobs that need to be remigrated. Remove the flags and the associated
code.
2004-11-05 11:41:36 +00:00
Pawel Jakub Dawidek
14089dae44 - Add a sysctl kern.geom.mirror.idletime, so one can specify after how many
seconds of idling, DRITY flags are removed.
- If mirror is in idle state or is not open for writing, sleep without
  timeout when waiting for I/O requests.
- Don't use atomic operations, for now sysctls are protected by Giant.
- Update debugs.
2004-11-05 10:55:04 +00:00
Tim J. Robbins
a2222839a5 When the last line of a file is missing a newline in -f mode, pass a
length argument to mbrtowc() that accounts for the terminating newline
character we add automatically. Failing to do this caused the loop to
unexpectedly run out of characters and incorrectly signal an "Illegal byte
sequence" error.
2004-11-05 10:45:23 +00:00
Max Khon
0acb526b67 Check that ee's standard input and output is a terminal.
Do not ignore all the signals in range [1..24].

PR:		65892
MFC after:	2 weeks
2004-11-05 10:18:05 +00:00
Pawel Jakub Dawidek
2fdf5be172 MFp4:
- Fix for good (I hope) force-stopping mirrors and some filure cases
  (e.g. the last good component dies when synchronization is in progress).
  Don't use ->nstart/->nend consumer's fields, as this could be racy,
  because those fields are used in g_down/g_up, use ->index consumer's
  field instead for tracking number of not finished requests.

  Reported by:	marcel

- After 5 seconds of idle time (this should be configurable) mark all
  dirty providers as clean, so when mirror is not used in 5 seconds
  and there will be power failure, no synchronization on boot is needed.

  Idea from:	sorry, I can't find who suggested this

- When there are no ACTIVE components and no NEW components destroy whole
  mirror, not only provider.

- Fix one debug to show information about I/O request, before we change
  its command.
2004-11-05 09:05:15 +00:00
Philip Paeps
35ba0a32fb Sync acpi_asus(4) manual with reality. 2004-11-05 08:03:34 +00:00
Mike Makonnen
b18cb583f6 - Make the header conform to standard rc.d style.
- The 'before ipfw' directive seems bogus, and should instead
  be 'before rcconf'.
2004-11-05 07:35:31 +00:00
Philip Paeps
706bd68cca Fix support for the Asus-compatible gadgets in Samsung P30/P35 laptops.
PR:		73380
Submitted by:	Sebastian Schulze Struchtrup <seb@struchtrup.com>
2004-11-05 07:24:11 +00:00
Alan Cox
1ac60dbce9 Two changes to vm_pgmoveco():
- Eliminate an initialized but unused variable.
 - Eliminate an unnecessary call to clear the page's PG_BUSY flag.  (The
   call to vm_page_rename() already clears the page's PG_BUSY flag through
   its call to vm_page_remove().)
2004-11-05 06:52:29 +00:00
Alan Cox
34d9e6fdae During traversal of the inactive queue, try locking the page's containing
object before accessing the page's flags or the object's reference count.
2004-11-05 06:24:05 +00:00
Alan Cox
b546ac5490 Eliminate another unnecessary call to vm_page_busy() that immediately
precedes a call to vm_page_rename().  (See the previous revision for a
detailed explanation.)
2004-11-05 05:40:45 +00:00
Tim Kientzle
f52188fc8a Correct error handling on failed writes
to the archive.
2004-11-05 05:39:37 +00:00
Tim Kientzle
b772d06c77 Makefile tweaks:
* Update Version
  * Add a missing MLINK
  * Fix 'distfile' target so it works from a clean checkout
2004-11-05 05:38:15 +00:00
David Schultz
b3fed13e9d Close a race in swapoff(). Here are the gory details:
In order to avoid livelock, swapoff() skips over objects with a
  nonzero pip count and makes another pass if necessary.  Since it is
  impossible to know which objects we care about, it would choose an
  arbitrary object with a nonzero pip count and wait for it before
  making another pass, the theory being that this object would finish
  paging about as quickly as the ones we care about.  Unfortunately,
  we may have slept since we acquired a reference to this object.
  Hack around this problem by tsleep()ing on the pointer anyway, but
  timeout after a fixed interval.  More elegant solutions are possible,
  but the ones I considered unnecessarily complicate this rare case.

Also, kill some nits that seem to have crept into the swapoff() code
in the last 75 revisions or so:

- Don't pass both sp and sp->sw_used to swap_pager_swapoff(), since
  the latter can be derived from the former.

- Replace swp_pager_find_dev() with something simpler.  There's no
  need to iterate over the entire list of swap devices just to determine
  if a given block is assigned to the one we're interested in.

- Expand the scope of the swhash_mtx in a couple of places so that it
  isn't released and reacquired once for every hash bucket.

- Don't drop the swhash_mtx while holding a reference to an object.
  We need to lock the object first.  Unfortunately, doing so would
  violate the established lock order, so use VM_OBJECT_TRYLOCK() and
  try again on a subsequent pass if the object is already locked.

- Refactor swp_pager_force_pagein() and swap_pager_swapoff() a bit.
2004-11-05 05:36:56 +00:00
Tim Kientzle
88507deac2 Remove the unused archive_string_sprintf() utility function. 2004-11-05 05:32:04 +00:00
Tim Kientzle
48cbe7223a Revert 1.24: Brain glitch. <sigh> 2004-11-05 05:29:36 +00:00
Tim Kientzle
3ede53f3e1 Clean up the error handling in the
write path.  In particular, this should
solve some problems people have seen with
bsdtar not exiting on various write errors.
2004-11-05 05:26:30 +00:00
Tim Kientzle
9fb9f10286 archive.h gets built in ${.OBJDIR} 2004-11-05 05:23:18 +00:00
Tim Kientzle
3702bc7eb3 Update a comment. 2004-11-05 05:16:40 +00:00
Gleb Smirnoff
240d5a9b1c Protect against local flooder of /var/run/log. Do not loop forever in
syslog(3) if we are a priveleged program (sshd, su, etc.).

- Make syslogd open an additional socket /var/run/logpriv, with 0600
  permissions.
- In libc, try to use this socket.
- Do not loop forever if we are using this socket (partial backout of 1.31)

Reviewed by:	dwmalone, Andrea Campi <andrea webcom it>
Approved by:	julian (mentor)
MFC after:	1 month
2004-11-04 23:09:57 +00:00
Gleb Smirnoff
247444670e - Use stailqueue for sockets instead of socket buffer. Thus
remove limit for 20 sockets.
- Add possibility to specify file mode for sockets created with '-l'.
- Check that socket name in '-l' is absolute.

Reviewed by:	dwmalone, Andrea Campi <andrea webcom it>
Approved by:	julian (mentor)
2004-11-04 22:20:21 +00:00
David Xu
cefe021b6c Don't forget to turn off P_SINGLE_BOUNDARY for thread_single(SINGLE_EXIT),
otherwise a threaded process which calls execv() will hang in kernel and
may can not be killed!
2004-11-04 22:13:16 +00:00