Commit Graph

66840 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
58e9afacb4 Correct function name in panic().
Reported by:	kensmith
2008-04-07 18:12:37 +00:00
Attilio Rao
e0f62984c1 - Use a different encoding for lockmgr options: make them encoded by
bit in order to allow per-bit checks on the options flag, in particular
  in the consumers code [1]
- Re-enable the check against TDP_DEADLKTREAT as the anti-waiters
  starvation patch allows exclusive waiters to override new shared
  requests.

[1] Requested by:	pjd, jeff
2008-04-07 14:46:38 +00:00
Rui Paulo
b75dfbe80d Actually, I was looking at the wrong Linux .c file. Set INIT2 to its
previous value.
While there, lower the delay for the misterious key.
2008-04-07 12:58:43 +00:00
Robert Watson
7a3244ccb7 Add further TCP inpcb locking assertions to some TCP input code paths.
MFC after:	1 month
2008-04-07 12:41:45 +00:00
Rui Paulo
4fb9bf66ad * Add missing #else in the #ifdef DEBUG section.
* Fix the login in asmc_init().
* Change the INIT2 constant to reflect the same change in the Linux driver.
2008-04-07 12:09:59 +00:00
Rui Paulo
2208c50409 "Prettyfy" numbers in hexadecimal. No functional change. 2008-04-07 11:38:42 +00:00
Rui Paulo
01b18fc48a Remove isa_if.h. 2008-04-07 11:26:13 +00:00
Rui Paulo
4470f0f388 The SMC is represented on the acpi tables, so we can completely remove
dependency on isa. We are now an acpi child.

Also:
	* Add compile time debugging activation
	* Increase the delay for the SMS init flag.
2008-04-07 11:22:12 +00:00
Rui Paulo
e0c098c888 Add opt_intr_filter.h. 2008-04-07 11:08:45 +00:00
Alan Cox
109d493230 Update pmap_page_wired_mappings() so that it counts 2/4MB page mappings. 2008-04-07 07:38:02 +00:00
Robert Watson
a7a91e6592 Maintain and observe a ZBUF_FLAG_IMMUTABLE flag on zero-copy BPF
buffer kernel descriptors, which is used to allow the buffer
currently in the BPF "store" position to be assigned to userspace
when it fills, even if userspace hasn't acknowledged the buffer
in the "hold" position yet.  To implement this, notify the buffer
model when a buffer becomes full, and check that the store buffer
is writable, not just for it being full, before trying to append
new packet data.  Shared memory buffers will be assigned to
userspace at most once per fill, be it in the store or in the
hold position.

This removes the restriction that at most one shared memory can
by owned by userspace, reducing the chances that userspace will
need to call select() after acknowledging one buffer in order to
wait for the next buffer when under high load.  This more fully
realizes the goal of zero system calls in order to process a
high-speed packet stream from BPF.

Update bpf.4 to reflect that both buffers may be owned by userspace
at once; caution against assuming this.
2008-04-07 02:51:00 +00:00
Robert Watson
08304c1617 Coerce if_loop.c in the general direction of style(9):
- Use ANSI function declarations
- Remove use of 'register' keyword
- Prefer style(9) return parens, white space

MFC after:	1 month
2008-04-07 01:43:30 +00:00
Don Lewis
8a3724388b vfs_syscalls.c 1.452 mistakenly swapped the behavior of chown() and lchown(). 2008-04-07 00:29:32 +00:00
Robert Watson
f457d58098 In in_pcbnotifyall() and in6_pcbnotify(), use LIST_FOREACH_SAFE() and
eliminate unnecessary local variable caching of the list head pointer,
making the code a bit easier to read.

MFC after:	3 weeks
2008-04-06 21:20:56 +00:00
Attilio Rao
929ed9490b Bump __FreeBSD_version in order to reflect lockmgr_rw() and
lockmgr_args_rw() introduction.
2008-04-06 20:27:54 +00:00
Attilio Rao
047dd67e96 Optimize lockmgr in order to get rid of the pool mutex interlock, of the
state transitioning flags and of msleep(9) callings.
Use, instead, an algorithm very similar to what sx(9) and rwlock(9)
alredy do and direct accesses to the sleepqueue(9) primitive.

In order to avoid writer starvation a mechanism very similar to what
rwlock(9) uses now is implemented, with the correspective per-thread
shared lockmgrs counter.

This patch also adds 2 new functions to lockmgr KPI: lockmgr_rw() and
lockmgr_args_rw().  These two are like the 2 "normal" versions, but they
both accept a rwlock as interlock.  In order to realize this, the general
lockmgr manager function "__lockmgr_args()" has been implemented through
the generic lock layer. It supports all the blocking primitives, but
currently only these 2 mappers live.

The patch drops the support for WITNESS atm, but it will be probabilly
added soon. Also, there is a little race in the draining code which is
also present in the current CVS stock implementation: if some sharers,
once they wakeup, are in the runqueue they can contend the lock with
the exclusive drainer.  This is hard to be fixed but the now committed
code mitigate this issue a lot better than the (past) CVS version.
In addition assertive KA_HELD and KA_UNHELD have been made mute
assertions because they are dangerous and they will be nomore supported
soon.

In order to avoid namespace pollution, stack.h is splitted into two
parts: one which includes only the "struct stack" definition (_stack.h)
and one defining the KPI.  In this way, newly added _lockmgr.h can
just include _stack.h.

Kernel ABI results heavilly changed by this commit (the now committed
version of "struct lock" is a lot smaller than the previous one) and
KPI results broken by lockmgr_rw() / lockmgr_args_rw() introduction,
so manpages and __FreeBSD_version will be updated accordingly.

Tested by:      kris, pho, jeff, danger
Reviewed by:    jeff
Sponsored by:   Google, Summer of Code program 2007
2008-04-06 20:08:51 +00:00
Alan Cox
44aab2c3de Introduce vm_reserv_reclaim_contig(). This function is used by
contigmalloc(9) as a last resort to steal pages from an inactive,
partially-used superpage reservation.

Rename vm_reserv_reclaim() to vm_reserv_reclaim_inactive() and
refactor it so that a separate subroutine is responsible for breaking
the selected reservation.  This subroutine is also used by
vm_reserv_reclaim_contig().
2008-04-06 18:09:28 +00:00
Alexander Motin
394cb30a36 Rewrite node's r/w/q-lock semantics using only atomics instead of mutex
and atomics combination. Mutex is now used only for queue protection.
Also avoid unneded extra swi scheduling calls.
2008-04-06 15:26:32 +00:00
Jeff Roberson
ce62b59c88 - Correct a major error introduced in the per-cpu timeout commit. Sleep
and wakeup require the same wait channel to function properly.

Found by:	kris
Pointy hat:	me
2008-04-06 11:08:49 +00:00
Olivier Houchard
a90c089ccd Remove bus_space_generic.c from the per-plarform files. Having it in the
per-cpu files should be enough.
2008-04-05 21:57:11 +00:00
Olivier Houchard
e5add3326c Add bus_space_generic.c for the i81342 as well. 2008-04-05 21:51:11 +00:00
John Baldwin
8aa9e82e67 Move INTR_FILTER from opt_global.h to its own header. 2008-04-05 20:13:15 +00:00
John Baldwin
1ee1b68792 Add a MI intr_event_handle() routine for the non-INTR_FILTER case. This
allows all the INTR_FILTER #ifdef's to be removed from the MD interrupt
code.
- Rename the intr_event 'eoi', 'disable', and 'enable' hooks to
  'post_filter', 'pre_ithread', and 'post_ithread' to be less x86-centric.
  Also, add a comment describe what the MI code expects them to do.
- On amd64, i386, and powerpc this is effectively a NOP.
- On arm, don't bother masking the interrupt unless the ithread is
  scheduled in the non-INTR_FILTER case to match what INTR_FILTER did.
  Also, don't bother unmasking the interrupt in the post_filter case if
  we never masked it.  The INTR_FILTER case had been doing this by having
  arm_unmask_irq for the post_filter (formerly 'eoi') hook.
- On ia64, stray interrupts are now masked for the non-INTR_FILTER case.
  They were already masked in the INTR_FILTER case.
- On sparc64, use the a NULL pre_ithread hook and use intr_enable_eoi() for
  both the 'post_filter' and 'post_ithread' hooks to match what the
  non-INTR_FILTER code did.
- On sun4v, retire the ithread wrapper hack by using an appropriate
  'post_ithread' hook instead (it's what 'post_ithread'/'enable' was
  designed to do even in 5.x).

Glanced at by:	piso
Reviewed by:	marius
Requested by:	marius [1], [5]
Tested on:	amd64, i386, arm, sparc64
2008-04-05 19:58:30 +00:00
John Baldwin
9c9191983b During attach on some de(4) adapters the driver sends out a test packet as
part of detecting the media.  Explicitly ensure that we don't send it to
bpf(4) as bpf(4) isn't setup yet.  This worked by accident before the bpf
interface stuff was reworked to avoid other races (bpf_peers_present, etc.)
but now it needs an explicit check to avoid a panic.

MFC after:	3 days
PR:		kern/120915
2008-04-05 17:24:44 +00:00
Takanori Watanabe
9d4ae9aa5b GPE lock may recurse on resume path. 2008-04-05 14:21:01 +00:00
Alan Cox
2fbced6574 Eliminate an unnecessary test from vm_phys_unfree_page(). 2008-04-05 05:02:53 +00:00
Pyun YongHyeon
a76215ece3 Add support for IC Plus IP1001 PHY.
Tested by:	Stuart Fraser < stuart AT stuartfraser DOT net >
2008-04-05 00:52:07 +00:00
Warner Losh
8d3e1f8f7a If you build a compiler with TARGET_BIG_ENDIAN, and then try to build
a little endian kernel, things break.  Be explicit about the endian
choice by setting it in the little endian case as well.
2008-04-04 19:33:09 +00:00
Alan Cox
c416972587 Update a comment to vm_map_pmap_enter(). 2008-04-04 19:14:58 +00:00
Alan Cox
7630c26507 Reintroduce UMA_SLAB_KMAP; however, change its spelling to
UMA_SLAB_KERNEL for consistency with its sibling UMA_SLAB_KMEM.
(UMA_SLAB_KMAP met its original demise in revision 1.30 of
vm/uma_core.c.)  UMA_SLAB_KERNEL is now required by the jumbo frame
allocators.  Without it, UMA cannot correctly return pages from the
jumbo frame zones to the VM system because it resets the pages' object
field to NULL instead of the kernel object.  In more detail, the jumbo
frame zones are created with the option UMA_ZONE_REFCNT.  This causes
UMA to overwrite the pages' object field with the address of the slab.
However, when UMA wants to release these pages, it doesn't know how to
restore the object field, so it sets it to NULL.  This change teaches
UMA how to reset the object field to the kernel object.

Crashes reported by: kris
Fix tested by: kris
Fix discussed with: jeff
MFC after: 6 weeks
2008-04-04 18:41:12 +00:00
Warner Losh
1ff6c09714 Fix stupid typo 2008-04-04 18:22:16 +00:00
Alan Cox
2addc03d04 Eliminate an unnecessary test and its misleading comment from pmap_enter(). 2008-04-04 18:00:22 +00:00
Rafal Jaworowski
367bbd3833 Make kernel.tramp build properly on ARM9E.
Reviewed by:	imp
Approved by:	cognet (mentor)
2008-04-04 17:35:24 +00:00
Jeff Roberson
00ca09449d - Add sysctls at debug.rwlock to control the behavior of the speculative
spinning when readers hold a lock.  This spinning is speculative because,
   unlike the write case, we can not test whether the owners are running.
 - Add speculative read spinning for readers who are blocked by pending
   writers while a read lock is still held.  This allows the thread to
   spin until the write lock succeeds after which it may spin until the
   writer has released the lock.  This prevents excessive context switches
   when readers and writers both hold the lock for brief periods.

Sponsored by:	Nokia
2008-04-04 10:00:46 +00:00
Konstantin Belousov
8eb6b6ecb6 The temporary workaround for the call to the vget() without lock type in
the fdesc_allocvp(). The caller of the fdesc_allocvp() expects that the
returned vnode is not reclaimed. Do lock the vnode exclusive and drop
the lock after.

Reported by:	pho
Reviewed by:	jeff
2008-04-04 09:37:57 +00:00
Jeff Roberson
3bc8c68d9f - Add a Nokia copyright to cpuset to reflect their generous
contribution to this work.
2008-04-04 01:22:04 +00:00
Jeff Roberson
0502fe2e43 - Allow static_boost to specify no boost with '0', traditional kernel
fixed pri boost with '1' or any priority less than the current thread's
   priority with a value greater than two.  Default the boost to
   PRI_MIN_TIMESHARE to prevent regular user-space threads from starving
   threads in the kernel.  This prevents these user-threads from also
   being scheduled as if they are high fixed-priority kernel threads.
 - Restore the setting of lowpri in tdq_choose().  It has to be either here
   or in sched_switch().  I accidentally removed it from both places.

Tested by:	kris
2008-04-04 01:16:18 +00:00
Jeff Roberson
03d17db7d5 - Don't check for the ITHD pri class in tdq_load_add and rem. 4BSD doesn't
do this either.  Simply check P_NOLOAD.  It'd be nice if this was
   in a thread flag so we didn't have an extra cache miss every time we
   add and remove a thread from the run-queue.
2008-04-04 01:04:43 +00:00
Jeff Roberson
e4b1aa6210 - Fix a mis-merge that crept in during the softclock changes.
Spotted by:	jhb
2008-04-04 01:03:23 +00:00
Ed Maste
77cd5850c8 Allow crashdumps on machines with >4GB of RAM as long as the adapter can
do 64-bit S/G.

Submitted by:	Alex Bencz
Reviewed by:	scottl
2008-04-03 23:29:31 +00:00
Jack F Vogel
8cecae251c Fix the build breakage, need the | between dependencies, I didn't
realize that :(
2008-04-03 20:58:18 +00:00
Warner Losh
ecf899b423 Always build kernel.tramp. This should be helpful for a lot of
people, as well making sure it doesn't break.
2008-04-03 20:42:36 +00:00
Rafal Jaworowski
15898edac1 Now really add the bus_space_generic.c file...
Reviewed by:	sam
Approved by:	cognet (mentor)
2008-04-03 18:28:34 +00:00
Rafal Jaworowski
47e972c91a Refactor certain ARM bus space methods: instead of having multiple copies of
the same code introduce sys/arm/arm/bus_space_generic.c for a shared set of
routines.

Reviewed by:	sam
Approved by:	cognet (mentor)
2008-04-03 18:22:08 +00:00
Rafal Jaworowski
b7170e5c34 Fix AVILA build.
Reviewed by:	sam
Approved by:	cognet(mentor)
2008-04-03 18:20:39 +00:00
Marcel Moolenaar
7256cdffc9 Align functions to 16-byte boundaries due to profiling granularity. 2008-04-03 17:40:20 +00:00
Marcel Moolenaar
66821a4c67 Set sc_psim so that the openpic core can correct the off-by-one
error in the number of IRQs that PSIM gives us.
2008-04-03 17:38:27 +00:00
Warner Losh
aa037d58ea Take the first baby step towards unifying and cleaning up arminit():
- Pull all the code to deal with the trampoline stuff into one
	  centeralized place and use it from everywhere.
	- Some minor style tidiness

Reviewed by: tinguely
2008-04-03 16:44:50 +00:00
Scott Long
942adee743 Don't force a reset at driver attach time. It doesn't work on some
adapters, apparently.
2008-04-03 14:39:48 +00:00
David Xu
44253336b6 let umtxq_busy() only spin on mp machine. make function name
do_rwlock_unlock to be consistent with others.
2008-04-03 11:49:20 +00:00