Commit Graph

141504 Commits

Author SHA1 Message Date
Marcel Moolenaar
d349b8aca9 o In decr_get_timecount() only read the low timebase register.
We're only returning a 32-bit counter.
o  In decr_intr(), manually perform LICM, so that we don't test
   a loop invariant condition inside a loop.
o  Include <machine/smp.h>
2008-09-16 17:11:33 +00:00
Marcel Moolenaar
5e3943bf93 Set pcpup->pc_curthread and pcpup->pc_curpcb before calling
pmap_activate. While pmap_activate doesn't need either, we
do need a valid curthread if we enable KTR_PMAP.
2008-09-16 17:03:52 +00:00
Joseph Koshy
24f2c3f394 Replace PMC-dependent content with references to
the appropriate manual pages.
2008-09-16 16:58:24 +00:00
Joseph Koshy
d41debca93 Build and install PMC-dependent manual pages. 2008-09-16 16:57:14 +00:00
Joseph Koshy
7c8e922826 Fix a typo. 2008-09-16 16:53:25 +00:00
Joseph Koshy
2186848edd Move PMC documentation to separate manual pages, one per PMC class. 2008-09-16 16:34:55 +00:00
Marcel Moolenaar
bdd42e42d7 o Synchronize the APs timebase and decrementer values with the BSP.
o  Don't set/get the PIR register. It's CPU dependent.
o  Also initialize pcpup->pc_curpcb, in case it's dereferenced.
2008-09-16 16:33:36 +00:00
Joseph Koshy
020247a4d2 Move TSC specific PMC information to its own manual page. 2008-09-16 16:29:41 +00:00
Marcel Moolenaar
5da7ea0a89 In powerpc_get_pcpup(), make the inline assembly statement
volatile so that the compiler won't perform CSE. For SMP,
this may result in us accessing the wrong PCPU and as such
results in a bogus curthread value.

Note that getting curthread is not quite MP-safe in the sense
that it requires two instructions that aren't performed
atomically. The first instruction gets the address of the PCPU
structure and the second instruction dereferences that pointer
to get curthread. If a thread is switched-out in between these
instructions and switched-in on a different CPU, we still get
the wrong curthread.
2008-09-16 16:28:51 +00:00
John Baldwin
b2ef6b1833 Fix a race with shared lookups on UFS. If the the dirhash code reached the
cap on memory usage, then shared LOOKUP operations could start free'ing
dirhash structures.  Without these fixes, concurrent free's on the same
directory could result in one of the threads blocked on a lock in a dirhash
structure free'd by the other thread.
- Replace the lockmgr lock in the dirhash structure with an sx lock.
- Use a reference count managed with ufsdirhash_hold()/drop() to determine
  when to free the dirhash structures.  The directory i-node holds a
  reference while the dirhash is attached to an i-node.  Code that wishes
  to lock the dirhash while holding a shared vnode lock must first
  acquire a private reference to the dirhash while holding the vnode
  interlock before acquiring the dirhash sx lock.  After acquiring the sx
  lock, it drops the private reference after checking to see if the
  dirhash is still used by the directory i-node.
2008-09-16 16:23:56 +00:00
John Baldwin
5316d529ec - Only set i_offset in the parent directory's i-node during a lookup for
non-LOOKUP operations.
- Relax a VOP assertion for a DELETE lookup.  rename() uses WANTPARENT
  instead of LOCKPARENT when looking up the source pathname.  ufs_rename()
  uses a relookup() to lock the parent directory when it decides to finally
  remove the source path.  Thus, it is ok for a DELETE with WANTPARENT set
  instead of LOCKPARENT to use a shared vnode lock rather than an exclusive
  vnode lock.

Reported by:	kris (2)
Reviewed by:	jeff
2008-09-16 16:18:36 +00:00
John Baldwin
1b7cf11b00 vdropl() drops the vnode interlock. Thus, the code in the QUOTA case that
upgrades the vnode lock if it is share locked was dropping the interlock
before actually checking VI_DOOMED.  Fix this by do the vdropl() after the
check and relying on it to drop the vnode interlock.

Reported by:	pho
Reviewed by:	kib
MFC after:	1 week
2008-09-16 16:15:38 +00:00
Ed Schouten
42ff2756c7 Fix minor TTY API inconsistency.
Unlike tty_rel_gone() and tty_rel_sess(), the tty_rel_pgrp() routine
does not unlock the TTY. I once had the idea to make the code call
tty_rel_pgrp() and tty_rel_sess(), picking up the TTY lock once. This
turned out a little harder than I expected, so this is how it works now.

It's a lot easier if we just let tty_rel_pgrp() unlock the TTY, because
the other routines do this anyway.
2008-09-16 14:57:23 +00:00
Joseph Koshy
6aa5a19391 Correct an event name alias: event "k7-dc-misses" does not support
a unitmask.
2008-09-16 14:13:03 +00:00
Konstantin Belousov
6fecb4e41e Suspend the write operations on the UFS filesystem being unmounted or
remounted from rw to ro.

Proposed and reviewed by:  tegge
In collaboration with:	pho
MFC after:	 1 month
2008-09-16 11:55:53 +00:00
Konstantin Belousov
2814d5ba5f When attempt is made to suspend a filesystem that is already syspended,
wait until the current suspension is lifted instead of silently returning
success immediately. The consequences of calling vfs_write() resume when
not owning the suspension are not well-defined at best.

Add the vfs_susp_clean() mount method to be called from
vfs_write_resume(). Set it to process_deferred_inactive() for ffs, and
stop calling it manually.

Add the thread flag TDP_IGNSUSP that allows to bypass the suspension
point in the vn_start_write. It is intended for use by VFS in the
situations where the suspender want to do some i/o requiring calls to
vn_start_write(), and this i/o cannot be done later.

Reviewed by:	tegge
In collaboration with:	pho
MFC after:	 1 month
2008-09-16 11:51:06 +00:00
Konstantin Belousov
52dfc8d7da Add the ffs structures introspection functions for ddb.
Show the b_dep value for the buffer in the show buffer command.
Add a comand to dump the dirty/clean buffer list for vnode.

Reviewed by:	tegge
Tested and used by:   pho
MFC after:   1 month
2008-09-16 11:19:38 +00:00
Konstantin Belousov
bdb8094763 Garbage-collect vn_write_suspend_wait().
Suggested and reviewed by:	tegge
Tested by:	pho
MFC after:	1 month
2008-09-16 11:09:26 +00:00
Konstantin Belousov
90446e360c When downgrading the read-write mount to read-only, do_unmount() sets
MNT_RDONLY flag before the VFS_MOUNT() is called. In ufs_inactive()
and ufs_itimes_locked(), UFS verifies whether the fs is read-only by
checking MNT_RDONLY, but this may cause loss of the IN_MODIFIED flag
for inode on the fs being remounted rw->ro.

Introduce UFS_RDONLY() struct ufsmount' method that reports the value
of the fs_ronly. The later is set to 1 only after the remount is
finished.

Reviewed by:	tegge
In collaboration with:	pho
MFC after:	 1 month
2008-09-16 10:59:35 +00:00
Konstantin Belousov
0411d79138 The struct inode *ip supplied to softdep_freefile is not neccessary the
inode having number ino. In r170991, the ip was marked IN_MODIFIED, that
is not quite correct.

Mark only the right inode modified by checking inode number.

Reviewed by:	tegge
In collaboration with:	pho
MFC after:	 1 month
2008-09-16 10:52:25 +00:00
Edwin Groothuis
acd5ab2fcb MFV of tzdata2008c:
Changes for Mauritius, Morocco, Pakistan, Palestine, Argentina and Brazil.

Approved by:	bde@ (implicit)
2008-09-16 04:39:44 +00:00
Edwin Groothuis
001dd093e5 Vendor import of tzdata2008f
Changes for Mauritius, Morocco, Pakistan, Palestine, Argentina and
Brazil.

Approved by:	bde (implicit)
2008-09-16 02:36:01 +00:00
Kip Macy
c5f0f48581 Further whitespace and copyright cleanups to minimize the
delta with RELENG_7.
2008-09-16 02:28:08 +00:00
Kip Macy
aa819acf89 White space cleanups to bring closer to RELENG_7 2008-09-16 02:03:28 +00:00
David Xu
d8b04dc0d4 Allow multiple locks to be acquired by detecting corresponding
bit flag, otherwise if a thread acquired a lock, another thread
or the current thread itself can no longer acquire another lock
because thread_mask_set() return whole flag word, this results
bit leaking in the word and misbehavior in later locking and
unlocking.
2008-09-16 01:46:11 +00:00
Marcel Moolenaar
c139f23d17 Remove the tracing from the AP startup. The AP is known
to start and the tracing can interfere with AP startup.
Instead, use the available space in the reset vector
for the initial stack.
2008-09-16 01:05:54 +00:00
Kip Macy
af9b081c37 Remove some dead code along with gratuitous differences between HEAD and 7 2008-09-16 01:02:17 +00:00
Maksim Yevmenkin
edc7005bc3 Add uuid_enc,dec_le,be() functions to Symbol.map
Pointy hat goes to me.

MFC after:	3 days
2008-09-15 23:54:55 +00:00
Maksim Yevmenkin
8e1daad99d Add missing prototypes for uuid_enc,dec_le,be() functions.
Pointy hat goes to me.

MFC after:	3 days
2008-09-15 23:47:19 +00:00
Sam Leffler
5a2637d215 decription of macros to add ddb commands
Submitted by:	Guillaume Ballet <gballet@gmail.com>
MFC after:	1 month
2008-09-15 23:13:29 +00:00
Sam Leffler
30e5495f26 add ddb support (default to off unless built with the kernel) 2008-09-15 22:46:12 +00:00
Sam Leffler
39297ba455 Make ddb command registration dynamic so modules can extend
the command set (only so long as the module is present):
o add db_command_register and db_command_unregister to add and remove
  commands, respectively
o replace linker sets with SYSINIT's (and SYSUINIT's) that register
  commands
o expose 3 list heads: db_cmd_table, db_show_table, and db_show_all_table
  for registering top-level commands, show operands, and show all operands,
  respectively

While here also:
o sort command lists
o add DB_ALIAS, DB_SHOW_ALIAS, and DB_SHOW_ALL_ALIAS to add aliases
  for existing commands
o add "show all trace" as an alias for "show alltrace"
o add "show all locks" as an alias for "show alllocks"

Submitted by:	Guillaume Ballet <gballet@gmail.com> (original version)
Reviewed by:	jhb
MFC after:	1 month
2008-09-15 22:45:14 +00:00
John Baldwin
ca3d37955c Rework the handling of interrupt handlers for children of ppc and ppbus:
- Retire IVARs for passing IRQs around.  Instead, ppbus and ppc now allow
  child devices to access the interrupt by via a rid 0 IRQ resource
  using bus_alloc_resource_any().
- ppc creates its own interrupt event to manage the interrupt handlers of
  child devices.  ppc does not allow child devices to use filters.  It
  could allow this if needed, but none of the current drivers use them
  and it adds a good bit of complication.  It uses
  intr_event_execute_handlers() to fire the child device interrupt handlers
  from its threaded interrupt handler.
- Remove the ppbus_dummy_intr() hack.  Now the ppc device always has an
  interrupt handler registered and we no longer bounce all the way up to
  nexus to manage adding/removing ppbus child interrupt handlers.  Instead,
  the child handlers are added and removed to the private interrupt event
  in the ppc device.
2008-09-15 22:26:32 +00:00
John Baldwin
37e9511fcb Expose a new public routine intr_event_execute_handlers() which executes
all the non-filter handlers attached to an interrupt event.  This can be
used by device drivers which multiplex their interrupt onto the interrupt
handlers for child devices.
2008-09-15 22:19:44 +00:00
David E. O'Brien
109ea24cc1 style(9) 2008-09-15 17:39:40 +00:00
David E. O'Brien
7e29bc757e Regenerate for r183042. 2008-09-15 17:39:01 +00:00
David E. O'Brien
f0f53d8f79 Fix bug in r100384 (rev 1.2) in which the 32-bit swapon(2) was made
"obsolete, not included in system", where as the system call does exist.
2008-09-15 17:37:41 +00:00
Daniel Gerzo
3bea701ec8 - remove superfluous word
PR:		docs/127401
Submitted by:	Mick Charles Beaver <mick@cs.wisc.edu>
MFC after:	1 week
2008-09-15 16:30:06 +00:00
Ed Schouten
7969b32c44 Allow COMPAT_SVR4 to be built without COMPAT_43.
It seems we only depend on COMPAT_43 to implement the send() and recv()
routines. We can easily implement them using sendto() and recvfrom(),
just like we do inside our very own C library.

I wasn't able to really test it, apart from simple compilation testing.
I've heard rumours that COMPAT_SVR4 is broken inside execve() anyway.
It's still worth to fix this, because I suspect we'll get rid of
COMPAT_43 somewhere in the future...

Reviewed by:	rdivacky
Discussed with:	jhb
2008-09-15 15:09:35 +00:00
Doug Rabson
3d3ec67618 Fix async mode (required for ypbind in manycast mode). 2008-09-15 14:02:49 +00:00
Doug Rabson
0be84ce855 Don't rely on private RPC data structures when there is a perfectly good
public API.
2008-09-15 14:01:40 +00:00
Pawel Jakub Dawidek
062ea27ee4 Add missing ZFS_EXIT().
PR:		kern/124899
Submitted by:	Masakazu Asama <m-asama@ginzado.ne.jp>
2008-09-15 11:27:25 +00:00
Konstantin Belousov
dcd8bc9a08 Connect dev_clone.9 and devfs_set_cdevpriv.9 to the build. 2008-09-15 10:12:04 +00:00
Julian Elischer
3ee01afa4e Hey, committed the same typo twice! must be a record 2008-09-15 07:23:56 +00:00
Joseph Koshy
d0d0192f83 Correct a callchain capture bug on the i386.
On the i386 architecture, the processor only saves the current value
of `%esp' on stack if a privilege switch is necessary when entering
the interrupt handler.   Thus, `frame->tf_esp' is only valid for
an entry from user mode.  For interrupts taken in kernel mode, we
need to determine the top-of-stack for the interrupted kernel
procedure by adding the appropriate offset to the current frame
pointer.

Reported by:	kris, Fabien Thomas
Tested by:	Fabien Thomas <fabien.thomas at netasq dot com>
2008-09-15 06:47:52 +00:00
Julian Elischer
1d3ab08a56 rewrite rt_check. Ztake into account that whiel teh rtentry is unlocked,
someone else might change it, so after we re-acquire the lock on it,
we need to check it is still valid. People have been panicing in this
function due to soem edge cases which I have hopefully removed.

Reviewed by:	keramida @
Obtained from:	 1 week
2008-09-15 04:14:53 +00:00
Marcel Moolenaar
cf0c300484 o Remove SPR_TSR & SPR_TCR for AIM.
o  Remove SPR_HID2.
o  Add more SPR_L3CR bit definitions.
2008-09-15 02:51:07 +00:00
Marcel Moolenaar
cadd87749d Dont worry about PSL_RI (restartable interrupt indicator) in
common PowerPC code when all we want to achieve is to enable
external interrupts. We can set PSL_RI at any time before we
allow interrupts and/or exceptions, so move it to the AIM
specific initialization and do it when we also set PSL_ME
(machine check enable).
2008-09-15 01:03:16 +00:00
Marcel Moolenaar
12028e919b Rename cpu_config_l2cr() to cpu_print_cacheinfo(). We're not
configuring the L2 cache on the BSP. Nor the L3 cache. We
merely print the settings.

Save the L2 and L3 cache configuration in global values so
that we know how to configure the cache on APs.
2008-09-15 00:59:49 +00:00
Marcel Moolenaar
df1a6d5102 Remove debugging code. 2008-09-14 21:30:01 +00:00