Use the new M68K_EC_VAC and M68K_EC_PAC options, based on configured
model.
As a transitional step, ensure that the new options are consistent with
the legacy CACHE_HAVE_{PAC,VAC} defines.
Add 3 new arch options:
- M68K_EC -- platform has an external cache
- M68K_EC_PAC -- platform has an external cache that's physically addressed
- M68K_EC_VAC -- platform has an external cache that's virtually addressed
M68K_EC_PAC and M68K_EC_VAC are to be used by individual platforms to
indicate their cache configuration options, M68K_EC is inferred by either.
uvmpd_scan_queue: remove ENABLE_UNRELIABLE_CHECK_PR_56764 block
while this condition is true in most of times, we can't
assert it here because these counters are not always
updated in-sync.
for example, consider a removal of a large tmpfs file which is
mostly swapped out. because uao_dropswap_range() batches swpgonly
updates, swpgonly can be temporarily larger than swpginuse.
the original symptom reported in PR/56764 ("uvmexp.swpgonly > 0")
looks like a different issue though.
https://gnats.netbsd.org/56764
zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.
zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.
this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
Use the fake exception frame created by pmap_bootstrap2() by
capturing its return value and passing it along as the return
value from start_c_finish().
Move initialization of %dfc and %sfc into _bootstrap() (which will
eventually itself be re-factored to reduce duplication). Also, catch
up with the others: no need to initialize %usp before calling main().
For many many years now, it has been unnecessary to initialize the user
stack pointer before calling main(). TL;DR - %usp comes from the exception
frame and is restored in the syscall stub (always) or rei (if an AST is
pending). For newly-forked processes, those take the non-AST path through
rei, but lwp_trampoline() takes care of it in that case.
PR bin/60099 - Fix unquoted $* ($@) expansion
Make unquoted $* (or $@) when used in a context where field
splitting happens (which requires unquoted of course) generate
the same result, always, as would have been obtained had the
number of params been known, and
$1 $2 $3 ... ${n} (n is the value of $#)
been used instead of $* - so for x$*y, for any strings x & y
(including empty), the equivalent would be
x$1 $2 $3 ... ${n}y
This must hold, whatever the setting of IFS (which affects
how the fields generated are field split after they appear,
but should not affect the generation of those fields).
The bug this fixes is (in practice) never encountered, which is
how it has persisted for so long, and in so many different shells.
The method that was previously used to expand $* in this situation
would work perfectly, if the first character of ${IFS} was an IFS
[28 lines not shown]
Minor cleanups
Cleanup CTLccc char definitions (layout only):
#define [space|tab] consistency, align value column,
add hex equivalents (in comments) for octal char values
Minor changes to comments.
NFC.
Add DEBUG_ONLY() to include anything in DEBUG code
DEBUG_ONLY(x) expands to its arg, which should not contain commas
(outside parens) only in DEBUG mode compiles, most useful for var
declarations, and similar. Nb: code only, not outside functions.
Some cleanups/additions to comments.
By itself, this is a NFC change (until something uses DEBUG_ONLY()
for DEBUG mode code alteration).
PR lib/60111 - Add some bounds checking
As requested by the PR, bounds checking on the two obvious
places I could see where overflow looks possible has been added.
Detected overflow should generate a decode error.
PR 60119 - don't set -o pipefail (revert previous)
I was going to make the setting of the pipefail option check if
the executing shell supports the option or not (all should really,
and up to date dash does - it is a standard option) - but then I
looked at the script, and couldn't find a pipe used anywhere.
The option is useless here. So, bye-bye pipefail.
Reorder slightly for correctness
The "pipefail" option is now a POSIX standard option, move it
from the extensions section to the standard options section.
The (very fake) "r" option is not a standard option, though it
is a command line only "option" - move it away from -s, -c
the other (but standard) command line only options, and to a
section of its own (our first non-standard command line only option).
NFC - the order of options in this definition file is for human
(those who view this file) purposes only, all is reordered by
mkoptions.sh before being included with the shell sources.
Use sh internal char typing, not <ctype.h>
That is, use the internal shell is_digit() rather than isdigit().
No practical functional change (a digit is a digit).
Rather than pmap_boostrap2() returning the address of the lwp0 uarea,
let pmap_bootstrap2() construct the fake exception frame, initialize
lwp0.l_md.md_regs, and return the new lwp0 stack pointer, thus removing
a bunch of duplicated asm code in each platform's locore.s.
XXX amiga and atari TBD, but the changes will be less mechanical.
XXX sun2/sun3/sun3x TBD, require a slightly different set of mechanical
changes.
zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
[20 lines not shown]