Devres

Greg KH greg at kroah.com
Fri Nov 21 12:31:27 EST 2014


On Fri, Nov 21, 2014 at 03:21:57PM -0200, Raphael Philipe wrote:
> I have a device driver that requests a lot o memory regions with ioremap and
> request_mem_region.
> 
> Today I came across devres. I would like to known your oppinion regarding it?
> 
> If you don't know it, take a look here. http://haifux.org/lectures/323/
> haifux-devres.pdf
> 
> It seems like a garbage collector for Linux Kernel. Do you agree?

"garbage collector" in what sense?

In the sense of "all of the things your device allocates will be
properly freed when your device is freed", then yes, that is true,
devres is great for that.

But as a "general" garbage collector, no, that's not what it is for, it
is a very specific tool for device-specific usages.

And yes, it's very good, everyone should be using it in their drivers.

greg k-h



More information about the Kernelnewbies mailing list