Bug 234167 - Kernel panic after set vm.act_scan_laundry_weight=0
Summary: Kernel panic after set vm.act_scan_laundry_weight=0
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.2-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-19 16:46 UTC by dimka
Modified: 2025-03-29 04:59 UTC (History)
3 users (show)

See Also:


Attachments
patch (1.06 KB, patch)
2025-03-08 14:33 UTC, Ivan Rozhuk
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dimka 2018-12-19 16:46:47 UTC
On one second after
# sysctl -w vm.act_scan_laundry_weight=0
executed, kernel is panic with
"Fatal trap 18: integer divide fault while kernel mode"

I assume that this is not a serious problem, just be happy ;-)
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2025-01-25 01:15:54 UTC
^Triage: I'm sorry that this PR did not get addressed in a timely fashion.

By now, the version that it was created against is long out of support.
Please re-open if it is still a problem on a supported version.
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2025-01-25 01:35:19 UTC
The bug is still there.
Comment 3 Ivan Rozhuk 2025-03-08 14:33:19 UTC
Created attachment 258432 [details]
patch

Because division by zero:

static int
vm_pageout_active_target(struct vm_domain *vmd)
{
	int shortage;

	shortage = vmd->vmd_inactive_target + vm_paging_target(vmd) -
	    (vmd->vmd_pagequeues[PQ_INACTIVE].pq_cnt +
	    vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt / act_scan_laundry_weight);
	shortage *= act_scan_laundry_weight;
	return (shortage);
}

Fix in attached patch.