Commit Graph

726 Commits

Author SHA1 Message Date
mlelstv
8b765a5da5 Use utility functions to handle disk geometry. 2020-02-29 17:15:43 +00:00
mlelstv
5568ea814a Fix disk geometry calculation. Add DIOCGPARTINFO to support
getdisksize() used by other drivers, filesystems and specfs.
2020-02-29 17:03:33 +00:00
riastradh
55a1499437 Teach zfs bdevsw to do b_psize.
This is needed, among other things, to swap on zvols.

Attempting to swap on zvols currently deadlocks but that's a separate
issue that needs to be fixed too!
2020-02-28 03:52:26 +00:00
ad
d2a0ebb67a UVM locking changes, proposed on tech-kern:
- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart.  v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap.  Others to follow later.
2020-02-23 15:46:38 +00:00
riastradh
b58d4067a2 Teach device nodes on zfs to handle fsync by calling spec_fsync too. 2020-02-23 06:15:27 +00:00
riastradh
5b7c5828ba Teach zfs spec nodes to VOP_BWRITE too.
Fixes hang on writing to, e.g., ffs mounted on a device node that
lives on zfs.

XXX pullup
2020-02-23 05:50:25 +00:00
joerg
ce578dfc2b Explicitly cast pointers to uintptr_t before casting to enums. They are
not necessarily the same size. Don't cast pointers to bool, check for
NULL instead.
2020-02-21 00:26:21 +00:00
riastradh
3c37c6c9c5 Mark previous #ifdef __NetBSD__, per request from hannken. 2020-02-19 17:05:06 +00:00
riastradh
69aded6dbf Report the OS name and release appropriately for NetBSD.
We are not OpenSolaris or uts!
2020-02-19 16:11:19 +00:00
riastradh
18954d9723 Define VOP_STRATEGY on zfs device nodes too.
Fixes eternal hangs in attempts to do I/O on device nodes on zfs.

XXX pullup
2020-02-19 05:52:52 +00:00
roy
0495ebef35 zpool: The NetBSD specific ioctl needs to include sys/ioctl.h 2020-02-16 14:06:10 +00:00
riastradh
defa864ee7 Teach zfs to revoke vnodes the usual way.
XXX pullup
2020-02-15 19:03:15 +00:00
hannken
2f425cfa36 zfs_netbsd_setattr: ignore size changes on device nodes. 2020-02-13 16:53:32 +00:00
riastradh
6db8251b26 Switch from db_write_bytes to using direct-mapping.
This way there's no dependency on ddb.
2020-02-12 06:05:31 +00:00
riastradh
bfcd8bcf73 Change the address ranges that aarch64 considers toxic for dtrace.
`Toxic' means dtrace forbids D scripts from even attempting to read
or write at them.

Previously we considered [0, VM_MIN_KERNEL_ADDRESS) toxic, but
VM_MIN_KERNEL_ADDRESS is only the minimum address of the kernel map;
the direct-mapped region lies below it, and with PMAP_MAP_POOLPAGE we
allocate virtual pages for pool backing directly from physical pages
through the direct-mapped region.  Also, this did not consider I/O
mappings to be toxic, which they probably should be.

Instead, treat:

[0, AARCH64_KSEG_START)
and
[VM_KERNEL_IO_ADDRESS, 0xfff...ff)

as toxic.  (The upper bound for 0xfff...ff ought to be inclusive, not
exclusive, but I think we'll need another mechanism for expressing
that to dtrace!)
2020-02-12 06:05:23 +00:00
riastradh
772dd05c6c Count the number of artificial frames in aarch64 fbt probe correctly. 2020-02-12 01:10:25 +00:00
riastradh
21c3f7e27a Teach dtrace about el1_trap_exit frames on aarch64.
Implement dtrace_getarg and dtrace_getreg while here.
2020-02-12 01:10:16 +00:00
riastradh
639e4eee75 Use /dev/ksyms, not /netbsd, for the running kernel's symbols. 2020-02-12 01:10:08 +00:00
riastradh
5fb67fa20d Tidy up a bit: don't set things we won't use; assert nonzeroness. 2020-02-12 01:09:48 +00:00
riastradh
615f7ddec3 Tidy up a bit. No functional change intended.
aarch64 fbt_invop doesn't actually use the argument, but it would
make more sense for it to be the return value and/or first argument
register.  Certainly it's not `eax'!
2020-02-12 01:09:38 +00:00
riastradh
5f49297b68 Use db_write_bytes to overwrite kernel text. 2020-02-12 01:09:27 +00:00
fox
b796f1c940 external/cddl/osnet: Suppress -Werror=stringop-truncation error.
Add GCC_NO_STRINGOP_TRUNCATION dwarf.c to prevent build failure.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
2020-02-09 07:55:13 +00:00
ad
f778098a59 Track page dirtyness for ZFS (yamt-pagecache). I had forgotten that it had
its own cache.  Thanks to hannken@ for the repro.
2020-01-18 15:21:32 +00:00
ad
c2e9cb9413 VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode.  Matches
FreeBSD.
2020-01-17 20:08:06 +00:00
ad
05a3457e85 Merge from yamt-pagecache (after much testing):
- Reduce unnecessary page scan in putpages esp. when an object has a ton of
  pages cached but only a few of them are dirty.

- Reduce the number of pmap operations by tracking page dirtiness more
  precisely in uvm layer.
2020-01-15 17:55:43 +00:00
pgoyette
956f25580a Another rename from uvm_free() --> uvm_availmem() 2019-12-31 14:51:29 +00:00
ad
5c06357c90 Rename uvm_free() -> uvm_availmem(). 2019-12-31 13:07:09 +00:00
ad
7d06f3305f Make mntvnode_lock per-mount, and address false sharing of struct mount. 2019-12-22 19:47:34 +00:00
ad
ddd3a0be1e uvmexp.free -> uvm_free() 2019-12-21 13:00:20 +00:00
ad
5978ddc663 Break the global uvm_pageqlock into a per-page identity lock and a private
lock for use of the pagedaemon policy code.  Discussed on tech-kern.

PR kern/54209: NetBSD 8 large memory performance extremely low
PR kern/54210: NetBSD-8 processes presumably not exiting
PR kern/54727: writing a large file causes unreasonable system behaviour
2019-12-13 20:10:21 +00:00
sevan
59348bc454 We currently lack a tunable to control ZFS prefetch, so skip the warning and
FreeBSD specific instructions on settings.
2019-12-09 00:15:11 +00:00
riastradh
aca9a2fd6e Avoid redefining uint_t &c. if compat_defs.h already defines them. 2019-12-05 03:21:42 +00:00
jmcneill
37d677e093 dtrace: add support for aarch64 2019-12-03 22:10:56 +00:00
jmcneill
e578db34f0 Need sys/atomic.h on NetBSD 2019-12-01 20:26:31 +00:00
jmcneill
fa74c92e0a Provide a default ptob() implementation 2019-12-01 20:26:05 +00:00
jmcneill
87afc7bc0f Initialize b_dev before passing buf to d_minphys (ldminphys needs this) 2019-12-01 20:25:31 +00:00
maxv
29441e93f4 Use x86_patch_window_{open,close}. This also fixes a bug: the CR0/PSL
reloads were inverted.
2019-11-13 10:13:41 +00:00
hannken
c4ae6d2fe2 dtrace_trap() gets called from alltraps() -> trap() with interrupts enabled
so we cannot assert for interrupts disabled here.

Should fix PR kern/54603: kernel panic when running dtruss
2019-11-08 11:06:21 +00:00
hannken
e59a8eaee2 Add missing "#ifdef _KERNEL" to fix the build of userland zfs libraries. 2019-10-15 06:58:12 +00:00
hannken
239a7f3a3b Change dmu_diff() back to use a "file" instead of a "vnode".
Command "zfs diff" calls it with a pipe, not a plain file.

Fixes PR kern/54541: kernel panic using "zfs diff"
2019-10-14 13:18:00 +00:00
christos
af4abd50bc make worker thread prototype match the pthread_create signature. 2019-10-13 21:32:07 +00:00
kre
e61903222f This previously had -Wno-format-truncation so I am presuming it should
have been converted to GCC_NO_FORMAT_TRUNCATION rather than
GCC_NO_STRINGOP_TRUNCATION which is what happened.   This might unbreak
the build (olr at least get it further).
2019-10-13 10:07:27 +00:00
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
kre
bab7747200 Only exclude gcc-8 warnings when the gcc we're using is gcc>=8 2019-10-10 02:35:45 +00:00
christos
04c417de37 no error for string truncation 2019-10-09 21:49:50 +00:00
brad
2ab41a9a50 For ZFS on NetBSD there are a number of functions called
zfs_netbsd_{create,mknod,link,etc..} that call functions called
zfs_{create,mknod,link,etc..}.  These later functions may return a
error code along with a *vpp that is NULL.  This situation was not
handled by the zfs_netbsd_* functions and would result in a panic in a
number of cases.  The simplest to trigger it was filling up a dataset
or pool resulting in a over quota condition.  An attempt to create
another file, or directory at that point would panic.
2019-10-04 23:06:19 +00:00
brad
2e0a32871b Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}.  The general effect is to move them
from /usr/lib to /lib.  Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
2019-09-22 18:45:19 +00:00
sevan
69d856e495 Use Pa macro for path
new sentence, new line
2019-09-20 22:47:36 +00:00
brad
5aa9b9d41e Add a copyright to the man page and a bit of history. 2019-09-20 22:38:28 +00:00
wiz
67060edf74 Use more markup. 2019-09-16 04:57:12 +00:00