On 10/16/19 9:57 PM, Alex Zhang wrote: > Hey there! > > I was seeing some weird behavior where I was hitting > random BUG_ONs in memory.c . After a bit of debugging, > I traced it back to remap_pfn_range being my entry point > into memory.c . Should the "addr" passed it be page aligned? Most likely yes. How would you map if not on page boundary? I suspect it was a bug in the caller? > I see no documentation stating that nor do I see any checks > in the code for it. I suspect it was implicitly assumed. Most callers seem to pass vma->vm_start as addr, which is page aligned. But 'size' parameter alignment is fixed up, and it should be a similar case as addr. Maybe a VM_BUG_ON check? > Alex >