Re: Kernel/driver hacking: panic: Assertion vm_object_busied((m->object)) failed at /usr/src/sys/vm/vm_page.c:5455

From: Hans Petter Selasky <>
Date: Wed, 16 Jun 2021 07:35:54 UTC
On 6/16/21 5:36 AM, Neel Chauhan wrote:
> Hi current@,
> First off, sorry if I spammed developers@ and other mailing lists with 
> my previous message, and to bz@/hselasky@/manu@ sent so many duplicate 
> emails.
> Right now, I am attempting to update the drm-kmod driver to the Linux 
> 5.7 code, and am having an issue with the pmap lock. I am new-ish to the 
> kernel, meaning not a whole lot of "experience", but do have patches in 
> src.
> But like it not we need kernel newbies, they're the next generation of 
> experts. If we don't, we'd be the next Minix with **zero** development 
> since Tanenbaum retired.
> Going back, the code in question is here: 
> The lines important are 346-356, but lines of interest are also the 
> non-"#ifdef __linux__" sections of vm_fault_cpu().
> The code gives this error: panic: Assertion 
> vm_object_busied((m->object)) failed at /usr/src/sys/vm/vm_page.c:5455
> I have attached the core dump log.
> To those who aren't graphics driver experts, it happens when I load Xorg 
> when Xorg attempts to map the I/O to userspace. But I feel this is more 
> of me not using page locks correctly (which is needed for the pmap), or 
> maybe a linuxkpi issue, rather than a graphics-specific issue.
> I spent days on this (all my non-$DAYJOB hours at one point + all my 
> weekends) and haven't figured out the locks completely. Does anyone have 
> suggestions to what I'm doing wrong in my code and locks?
> If it is important, OpenBSD's version of this code is here: 
> (lines 459-523, but some calls are unsurprisingly different).
> Hope you all can help.


Do you have the full backtrace?

Doesn't this code work in the current DRM - kmod? What changed? Did you 
perhaps miss a patch?