From patchwork Wed Dec 19 14:37:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 10737345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B7022746 for ; Wed, 19 Dec 2018 14:37:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2F312873F for ; Wed, 19 Dec 2018 14:37:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92FD12871C; Wed, 19 Dec 2018 14:37:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9E21F2871C for ; Wed, 19 Dec 2018 14:37:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40B3C6EFE4; Wed, 19 Dec 2018 14:37:54 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 00A4C6EFE4 for ; Wed, 19 Dec 2018 14:37:52 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Dec 2018 06:37:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,373,1539673200"; d="scan'208";a="127343422" Received: from delly.ld.intel.com ([10.103.238.204]) by fmsmga002.fm.intel.com with ESMTP; 19 Dec 2018 06:37:51 -0800 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Wed, 19 Dec 2018 14:37:43 +0000 Message-Id: <20181219143747.8997-1-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Intel-gfx] [RFC 0/4] drm/i915/perf: add OA interrupt support X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Hi all, Tests run by the GPA/vTune teams reported a high CPU consumption on polling data from the i915-perf stream. This is due to a design decision to check the OA buffer head/tail pointers 200 times per seconds. The reasonning being not using the interrupt was initially that you could want to process data as soon as it's available. To avoid breaking the existing behavior of the i915-perf stream, we'll introduce 2 new options at opening of the i915-perf stream to allow the application to choose : - how often it wants the OA circular buffer registers to be checked - whether to make sure of the interrupt In the case of GPA, collecting 100k OA reports would initially consume 17~20% CPU. With these 2 new parameters set to 1 second for OA circular buffer checks and the interrupt enabled, CPU usage drops to 2~3%. I'm looking for feedback as to whether those 2 new opening parameters are alright. Since this might be the first time that we add a new parameter to the perf stream open ioctl, we would also need a way to detect their availability. So far in my experiments I've used the following trick : specify an invalid context id parameter at open and expect ENOENT when the parameter is available, EINVAL otherwise. I'm open to other ways of doing this. Cheers, Lionel Landwerlin (4): drm/i915/perf: rework aging tail workaround drm/i915/perf: add new open param to configure polling of OA buffer drm/i915/perf: handle interrupts from the OA unit drm/i915/perf: add interrupt enabling parameter drivers/gpu/drm/i915/i915_drv.h | 59 +++-- drivers/gpu/drm/i915/i915_irq.c | 39 +++- drivers/gpu/drm/i915/i915_perf.c | 273 +++++++++++++++--------- drivers/gpu/drm/i915/i915_reg.h | 7 + drivers/gpu/drm/i915/intel_ringbuffer.c | 2 + include/uapi/drm/i915_drm.h | 15 ++ 6 files changed, 276 insertions(+), 119 deletions(-) --- 2.20.1