From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5ACEFC2D0DB for ; Mon, 20 Jan 2020 15:24:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 359AF21D7E for ; Mon, 20 Jan 2020 15:24:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 359AF21D7E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A86CC6E9B9; Mon, 20 Jan 2020 15:24:46 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1F3826E9B9 for ; Mon, 20 Jan 2020 15:24:46 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jan 2020 07:24:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,342,1574150400"; d="scan'208";a="219677585" Received: from vanderss-mobl1.ger.corp.intel.com ([10.249.254.200]) by orsmga008.jf.intel.com with ESMTP; 20 Jan 2020 07:24:42 -0800 To: Chris Wilson , intel-gfx@lists.freedesktop.org References: <20200120104924.4000706-1-chris@chris-wilson.co.uk> <20200120104924.4000706-3-chris@chris-wilson.co.uk> From: Abdiel Janulgue Message-ID: Date: Mon, 20 Jan 2020 17:24:41 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20200120104924.4000706-3-chris@chris-wilson.co.uk> Content-Language: en-US Subject: Re: [Intel-gfx] [PATCH 3/5] drm/i915/gem: Store mmap_offsets in an rbtree rather than a plain list X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matthew.auld@intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 20/01/2020 12.49, Chris Wilson wrote: > Currently we create a new mmap_offset for every call to > mmap_offset_ioctl. This exposes ourselves to an abusive client that may > simply create new mmap_offsets ad infinitum, which will exhaust physical > memory and the virtual address space. In addition to the exhaustion, a > very long linear list of mmap_offsets causes other clients using the > object to incur long list walks -- these long lists can also be > generated by simply having many clients generate their own mmap_offset. > > However, we can simply use the drm_vma_node itself to manage the file > association (allow/revoke) dropping our need to keep an mmo per-file. > Then if we keep a small rbtree of per-type mmap_offsets, we can lookup > duplicate requests quickly. As discussed, rbtree does do away with the limitation of the linear list Reviewed-by: Abdiel Janulgue > Fixes: cc662126b413 ("drm/i915: Introduce DRM_I915_GEM_MMAP_OFFSET") > Signed-off-by: Chris Wilson > Cc: Abdiel Janulgue _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx