All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Lyude Paul <lyude@redhat.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@linux.ie>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [Poke: Tejun] Re: [RFC v3 03/11] drm/vblank: Add vblank works
Date: Fri, 17 Apr 2020 17:03:56 -0400	[thread overview]
Message-ID: <20200417210356.GD43469@mtj.thefacebook.com> (raw)
In-Reply-To: <ef9da9d93022822fe4bec7e906540fcc9852ce59.camel@redhat.com>

Hello,

On Fri, Apr 17, 2020 at 04:16:28PM -0400, Lyude Paul wrote:
> Hey Tejun! So I ended up rewriting the drm_vblank_work stuff so that it used
> kthread_worker. Things seem to work alright now. But while we're doing just
> fine with vblank workers on nouveau, we're still having trouble meeting the
> time constraints needed for using vblank works for i915's needs. There still
> seems to be a considerable latency between when the irq handler for the vblank
> interrupts fires, and when the actual drm_vblank_work we scheduled starts:
...
> Tejun, do you have any idea if we might be able to further reduce the latency
> from the scheduler here? I believe we're already using pm_qos to at least
> reduce the latency between when the vblank interrupt fires and the interrupt
> handler starts, but that still isn't enough to fix the other latency issues
> apparently. We're also already setting the priority of kthread_worker->task to
> RT_FIFO as well.

I don't think the kernel can do much better than what you're seeing. I don't
know the time scale that you need - is it some tens of microseconds range? I'm
definitely not an expert on the subject but on generic kernels I don't think
you can achieve anything sub millisec with any kind of reliability.

If the timing is that tight and it's not a hot path, the right solution may be
polling for it rather than yielding the cpu and hoping to get scheduled in
time.

> Also, of course, let me know if you're not happy with the
> __kthread_queue_work() changes/kthread_worker usage in drm_vblank_work as well

Just glanced over it and I still wonder whether it needs to be that tightly
integrated, but we can look into that once we settle on whether this is the
right direction.

Thanks.

-- 
tejun
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: Lyude Paul <lyude@redhat.com>
Cc: dri-devel@lists.freedesktop.org,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@linux.ie>,
	linux-kernel@vger.kernel.org
Subject: Re: [Poke: Tejun] Re: [RFC v3 03/11] drm/vblank: Add vblank works
Date: Fri, 17 Apr 2020 17:03:56 -0400	[thread overview]
Message-ID: <20200417210356.GD43469@mtj.thefacebook.com> (raw)
In-Reply-To: <ef9da9d93022822fe4bec7e906540fcc9852ce59.camel@redhat.com>

Hello,

On Fri, Apr 17, 2020 at 04:16:28PM -0400, Lyude Paul wrote:
> Hey Tejun! So I ended up rewriting the drm_vblank_work stuff so that it used
> kthread_worker. Things seem to work alright now. But while we're doing just
> fine with vblank workers on nouveau, we're still having trouble meeting the
> time constraints needed for using vblank works for i915's needs. There still
> seems to be a considerable latency between when the irq handler for the vblank
> interrupts fires, and when the actual drm_vblank_work we scheduled starts:
...
> Tejun, do you have any idea if we might be able to further reduce the latency
> from the scheduler here? I believe we're already using pm_qos to at least
> reduce the latency between when the vblank interrupt fires and the interrupt
> handler starts, but that still isn't enough to fix the other latency issues
> apparently. We're also already setting the priority of kthread_worker->task to
> RT_FIFO as well.

I don't think the kernel can do much better than what you're seeing. I don't
know the time scale that you need - is it some tens of microseconds range? I'm
definitely not an expert on the subject but on generic kernels I don't think
you can achieve anything sub millisec with any kind of reliability.

If the timing is that tight and it's not a hot path, the right solution may be
polling for it rather than yielding the cpu and hoping to get scheduled in
time.

> Also, of course, let me know if you're not happy with the
> __kthread_queue_work() changes/kthread_worker usage in drm_vblank_work as well

Just glanced over it and I still wonder whether it needs to be that tightly
integrated, but we can look into that once we settle on whether this is the
right direction.

Thanks.

-- 
tejun

  reply	other threads:[~2020-04-17 21:04 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17 19:40 [RFC v3 00/11] drm/nouveau: Introduce CRC support for gf119+ Lyude Paul
2020-04-17 19:40 ` Lyude Paul
2020-04-17 19:40 ` Lyude Paul
2020-04-17 19:40 ` [RFC v3 01/11] drm/vblank: Register drmm cleanup action once per drm_vblank_crtc Lyude Paul
2020-04-17 19:40   ` Lyude Paul
2020-04-21 12:29   ` Daniel Vetter
2020-04-21 12:29     ` Daniel Vetter
2020-04-17 19:40 ` [RFC v3 02/11] kthread: Introduce __kthread_queue_work() Lyude Paul
2020-04-17 19:40   ` Lyude Paul
2020-04-17 19:40 ` [RFC v3 03/11] drm/vblank: Add vblank works Lyude Paul
2020-04-17 19:40   ` Lyude Paul
2020-04-17 20:16   ` [Poke: Tejun] " Lyude Paul
2020-04-17 20:16     ` Lyude Paul
2020-04-17 21:03     ` Tejun Heo [this message]
2020-04-17 21:03       ` Tejun Heo
2020-04-17 21:24       ` Lyude Paul
2020-04-17 21:24         ` Lyude Paul
2020-04-21 12:34       ` Daniel Vetter
2020-04-21 12:34         ` Daniel Vetter
2020-04-22 16:22         ` Tejun Heo
2020-04-22 16:22           ` Tejun Heo
2020-04-17 19:40 ` [RFC v3 04/11] drm/nouveau/kms/nv50-: Unroll error cleanup in nv50_head_create() Lyude Paul
2020-04-17 19:40   ` Lyude Paul
2020-04-17 19:40 ` [RFC v3 05/11] drm/nouveau/kms/nv140-: Don't modify depth in state during atomic commit Lyude Paul
2020-04-17 19:40   ` Lyude Paul
2020-04-17 19:40 ` [RFC v3 07/11] drm/nouveau/kms/nv50-: s/harm/armh/g Lyude Paul
2020-04-17 19:40   ` Lyude Paul
2020-04-17 19:40 ` [RFC v3 09/11] drm/nouveau/kms/nv50-: Expose nv50_outp_atom in disp.h Lyude Paul
2020-04-17 19:40   ` Lyude Paul
2020-04-17 19:40 ` [RFC v3 10/11] drm/nouveau/kms/nv50-: Move hard-coded object handles into header Lyude Paul
2020-04-17 19:40   ` Lyude Paul
     [not found] ` <20200417194145.36350-1-lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2020-04-17 19:40   ` [RFC v3 06/11] drm/nouveau/kms/nv50-: Fix disabling dithering Lyude Paul
2020-04-17 19:40     ` Lyude Paul
2020-04-17 19:40     ` Lyude Paul
2020-04-17 19:40   ` [RFC v3 08/11] drm/nouveau/kms/nv140-: Track wndw mappings in nv50_head_atom Lyude Paul
2020-04-17 19:40     ` Lyude Paul
2020-04-17 19:40     ` Lyude Paul
2020-04-17 19:40   ` [RFC v3 11/11] drm/nouveau/kms/nvd9-: Add CRC support Lyude Paul
2020-04-17 19:40     ` Lyude Paul
2020-04-17 19:40     ` Lyude Paul
2020-04-20 23:19 ` [RFC v3 00/11] drm/nouveau: Introduce CRC support for gf119+ Ben Skeggs
2020-04-20 23:19   ` Ben Skeggs
2020-04-20 23:19   ` Ben Skeggs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200417210356.GD43469@mtj.thefacebook.com \
    --to=tj@kernel.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.