swapctl(8): do not assume PGSHIFT is available
PGSHIFT might not be available in userland. eg. sparc
use sysconf(_SC_PAGESIZE) to query the kernel instead.
Re-do the way the news1700's external cache vs. 68030 cache burst mode
issue is dealt with.
Rather than completely re-defining the high-level cache operation macros
to exclude the *_BE bits (which actually penalized systems without an EC
because the *_BE bits set in the CACR initiallly would be lost on the first
cache operation), instead we provide a "platform has dynamic CACR values"
hook.
For NEWS, the values default to the with-*_BE variant, but if an external
cache is discovered, the values are patched up with the non-*_BE variants.
Only one shared assembly language routine needs to be adjusted for this,
the rest of the scenarios where these values are used are handled by the
compiler via constraints.
For all other platforms that don't define __HAVE_M68K_DYNAMIC_CACR,
the values remain compile-time constants, as before.
Group 68020/68030 CACR bits into "the actual bits that do stuff" and
"higher level operations", along with some helper macros that compute
the latter in terms of the former.
NFCI, but sets the stage for some future cleanup in this area.
Revert "config_attach_pseudo/config_attach_pseudo: assert kernel lock"
it turned out that we have too many drivers which would trigger
these assertions. although my impression is that they are actually
not mpsafe, let's revert the assertions for now.
PR/60123https://gnats.netbsd.org/60123
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.
- move logic to find a device's interrupt controller out of ki2c
- make interrupt numbers in OF, dmesg and systat/vmstat match
- include interrupt controller's name when reporting
Extract this m68k cpu.h commit:
revision 1.26
date: 2025-12-05 05:27:03 -0800; author: thorpej; state: Exp; lines: +21 -4;
commitid: jviu62VSzYhPRdlG;
Define the fields in the 68060 Processor Configuration Register.
...into a new file, pcr.h, and adjust things that need the stuff.
config_attach_pseudo/config_attach_pseudo: assert kernel lock
as commented in the code, whese functions are inherently
mp-unsafe and only usable with the kernel lock held.
sw_reg_strategy: stop panicking on hole
after the recent change to uvm_aio_aiodone_pages,
it should be ok to report errors here. the swap slots
will be marked bad as expected.
tested with a swap file with 50% holes:
```
Device Size Used Bad Avail Capacity Priority
/dev/dk1 2.0G 1.8G 0B 190M 91% 0
/swapfile_with_half_holes 2.0G 2.0G 1.0G 5.6M 100% 0
Total 4.0G 3.8G 1.0G 196M 95%
```
uvm_aio_aiodone_pages: do not discard user data on swap out failure
if swap out i/o failed, maybe the swap device is broken. it's
reasonable to mark it bad. however, there is no point to discard
the user data on the page being swapped out. unlike file pages,
the association to the particular swap slot is not permanent.
next time the page is picked as a victim by the page daemon, a
different swap slot, which is hopefully good, will be allocated.
swapctl: report npgbad
the current layout of swapent is like the following on amd64:
```
(gdb) ptype /o struct swapent
/* offset | size */ type = struct swapent {
/* 0 | 8 */ dev_t se_dev;
/* 8 | 4 */ int se_flags;
/* 12 | 4 */ int se_nblks;
/* 16 | 4 */ int se_inuse;
/* 20 | 4 */ int se_priority;
/* 24 | 1025 */ char se_path[1025];
/* XXX 7-byte padding */
/* total size (bytes): 1056 */
}
```
while it's tempting to use the padding for the new member
to avoid versioning, i guess we can't because, on some
architectures, 64-bit value only has 32-bit alignment. (eg. i386)
zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
Fix sh tests failing after the PR 60099 fix to /bin/sh
After the fix for PR 60099 was applied to /bin/sh, 2 of the
sh ATF tests no longer give the same output as they used to:
In t_expand:dollar_at_empty_and_conditional
set -- "a+a" "" "b " " c"; IFS=+; delim_argv $*"$@"
That creates 4 positional params, (as shown), so $*"$@"
should be the same as
$1 $2 $3 $4"$1" "$2" "$3" "$4"
'a+a' '' 'b ' ' c'"a+a" "" "b " " c"
where the single quotes are just so the values can be detected,
double quotes indicate quoted values.
The unquoted $* values are then field split, using IFS=+ (which only
[55 lines not shown]
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.