Quoting Lionel Landwerlin (2018-02-28 11:45:48)
We're seeing on CI that some contexts don't have the programmed OA period timer that directs the OA unit on how often to write reports.
The issue is that we're not holding the drm lock from when we edit the context images down to when we set the exclusive_stream variable. This leaves a window for the deferred context allocation to call i915_oa_init_reg_state() that will not program the expected OA timer value, because we haven't set the exclusive_stream yet.
Thank you for this quick explanation. After staring at the diff to figure out what race you saw, the succinct explanation of the window between altering all previous contexts and marking up new contexts, enlightens.
Signed-off-by: Lionel Landwerlin lionel.g.landwerlin@intel.com Fixes: 701f8231a2f ("drm/i915/perf: prune OA configs") Cc: stable@vger.kernel.org # v4.14+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102254 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103715 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103755
Reviewed-by: Chris Wilson chris@chris-wilson.co.uk -Chris