On 11/4/25 12:53 AM, Mohamed Ahmed wrote: > Thanks a lot for the shout out! Looking more at things, the logic here > is actually redundant. It was originally copied over directly from the > bo allocation code to stay on the safer side (basically the idea back > then was to make both the bo and vmm sides match exactly). We aren't > at risk of having an aligned address that is in the wrong memory type > because the bo allocation code (nouveau_bo.c:321) forces anything that > has the GART flag to have a page size of 4K. Anything getting a page > size higher than that is exclusively VRAM only. Additionally, > currently things marked VRAM only don't get evicted to host memory > except under high memory pressure and in that case, the context is > paused until the objects in question are paged back in, so we also > don't have to worry about memory placement there. > > The memory placement check in the vmm code could be removed but I am > leaning more towards leaving it as is just to stay on the safer side.
If it is not necessary, please remove it. We should not carry dead code. > At the same time, it would be more useful to keep it for the future as > one of the future investigation targets that we want to look into is > all the memory placement rules because the "only 4K is allowed for > host memory" limit that nouveau imposes is a source of many pains in > userspace (originally thought to be a HW thing but seems it's actually > not), and having the checks on both bo and vmm paths would help > starting out with that. Please don't top-post, see also [1]. [1] https://subspace.kernel.org/etiquette.html#do-not-top-post-when-replying
