Matthew Dillon [Fri, 26 Mar 2010 05:42:47 +0000 (22:42 -0700)]
HAMMER VFS - Implement REDO recovery code
* Implement the primary REDO recovery mechanics and document the whole mess.
REDO recovery essentially works using an expanded UNDO/REDO FIFO range.
The nominal UNDO range, required for running UNDOs, is calculated first.
If a REDO_SYNC record is found within this range the record specifies
the expanded FIFO start offset required to run REDOs. This is necessary
because the inodes related to REDOs layed down in the FIFO are not
necessarily flush in the next flush sequence, so the recovery code may
have to scan the UNDO/REDO FIFO backwards considerably beyond the nominal
recovery ranged required to run UNDOs in order to find active REDOs.
When a REDO_SYNC record is found the recovery code expands the range
by scanning backwards and validating the UNDO/REDO FIFO as it goes.
It must make sure that the sequence space remains contiguous all the
back to the REDO_SYNC point.
While doing the reverse scan the recovery code collects REDO_TERM_*
records which are used to mask earlier REDO_* records once their
meta-data has been flushed. Only TERM records in the expanded range
that are outside the nominal UNDO range matter. Any TERM records in
the nominal UNDO range refer to meta-data which was undone by the
stage1 UNDO recovery and so must be ignored (we want to run the
related REDOs).
The recovery code then does a forward scan through the entire expanded
range of the UNDO/REDO FIFO executing any REDO_* records it finds
which have not been masked by later REDO_TERM_* records. It executes
the REDOs using the live filesystem.
* Expand the REDO FIFO structure, I had forgotten to add a localization
field, otherwise HAMMER doesn't know which PFS the REDO is refering to.
* Umount was improperly flushing the FIFO to the disk for read-only mounts.
Fix it.
* The recovery code now detects whether any REDOs are present by the
observation of a REDO_SYNC record in the nominal UNDO recovery range.
It will not run stage2 (the REDO pass) if it does not see this record.
* Properly generate a REDO_SYNC record in the UNDO space when generating
only REDOs, as well as UNDOs. HAMMER was previously only generating
the REDO_SYNC record when generating UNDOs.
* Generate a REDO_TRUNC record during a file flush if any records were
previously queued with REDO, even if those records no longer exist
(e.g. due to a truncation) and even if REDO is now turned off due to
redo heuristic limits being exceeded.
This is necessary in order for the recovery code to properly sequence
REDOs and TRUNCations during recovery.
* For now be very verbose during redo recovery.
* Make sure that mount -o ro and mount -u -o rw work properly. The
stage2 REDO cannot be run on a read-only mount because it requires a
live filesystem. The operations are defered until the mount is
upgraded to rw.
Matthew Dillon [Thu, 25 Mar 2010 17:35:43 +0000 (10:35 -0700)]
cpdup - Fix bug where cpdup sometimes does not remove files on target
* Fix a bug introduced in a recent commit which caused cpdup to sometimes
not remove files on the target which were removed from the source.
Submitted-by: Oliver Fromme <check+kzu4p100rs0rfx01@fromme.com>
Joe Talbott [Thu, 25 Mar 2010 15:17:44 +0000 (11:17 -0400)]
initdiskless - Handle cpio archives in accordance with the comments.
Match cpio archive handling with what is indicated in the comments
Don't bother using gzip since cpio can handle gzipped archives.
Submitted-By: Rumko
Issue: 1568
YONETANI Tomokazu [Wed, 24 Mar 2010 07:59:14 +0000 (16:59 +0900)]
nrelease - leftover from transition to building from pkgsrc tree
the conditional is always true as PKGSRC_BOOTSTRAP_KIT is defined in nowhere.
Samuel J. Greear [Wed, 24 Mar 2010 19:40:47 +0000 (13:40 -0600)]
linux - Allow for maps to be read in chunks
Samuel J. Greear [Wed, 24 Mar 2010 17:50:05 +0000 (11:50 -0600)]
linux - Add syscalls
* Stub out a number of syscalls using the DUMMY macro
* Add a preliminary implementation of pipe2
Alex Hornung [Wed, 24 Mar 2010 21:12:58 +0000 (21:12 +0000)]
remove several leftover debug kprintfs
Reported-by: Rumko
Alex Hornung [Wed, 24 Mar 2010 20:36:24 +0000 (20:36 +0000)]
vn_fullpath.9 - Document new guess feature
Alex Hornung [Wed, 24 Mar 2010 20:26:55 +0000 (20:26 +0000)]
linprocfs - further fix /proc/{pid}/maps
* Change to use sbufs instead of ksprintf and don't copy out to userland
until done parsing maps.
* Avoid using EFBIG, since linux programs don't understand it.
* Make use of the new vn_fullpath guessing so that it is likely that we
get the right path.
* Fix a bug when fullpath was NULL.
Reported-by: Samuel J. Greear
Alex Hornung [Wed, 24 Mar 2010 20:24:05 +0000 (20:24 +0000)]
cache_fullpath - Guess mountpoints if requested
* cache_fullpath (and vn_fullpath) now take an extra parameter, guess,
which, if != 0, makes cache_fullpath look for a matching mp if an ncp
flagged as a mountpoint is found while traversing upwards.
This fixes uses of *_fullpath when no nch is provided, but only a vp.
* Change all consumers of cache_fullpath and vn_fullpath to accomodate
for the extra parameter.
Suggested-by: Matthew Dillon
Matthew Dillon [Wed, 24 Mar 2010 18:25:37 +0000 (11:25 -0700)]
Merge remote branch 'crater/master' into vkernel64
Matthew Dillon [Wed, 24 Mar 2010 17:02:05 +0000 (10:02 -0700)]
kernel - Turn on vfs.cache_mpsafe by default
* Change the vfs.cache_mpsafe default from 0 to 1.
Matthew Dillon [Wed, 24 Mar 2010 05:09:57 +0000 (22:09 -0700)]
kernel - vm - Change inactive target to 1/4 memory instead of 1/2 memory.
Matthew Dillon [Wed, 24 Mar 2010 05:04:31 +0000 (22:04 -0700)]
tools - Add scripts for snapshot generation.
Matthew Dillon [Tue, 23 Mar 2010 23:38:58 +0000 (16:38 -0700)]
NFS - Remove debugging kprintfs
* Remove the "Warning: NFS/rddirplus, UNABLE TO ENTER..." debugging
kprintf.
Matthew Dillon [Tue, 23 Mar 2010 23:27:50 +0000 (16:27 -0700)]
HAMMER VFS - Fix another low memory deadlock issue
* Unlock the cursor around calls to vm_wait_nominal() to avoid deadlocking
while holding shared node locks.
* Add vm_test_nominal() which returns TRUE if vm_wait_nominal() would
block.
Reported-by: Francois Tigeot <ftigeot@wolfpond.org>
Matthew Dillon [Tue, 23 Mar 2010 22:27:40 +0000 (15:27 -0700)]
vkernel64 - Add missing bits from later kernel work in the main tree
* Add missing virtual kernel intercept in 64-bit real kernel trap.c code.
* Add td_ucred caching to userenter() in vkernel64 trap.c code.
* Set PG_RW, PG_U, PG_V in pcb_cr3. It is unclear whether these
are necessary.
* Remove debugging.
Matthew Dillon [Tue, 23 Mar 2010 21:00:04 +0000 (14:00 -0700)]
vkernel64 - Ignore spurious trap during fast system call, enable some debugging
Matthew Dillon [Tue, 23 Mar 2010 18:52:51 +0000 (11:52 -0700)]
vkernel - Fix the vfs.root.mountfrom for the vkernel test code
* This parameter is not yet used by the vkernel but fix it anyway.
Matthew Dillon [Tue, 23 Mar 2010 18:42:42 +0000 (11:42 -0700)]
vkernel64 - Cleanup, unbreak 32 bit
* Remove stdio cruft from init_main.c
* Change vpte_t from 64-bits to u_long, so it will be 32 bits
on 32 bit machines and 64 bits on 64 bit machines. 32 bit
machines can't handle the address space breakdown or issue
atomic ops on 64 bit quantities.
Adjust various defines in sys/vkernel.h to accomodate both
cases.
* Adjust atomic ops used by vm/vm_fault.c for virtual page
table access (int -> long).
* Adjust atomic ops and types used by the 32 bit
platform/vkernel code, primarily (int -> long) and
also some vm_offset_t's which are really vm_paddr_t's
or vpte_t's.
* Adjust src/test/vkernel/Makefile to run properly on
a 32 or 64 bit system.
Matthew Dillon [Tue, 23 Mar 2010 16:45:11 +0000 (09:45 -0700)]
Merge remote branch 'crater/master' into vkernel64
Stathis Kamperis [Mon, 22 Mar 2010 19:19:48 +0000 (21:19 +0200)]
conj.3: Mention conjl.
Matthew Dillon [Tue, 23 Mar 2010 08:39:25 +0000 (01:39 -0700)]
nrelease - Fix ordering dependency during parallel buildkernel (try 2)
* Further adjustments to the .ORDER: to try to fix the header file
race.
Matthew Dillon [Tue, 23 Mar 2010 08:37:51 +0000 (01:37 -0700)]
newvers - further shorten branch name in vers.txt
* Adjust vers.txt to generate a shortern branch name
DEVELOPMENT -> DEV
RELEASE -> REL
Matthew Dillon [Tue, 23 Mar 2010 05:44:33 +0000 (22:44 -0700)]
kernel - Change the vfs.vm_cycle_point default from 23 to 40
* Large volumes of filesystem activity can cause a lot of data cycling
to occur and we generally want this cycling to occur within the inactive
queue where it doesn't push-out idle but strategic pages related to
resident programs in the active queue.
A larger vm_cycle_point value will tend to cause VM pages related to
released buffer cache buffers to be cycled back into the inactive queue,
leaving the pages in the active queue alone. A smaller vm_cycle_point
value will move the more often-used buffer cache buffer pages to the
active queue when the buffer is released.
* Unfortunately there are typically a lot of VM pages related to resident
programs such as xterms and databases which can remain idle for long
periods of time. Excessive cycling of buffer cache pages to the
active queue can cause these long-idle pages to be pushed out to
swap and/or freed.
This results in an annoyance when these processes go active again,
particular ssh, xterm, and other interactive programs. These are
not necessarily going to perform badly once the pages are paged back
in, however.
* It has been found that certain large-scale scans of the filesystem such
as the HAMMER reblocker and overnight cron jobs could push active pages
out unnecessarily. Raising vfs.vm_cycle_point to 40 essentially fixes
this problem but at the cost of potentially starving the 'file cache'
for data sets which would otherwise fit into memory (and for which the
sysop might desire to fit into memory). So YMMV.
Testing-by: Francois Tigeot <ftigeot@wolfpond.org>
Matthew Dillon [Tue, 23 Mar 2010 05:07:45 +0000 (22:07 -0700)]
nrelease - Fix ordering dependency during parallel buildkernel
* Make sure aicasm_gram.h is generated before the aicasm_scan.l
dependency. aicasm_scan.c is generated from aicasm_scan.l and
depends on aicasm_gram.h.
Not quite sure if this ORDER directive is correct.
Matthew Dillon [Mon, 22 Mar 2010 22:28:40 +0000 (15:28 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 22 Mar 2010 22:28:14 +0000 (15:28 -0700)]
nrelease - Add dummy fetch target for x86_64
* Ensure the fetch target is valid regardless of the architecture
Sascha Wildner [Mon, 22 Mar 2010 21:10:36 +0000 (22:10 +0100)]
Sync zoneinfo database with tz{code,data}2010f from elsie.
antarctica: 8.7 -> 8.8
asia: 8.55 -> 8.56
australasia: 8.16 -> 8.17
zone.tab: 8.33 -> 8.34
zic.8: 8.4 -> 8.6
* antarctica: Changes to Australian stations.
* asia: Change Syria DST start from last Friday in March to first Friday
in April in 2010 and forward.
* australasia: Correct 2010 Samoa DST start date.
* zone.tab: Add Antarctica/Macquarie.
* zic.8: Add material on case, abbreviations, and use of English.
Matthew Dillon [Mon, 22 Mar 2010 20:08:40 +0000 (13:08 -0700)]
nrelease - Unconditionally rm -rf /usr/release/root
* rm -rf /usr/release/root even for quick nrelease builds to prevent
stuff from an img build getting into an iso build.
Matthew Dillon [Mon, 22 Mar 2010 18:00:49 +0000 (11:00 -0700)]
buildkernel - generate vers.txt file
* Generate a file containing a conveninent descriptive version string
for the kernel build.
Stathis Kamperis [Mon, 22 Mar 2010 07:01:38 +0000 (09:01 +0200)]
libm: Hook cprojl.c into build.
Reported-by: swildner@
Sascha Wildner [Mon, 22 Mar 2010 03:54:49 +0000 (04:54 +0100)]
Clean up some specfs remains.
Sascha Wildner [Sun, 21 Mar 2010 22:29:17 +0000 (23:29 +0100)]
syscons(4): Remove (unused) scgfbrndr.c.
Sascha Wildner [Sun, 21 Mar 2010 23:12:38 +0000 (00:12 +0100)]
syscons(4): Base renderer selection on the new mode's memory model.
Remove the hack that was initializing the renderer's functions
after switching.
Sascha Wildner [Sun, 21 Mar 2010 09:11:10 +0000 (10:11 +0100)]
vkernel64: Additional adjustments (amd64 -> x86_64, recent commits etc.).
Jordan Gordeev [Sat, 13 Feb 2010 13:08:18 +0000 (15:08 +0200)]
amd64: Fixes for the vkernel.
Jordan Gordeev [Sat, 13 Feb 2010 13:02:22 +0000 (15:02 +0200)]
amd64: Pass correct address to signal handlers.
Jordan Gordeev [Fri, 12 Feb 2010 13:05:25 +0000 (15:05 +0200)]
/dev/klog: Ensure correct results in computation.
The 64-bit vkernel blows up without this change, unlike the pc64 kernel.
Jordan Gordeev [Fri, 12 Feb 2010 11:59:18 +0000 (13:59 +0200)]
vkernel64: Add a warning when KERNBASE is used.
Uses of KERNBASE in the vkernel should be reviewed.
Jordan Gordeev [Fri, 22 Jan 2010 20:29:03 +0000 (22:29 +0200)]
vkernel64: Fix the way syscalls are passed to the vkernel.
Jordan Gordeev [Thu, 7 Jan 2010 10:30:15 +0000 (12:30 +0200)]
vkernel64: Add bug workaround.
Jordan Gordeev [Fri, 1 Jan 2010 18:57:33 +0000 (20:57 +0200)]
amd64: Add kernel support for 64-bit virtual page tables.
WARNING: This change removes support for 32-bit vpagetables.
Jordan Gordeev [Fri, 1 Jan 2010 18:56:50 +0000 (20:56 +0200)]
amd64: Move declaration of npxdna().
Helps the vkernel.
Jordan Gordeev [Sun, 16 Aug 2009 12:58:30 +0000 (15:58 +0300)]
amd64: Update some header files for the vkernel.
Jordan Gordeev [Mon, 17 Aug 2009 20:44:39 +0000 (23:44 +0300)]
Add platform vkernel64.
Jordan Gordeev [Sun, 9 Aug 2009 17:57:46 +0000 (20:57 +0300)]
amd64: Move some kernel files.
Helps building of vkernel.
Constantine A. Murenin [Sat, 20 Mar 2010 23:30:14 +0000 (19:30 -0400)]
wbsio: support W83627UHG (0xa2); supported by lm(4) as W83627DHG (0xc1)
http://www.nuvoton.com/NR/rdonlyres/
05612BFF-6F4B-48F8-9A19-
85251648EE63/0/W83627UHG.pdf
Constantine A. Murenin [Sat, 20 Mar 2010 23:14:09 +0000 (19:14 -0400)]
wbsio(4): support W83627DHG-P (0xb0); hw mon supported by lm(4) as W83627DHG (0xc1)
http://www.nuvoton.com/NR/rdonlyres/
7E862DA6-DFBD-4FAC-A2E0-
D549FF86663C/0/W83627DHGP_W83627DHGPT.pdf
Constantine A. Murenin [Sat, 20 Mar 2010 23:10:23 +0000 (19:10 -0400)]
wbsio(4): support W83687THF (0x85); hw mon is already supported by lm(4) as W83627THF (0x90)
http://lists.lm-sensors.org/pipermail/lm-sensors/2006-January/014974.html
http://fxr.watson.org/fxr/source/drivers/hwmon/w83627hf.c?v=linux-2.6
(no datasheet available)
Matthew Dillon [Sat, 20 Mar 2010 20:01:38 +0000 (13:01 -0700)]
HAMMER VFS - frontload kmalloc()'s when rebalancing
* The rebalancing code must allocate upwards of 16MB of memory to hold
copies of B-Tree nodes (~64*64*4K). This is enough to blow out the
emergency memory reserve used by the pageout daemon and deadlock the
system in low memory situations.
* Refactor the allocations. Allocate all the memory up-front so no
major allocations occur while nodes in the B-Tree are held locked.
* There are probably other cases where this may become a problem. With
UFS it wasn't an issue because flushing a file was fairly unsophisticated.
But with HAMMER certain aspects of the flush require B-Tree lookups and
can't be dumbed down to a simple raw disk write.
The rebalancing code was the most aggregious abuser of kernel memory
though and that should now be fixed.
Reported-by: Francois Tigeot <ftigeot@wolfpond.org>
Sascha Wildner [Sat, 20 Mar 2010 18:04:51 +0000 (19:04 +0100)]
Some more cleanup after the addition of lightweight buffers.
Remove NSFBUFS and kern.ipc.nsfbufs remains.
Sascha Wildner [Sat, 20 Mar 2010 12:13:16 +0000 (13:13 +0100)]
Add a nullfs manual page (adapted from FreeBSD).
Sascha Wildner [Sat, 20 Mar 2010 10:08:54 +0000 (11:08 +0100)]
Put 4 more kernel files under -Werror (fix x86_64 warnings).
Sascha Wildner [Sat, 20 Mar 2010 10:08:31 +0000 (11:08 +0100)]
Fix LINT kernel build.
Samuel J. Greear [Fri, 19 Mar 2010 17:03:56 +0000 (11:03 -0600)]
kernel - Include headers declaring vm_page_t in lwbuf headers
This commit unbreaks buildworld on i386.
Reported-by: Jan Lentfer
Sascha Wildner [Fri, 19 Mar 2010 18:15:42 +0000 (19:15 +0100)]
lwbuf.9: Add MLINKS and perform some cleanup.
Samuel J. Greear [Thu, 18 Mar 2010 19:05:16 +0000 (13:05 -0600)]
kernel - lwbuf SLIST safety
* Add critical sections around modifications to lwbuf SLIST in globaldata
* Cache globaldata pointer to reduce generated code
Spotted-by: Venkatesh Srinivas
Samuel J. Greear [Tue, 9 Mar 2010 09:24:55 +0000 (02:24 -0700)]
kernel - Introduce lightweight buffers
* Summary:
The lightweight buffer (lwbuf) subsystem is effectively a reimplementation
of the sfbuf (sendfile buffers) implementation. It was designed to be
lighter weight than the sfbuf implementation when possible, on x86_64
we use the DMAP and the implementation is -very- simple. It was also
designed to be more SMP friendly.
* Replace all consumption of sfbuf with lwbuf
* Refactor sfbuf to act as an external refcount mechanism for sendfile(2),
this will probably go away eventually as well.
Constantine A. Murenin [Thu, 18 Mar 2010 22:19:56 +0000 (18:19 -0400)]
wbsio(4): be less verbose if the device doesn't look like a wbsio device
Constantine A. Murenin [Thu, 18 Mar 2010 21:57:39 +0000 (17:57 -0400)]
wbsio(4): be more verbose for unsupported devices if loaded as a module or if bootverbose
Constantine A. Murenin [Thu, 18 Mar 2010 19:34:54 +0000 (15:34 -0400)]
wbsio(4) && lm(4): add support for `kldload lm.ko wbsio.ko`
Matthew Dillon [Thu, 18 Mar 2010 18:46:16 +0000 (11:46 -0700)]
kernel - devfs - Fix memory leak in devfs_destroy_device_node()
* M_TEMP is used by devfs to allocate temporary PATH_MAX buffers
* devfs had a memory leak in a particular failure case, fix it.
This is likely the reported problem.
Reported-by: John Marino <john@marino.st>
Constantine A. Murenin [Thu, 18 Mar 2010 09:03:11 +0000 (05:03 -0400)]
aps(4): make the aps module, aps.ko, work as well as the in-kernel device
Constantine A. Murenin [Mon, 15 Mar 2010 17:43:31 +0000 (13:43 -0400)]
wbsio(4): support W83667HG (0xa5); its hw mon is already supported by lm(4) as W83627DHG (0xc1)
Alex Hornung [Wed, 17 Mar 2010 14:20:15 +0000 (14:20 +0000)]
kern_{get,set}sockopt - invalid value check
* Check for sopt_val != NULL && sopt_valsize == 0 and return EINVAL in
this case, or else an assert will be triggered and the kernel will
panic.
Dragonfly-bug: http://bugs.dragonflybsd.org/issue1696
Matthew Dillon [Wed, 17 Mar 2010 03:52:20 +0000 (20:52 -0700)]
HAMMER VFS - Cleanup recovery kprintfs a bit
* Minor formatting cleanups.
Matthew Dillon [Wed, 17 Mar 2010 02:52:13 +0000 (19:52 -0700)]
vmstat - update for changes in nch structure
* Adjust for changes in the namei / path lookup statistics structure
Alex Hornung [Tue, 16 Mar 2010 22:22:46 +0000 (22:22 +0000)]
linux emu - fix some signalling mess
* This fixes sigaction in the linux emu, which broke times03 and
possibly also part of java (and who knows, maybe flash?)
Matthew Dillon [Tue, 16 Mar 2010 21:30:53 +0000 (14:30 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 16 Mar 2010 21:29:14 +0000 (14:29 -0700)]
kernel - Fix kernel memory leak in devfs disk_probe()
* kfree() the old slices structure after installing a new one.
* Do a minor refactoring of dsgone().
* Possibly fixes a kernel memory leak generated by kde's CD probing.
Reported-by: Pierre Abbat <phma@phma.optus.nu>
Alex Hornung [Tue, 16 Mar 2010 21:24:07 +0000 (21:24 +0000)]
linux emu - fix exit status on exit_group
* Previously, the exit status was set incorrectly; the exit signal was
being set instead with the supposed exit status.
Matthew Dillon [Tue, 16 Mar 2010 19:17:45 +0000 (12:17 -0700)]
systat - break out read and write I/O activity, change namecache statistics
* Add additional rows to break the I/O statistics into separate read and
write stats (something I've always wanted systat to do).
* Rework the namecache statistics. Primarily show whole path lookups
stats instead of component lookups, and then also print the average
number of components.
Matthew Dillon [Tue, 16 Mar 2010 19:15:54 +0000 (12:15 -0700)]
kernel - rework struct nchstats for systat
* Remove ncs_long, ncs_pass2 and ncs_2passes and replace with
ncs_longhits, ncs_longmiss, and ncs_unused (so the structure
size does not change).
The new longhits/longmiss statistics are for whole path
lookups.
Matthew Dillon [Tue, 16 Mar 2010 19:14:02 +0000 (12:14 -0700)]
libdevstat - Add compute_stats_read() and compute_stats_write()
* Add versions of compute_stats() which separate out the read and
write activity.
Matthew Dillon [Tue, 16 Mar 2010 17:39:01 +0000 (10:39 -0700)]
HAMMER VFS - Fix an edge case in hammer_inode_waitreclaims()
* Detached inodes can build up in the flusher, causing iqueued/reclaiming
to increase. hammer_inode_waitreclaims() is designed to slow down
the processes responsible (typically a rm -rf) to prevent the backlog
from blowing out kernel memory.
* hammer_inode_waitreclaims() had a bug where a new pid entry was not
being placed in the hash table such that it would be properly found
by the chaining. Fix this case.
* This fixes an issue where a simultanious rm -rf and (typically) two or
more directory iterations via ls or find over hundreds of thousands or
millions of files could cause the number of detached inodes to increase
in an unbounded fashion.
Aggelos Economopoulos [Tue, 16 Mar 2010 13:13:25 +0000 (15:13 +0200)]
pmap: Warning -> Debug
This message does not concern the system administrator,
try not to get them worried for no reason.
Alex Hornung [Tue, 16 Mar 2010 12:24:45 +0000 (12:24 +0000)]
linux emu - fix bug in futex
* when resetting the fault handler in futex_orl - futex_tail, reset ecx
to the right value.
Alex Hornung [Tue, 16 Mar 2010 12:46:37 +0000 (12:46 +0000)]
kern_synch - unbreak UP build
* recent work on allowing volatile idents for tsleep and wakeup broke UP
build.
Alex Hornung [Tue, 16 Mar 2010 11:29:21 +0000 (11:29 +0000)]
linux emu - fix MP bug related to TLS
* all TLS functions were passing out or assuming the wrong value to load
into gs. As a matter of fact, this should be the same for SMP and UP,
but just in case keep the old code in #if 0's.
Alex Hornung [Tue, 16 Mar 2010 09:02:47 +0000 (09:02 +0000)]
linprocfs - fix multi-CPU stat & cpuinfo
* Add multiprocessor support to /proc/stat and /proc/cpuinfo, as the
sysconf() function uses these to find the total number of CPUs in the
system.
Matthew Dillon [Tue, 16 Mar 2010 08:57:28 +0000 (01:57 -0700)]
build - Fix ordering to avoid -j race
* The mkdir -p must complete prior to any source file copies.
Matthew Dillon [Mon, 15 Mar 2010 20:12:23 +0000 (13:12 -0700)]
kernel - change tsleep related idents to const volatile void *
* There's no reason why pointers to const or volatiles can't be passed
as the ident, and HAMMER does that now in some cases, so adjust the
prototypes for *sleep() and *wakeup() to accomodate them.
* Also make thread->td_wchan const volatile void *
Alex Hornung [Mon, 15 Mar 2010 19:08:42 +0000 (19:08 +0000)]
linux emu - iron out bugs
* mmap: make sure that PROT_READ is not set if PROT_NONE is specified.
* sysinfo: Updata sysinfo to the new structure used since linux
2.3.something.
Matthew Dillon [Mon, 15 Mar 2010 17:50:16 +0000 (10:50 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 15 Mar 2010 17:49:03 +0000 (10:49 -0700)]
HAMMER VFS - Hack cursor iterator when locked cursor moved to parent
* A cursor is also moved to its parent normally when deleting the last
element in a node and that node is then destroyed.
Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Matthew Dillon [Mon, 15 Mar 2010 09:07:23 +0000 (02:07 -0700)]
HAMMER VFS - Major retooling of the refcount mechanics, and fix a deadlock
* Add an interlock to hammer_lock->refs which is independent of
hammer_lock->lockval.
* Retool the refcount mechanics to integrate the interlock on 0->1 and
1->0 transitions.
In addition implement a check bit to deal with serialization races
between threads which forces all threads to interlock. This deals
with the case where one thread bumps the refcount (lock->refs) but
is unable to immediateliy acquire the interlock. Other threads doing
the same thing will race and lock->refs will be bumped far higher
than 1. The check bit is set on the 0->1 transition and enforces
all threads to serialize until one (usually the first to acquire the
lock) is able to dispose of the check condition.
The transition interlocks are used to do I/O loading and validation
on the 0->N transition and I/O unloading and invalidation on the 1->0
transition.
* The new integrated mechanics also simplify hammer_io's handling of
B_LOCKED slightly and properly interlocks changes in disposition for
the related buffer cache buffer against refcount transitions.
* The new integrated refcount/interlock is also more optimal as the
combined operation can be done in a single atomic_cmpset_int() call,
and fully MPSAFE. Even though other major portions of HAMMER are not
yet MPSAFE getting this particular bit dealt with will ease MP work
later on.
* Retool the volume, buffer, and node referencing code to use the new
mechanics. This fixes a deadlock. These routines were previously
acquiring an exclusive lock instead of an interlock. The exclusive
lock could combine with shared locks held by the same thread to create
a deadlock situation against other threads.
Use of the interlock fixes this particular deadlock.
Reported-by: Francois Tigeot <ftigeot@wolfpond.org> (deadlock report)
Sascha Wildner [Sun, 14 Mar 2010 12:48:50 +0000 (13:48 +0100)]
fetch.9: Minor fixes.
Alex Hornung [Sun, 14 Mar 2010 09:32:00 +0000 (09:32 +0000)]
fetch.9 - document casuword
Alex Hornung [Sun, 14 Mar 2010 09:06:30 +0000 (09:06 +0000)]
nlookup.9 - document nlookup_init_root
Alex Hornung [Sun, 14 Mar 2010 08:57:36 +0000 (08:57 +0000)]
vfs_synth - rewrite
* Rewrite the whole vfs_synth mess to be compatible with devfs. Now we
create a synthetic mountpoint and mount devfs on it. We then just
nlookup() whatever device we need on that mountpoint.
* This also fixes vinum rootmount. To use vinum as a root,
vfs.root.mountfrom in /boot/loader.conf has to be set to
"<fs>:vinum/vinumroot" where <fs> can be ufs or hammer.
Reported-by: Rumko, tuxillo
Dragonfly-bug: http://bugs.dragonflybsd.org/issue1565
Alex Hornung [Sun, 14 Mar 2010 08:27:32 +0000 (08:27 +0000)]
nlookup - introduce nlookup_init_root
* nlookup_init_root is similar to nlookup_init_raw, but does not assume
rootnch is set already, but rather has one more parameter which
specifies the root nch.
Sascha Wildner [Sun, 14 Mar 2010 12:11:40 +0000 (13:11 +0100)]
hammer.8: Fix list.
Sascha Wildner [Sun, 14 Mar 2010 11:55:11 +0000 (12:55 +0100)]
Adjust some more to the recent groff 1.20.1 import.
* Dx is now a built in macro, so remove our local definition. But the
version supplied with groff still doesn't work correctly due to a
missing register declaration in doc-common. Fix that locally for now
(patch sent upstream).
* Sync various definitions (standards, operating systems) with doc-common
and doc-syms, i.e. remove our local definitions where they are part of
groff now.
Matthew Dillon [Sun, 14 Mar 2010 05:16:38 +0000 (21:16 -0800)]
HAMMER VFS - Hack cursor iterator when unlocked cursor moved to parent
* It is possible to reverse-index a cursor while it is unlocked due to
a node deletion moving cursors on that node to the parent, and a
subsequent insertion then inserting new elements between the cursor's
current position and its expected iteration range.
* Detect the case with a new flag (hack!) HAMMER_CURSOR_ITERATE_CHECK
and just iterate past the elements outside the iteration range in
this case.
Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Sascha Wildner [Sun, 14 Mar 2010 01:32:47 +0000 (02:32 +0100)]
mdoc: Add NetBSD 6.0 (used in wbsio.4).
Sascha Wildner [Sun, 14 Mar 2010 01:31:13 +0000 (02:31 +0100)]
Actually hook powernow.4 into the build.
Alex Hornung [Sat, 13 Mar 2010 15:39:37 +0000 (15:39 +0000)]
linprocfs - Introduce /proc/mounts
* Introudce the /proc/mounts entry to satisfy some installers, and df.
* NOTE: if you intend to chroot into the linux base, you'll have to
change your /compat/linux/etc/mtab symlink to point to /proc/mounts
instead. Also note that the paths are not relative to the linux
chroot.
Reported-by: Sascha Wildner
Sascha Wildner [Sat, 13 Mar 2010 12:58:36 +0000 (13:58 +0100)]
Fix LINT build.
Alex Hornung [Fri, 12 Mar 2010 23:08:40 +0000 (23:08 +0000)]
linux emulation - Major update
* Major update to all components of the linux emulation layer
(linuxulator) and linprocfs.
* Many old system calls have been overhauled and new ones added.
* Tested with java 1.6.18, apache tomcat 6, opera, Acrobat Reader, ...
* NOTE: Flash doesn't work yet, and I haven't been able to figure out
why. I'll continue my work on the linuxulator part time now, and
hopefully eventually fix the issue(s).
Some parts of this have been taken from FreeBSD and NetBSD.
Overall the new stuff isn't as well organized as it should be; most of
the new defines are in linux.h as I didn't bother splitting it up into
independent headers.
Once we plan on porting the linuxulator to amd64, this has to be taken
care of, so especially machine independent bits are broken out of the
machine dependent sys/emulation/linux/i386.