Hello, On Mon, Apr 13, 2020 at 04:18:57PM -0400, Lyude Paul wrote:> Hi Tejun! Sorry to bother you, but have you had a chance to look at any of > this yet? Would like to continue moving this forwardSorry, wasn't following this thread. Have you looked at kthread_worker? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/kthread.h#n71 And, thanks a lot for the vblank explanation. I really enjoyed readin it. :) -- tejun
Hi Tejun> > And, thanks a lot for the vblank explanation. I really enjoyed readin it. :)You were not the only one who liked it :-) We ended up with an updated explanation in drm_vblank.c: https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/drm_vblank.c Including some nice ascii art in the final version. It will hit upstream in next merge window. Sam
On Mon, 2020-04-13 at 16:42 -0400, Tejun Heo wrote:> Hello, > > On Mon, Apr 13, 2020 at 04:18:57PM -0400, Lyude Paul wrote: > > Hi Tejun! Sorry to bother you, but have you had a chance to look at any of > > this yet? Would like to continue moving this forward > > Sorry, wasn't following this thread. Have you looked at kthread_worker? >Hi, thanks for the response! And yes-I think this would actually be perfect for what we need, I guess one question I might as well ask since I've got you here: would patches to expose an unlocked version of kthread_queue_worker() be accepted? With something like that I should be able to just reuse the delayed_work_list and spinlocks that come with kthread_worker which would make the vblank works implementation a bit easier> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/kthread.h#n71 > > And, thanks a lot for the vblank explanation. I really enjoyed readin it. :) >-- Cheers, Lyude Paul (she/her) Associate Software Engineer at Red Hat
Hello, On Tue, Apr 14, 2020 at 12:52:51PM -0400, Lyude Paul wrote:> Hi, thanks for the response! And yes-I think this would actually be perfect > for what we need, I guess one question I might as well ask since I've got you > here: would patches to expose an unlocked version of kthread_queue_worker() be > accepted? With something like that I should be able to just reuse the > delayed_work_list and spinlocks that come with kthread_worker which would make > the vblank works implementation a bit easierDifficult to tell w/o looking at the code but if technically reasonable and justified, I don't see a reason why something like that couldn't be accepted. That said, whatever gain coming from sharing an inner lock like that usually is miniscule and API and logic simplicity often easily outweighs. Thanks. -- tejun
Reasonably Related Threads
- [PATCH 1/9] drm/vblank: Add vblank works
- [RFC v5 02/10] drm/vblank: Add vblank works
- [RFC v4 04/12] drm/vblank: Add vblank works
- [RFC v4 02/12] kthread: Add kthread_(un)block_work_queuing() and kthread_work_queuable()
- [RFC v4 01/12] kthread: Add kthread_queue_flush_work()