• Chris Wilson's avatar
    drm/i915: Expose the busyspin durations for i915_wait_request · 7ce99d24
    Chris Wilson authored
    An interesting discussion regarding "hybrid interrupt polling" for NVMe
    came to the conclusion that the ideal busyspin before sleeping was half
    of the expected request latency (and better if it was already halfway
    through that request). This suggested that we too should look again at
    our tradeoff between spinning and waiting. Currently, our spin simply
    tries to hide the cost of enabling the interrupt, which is good to avoid
    penalising nop requests (i.e. test throughput) and not much else.
    Studying real world workloads suggests that a spin of upto 500us can
    dramatically boost performance, but the suggestion is that this is not
    from avoiding interrupt latency per-se, but from secondary effects of
    sleeping such as allowing the CPU reduce cstate and context switch away.
    
    In a truly hybrid interrupt polling scheme, we would aim to sleep until
    just before the request completed and then wake up in advance of the
    interrupt and do a quick poll to handle completion. This is tricky for
    ourselves at the moment as we are not recording request times, and since
    we allow preemption, our requests are not on as a nicely ordered
    timeline as IO. However, the idea is interesting, for it will certainly
    help us decide when busyspinning is worthwhile.
    
    v2: Expose the spin setting via Kconfig options for easier adjustment
    and testing.
    v3: Don't get caught sneaking in a change to the busyspin parameters.
    v4: Explain more about the "hybrid interrupt polling" scheme that we
    want to migrate towards.
    Suggested-by: default avatarSagar Kamble <sagar.a.kamble@intel.com>
    References: http://events.linuxfoundation.org/sites/events/files/slides/lemoal-nvme-polling-vault-2017-final_0.pdfSigned-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Cc: Sagar Kamble <sagar.a.kamble@intel.com>
    Cc: Eero Tamminen <eero.t.tamminen@intel.com>
    Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
    Cc: Ben Widawsky <ben@bwidawsk.net>
    Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Cc: Michał Winiarski <michal.winiarski@intel.com>
    Reviewed-by: default avatarSagar Kamble <sagar.a.kamble@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20190419182625.11186-1-chris@chris-wilson.co.uk
    7ce99d24
i915_request.c 44.4 KB