On Wed, May 01, 2019 at 09:29:25AM -0600, Jens Axboe wrote: > On 5/1/19 9:09 AM, Mark Rutland wrote: > > I've manually minimized that to C below. AFAICT, that hits a leak, which > > is what's triggering the OOM after the program is run a number of times > > with the previously posted kvmalloc patch. > > > > Per /proc/meminfo, that memory isn't accounted anywhere. > > > >> Patch looks fine to me. Note > >> that buffer registration is under the protection of RLIMIT_MEMLOCK. > >> That's usually very limited for non-root, as root you can of course > >> consume as much as you want and OOM the system. > > > > Sure. > > > > As above, it looks like there's a leak, regardless. > > The leak is that we're not releasing imu->bvec in case of error. I fixed > a missing kfree -> kvfree as well in your patch, with this rolled up > version it works for me. That works for me too. I'll fold that into v2, and send that out momentarily. Thanks, Mark.