On Tue, Mar 27, 2018 at 10:06:04AM +0200, Christian König wrote: > Am 27.03.2018 um 09:53 schrieb Daniel Vetter: > > [SNIP] > > > > [SNIP] > > > > A slightly better solution is using atomic counter: > > > > driver_range_start() { > > > > atomic_inc(&mydev->notifier_count); > > > ... > > > > > > Yeah, that is exactly what amdgpu is doing now. Sorry if my description > > > didn't made that clear. > > > > > > > I would like to see driver using same code, as it means one place to fix > > > > issues. I had for a long time on my TODO list doing the above conversion > > > > to amd or radeon kernel driver. I am pushing up my todo list hopefully in > > > > next few weeks i can send an rfc so people can have a real sense of how > > > > it can look. > > > Certainly a good idea, but I think we might have that separate to HMM. > > > > > > TTM suffered really from feature overload, e.g. trying to do everything in a > > > single subsystem. And it would be rather nice to have coherent userptr > > > handling for GPUs as separate feature. > > TTM suffered from being a midlayer imo, not from doing too much. > > Yeah, completely agree. > > midlayers work as long as you concentrate on doing exactly one things in > your midlayer. E.g. in the case of TTM the callback for BO move handling is > well justified. > > Only all the stuff around it like address space handling etc... is really > wrong designed and should be separated (which is exactly what DRM MM did, > but TTM still uses this in the wrong way). Yeah the addres space allocator part of ttm really is backwards and makes adding quick driver hacks and heuristics for better allocations schemes really hard to add. Same for tuning how/what exactly you evict. > > HMM is apparently structured like a toolbox (despite its documentation claiming > > otherwise), so you can pick&choose freely. > > That sounds good, but I would still have a better feeling if userptr > handling would be separated. That avoids mangling things together again. Jerome said he wants to do at least one prototype conversion of one of the "I can't fault" userptr implementation over to the suitable subset of HMM helpers. I guess we'll see once he's submitting the patches, but it sounded exactly like what the doctor ordered :-) -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch