Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2662697imu; Fri, 23 Nov 2018 12:42:24 -0800 (PST) X-Google-Smtp-Source: AJdET5dt5pVgqXFsVRft7CesAFsHyrukvL/jD79EQ4hP96oQi6CasoAomPvZV8oi/OrQuE8rVAEg X-Received: by 2002:aa7:8354:: with SMTP id z20mr17229641pfm.81.1543005744660; Fri, 23 Nov 2018 12:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543005744; cv=none; d=google.com; s=arc-20160816; b=pIGDvLd1b2bYDJAVqc/CbybT5TSrXaCEIr7Heq5CRWPZ+O8SS+owDzvAnINNKnZaBa AcWZ0webrEr6EsqwRjtEzUaJguGuto8Y18lNDiWAxfEcj7hLKNm13xQ3tK2ZbZBCs+2M M/BkLI5+YKINwc/04fb9akk2BkAUfh0TJuxVE7Xj+TO6tzMXg2OlobrTpAJkBYmZo0Wh bHv2RWr9H8FVKERDXrH5LuQTwMcpxOEBxosX5FZxif9WBbHc/qCFijgN/xjAIYnn0BnB am2ChD2KMrTgfC7s4MyEzMPxyrJtXTRH5Gjem4Oj4akG/FBJDy8MgEbRW3FX29xqusuE h4PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9NNs2bPnIF0J9e1VjXBtE16QDMcausS9Z9XExmE1C6s=; b=I6y0XXJOX3TGbcofvwyGQnQhDFf3H9+YtZfI7Rb3bQ2egP1AHAFeETp1PqWxr5Eh7i EDz4swiwTTGWybTaKnBNlxO/3cnxv0SilbpFNpCyOvv9ATXOVlE4YJ9klDdlQBuJa69y BPa57JrN0T7SaO/GFH7Kr+y31AEm1Wr5hvX5Tz85hYM7gaxHVWIWHYe9vH7Zh/D46h+s SSDtmTV9go110lfo1GnqDxGF7PlCX4Owz8ztjwB5qITDGFHM2L9VOvU0xjF+1cKVfcI9 7aEU38yN3H51jjvl++w+ckjfdVCR9sofGBcGJAvkDe4gCxYT+ufeI4WeibIKXJ9Ky5/U vfoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b="c/zY8oCC"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si53232233pgq.275.2018.11.23.12.42.09; Fri, 23 Nov 2018 12:42:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b="c/zY8oCC"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437443AbeKWBKq (ORCPT + 99 others); Thu, 22 Nov 2018 20:10:46 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:42806 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388795AbeKWBKp (ORCPT ); Thu, 22 Nov 2018 20:10:45 -0500 Received: by mail-ed1-f66.google.com with SMTP id j6so7862389edp.9 for ; Thu, 22 Nov 2018 06:31:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=9NNs2bPnIF0J9e1VjXBtE16QDMcausS9Z9XExmE1C6s=; b=c/zY8oCCrXQzifH44p6KAW42GU0zr3HtF8oTt7JajzVEDJp0n+JW70wHPb1kgfw0nS KFD69R8BcGE7eGNAExW/EgM8/Gdc3LnUHHqpeE8YQvcYUENLDcZNxjF+xEowUpbsHYpz UuG5CDew4D29+NpuhNqEWXt7u8BCWLnLGBqHk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=9NNs2bPnIF0J9e1VjXBtE16QDMcausS9Z9XExmE1C6s=; b=rzQ2Bp1OzST3I8beNCDskVcTrVbejoi3VfryYEGBIH0kL6qx/p/7FoklAo+EH8mEek Da/SNmIlYjtwo9NUdpFVNjo3EjG0hhwmReEVrjxBjyhXWjCwsGLjY4y7YkAXRleQuxLb JLTL6re6/3n/Qzqmh6s3jnqmCdeIfRzOvhPinRtsjcmDkL6Mhi12xykyN3uWfoMYcbJ9 r+aQINjAein4YsSo/Ia4u6hGrB6+O4/lVnz7hAE/aIn9hxem55bjYmKEG2jUuaPWcWR+ g3PYs6NhpW+1V45bTpgiTjey7tSsiefU/lrOm/iOU2bjUyjhTecoF5wF04Ppl3wypSww V0Tg== X-Gm-Message-State: AA+aEWZXolhIgMnwl5PlXzgi9IYj5jpkv8YL1lUzMFHijg/lHEVFjUOH wUZtJEALJ7/NsLTTNljjvC1ycg== X-Received: by 2002:a50:9472:: with SMTP id q47mr9791998eda.251.1542897067267; Thu, 22 Nov 2018 06:31:07 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id r46sm1287466edd.18.2018.11.22.06.31.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Nov 2018 06:31:06 -0800 (PST) Date: Thu, 22 Nov 2018 15:31:04 +0100 From: Daniel Vetter To: Joonas Lahtinen Cc: jglisse@redhat.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter , Chris Wilson , Lionel Landwerlin , Jani Nikula , Rodrigo Vivi , intel-gfx@lists.freedesktop.org Subject: Re: [PATCH 2/2] gpu/i915: use HMM mirror for userptr buffer object. Message-ID: <20181122143104.GF4266@phenom.ffwll.local> Mail-Followup-To: Joonas Lahtinen , jglisse@redhat.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , Chris Wilson , Lionel Landwerlin , Jani Nikula , Rodrigo Vivi , intel-gfx@lists.freedesktop.org References: <20180910005736.5805-1-jglisse@redhat.com> <20180910005736.5805-3-jglisse@redhat.com> <154289518994.19402.3481838548028068213@jlahtine-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <154289518994.19402.3481838548028068213@jlahtine-desk.ger.corp.intel.com> X-Operating-System: Linux phenom 4.18.0-2-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 22, 2018 at 03:59:50PM +0200, Joonas Lahtinen wrote: > Hi Jerome, > > Bit late reply, but here goes :) > > We're working quite hard to avoid pinning any pages unless they're in > the GPU page tables. And when they are in the GPU page tables, they must > be pinned for whole of that duration, for the reason that our GPUs can > not take a fault. And to avoid thrashing GPU page tables, we do leave > objects in page tables with the expectation that smart userspace > recycles buffers. > > So what I understand of your proposal, it wouldn't really make a > difference for us in the amount of pinned pages (which I agree, > we'd love to see going down). When we're unable to take a fault, > the first use effectively forces us to pin any pages and keep them > pinned to avoid thrashing GPU page tables. > > So from i915 perspective, it just seems to be mostly an exchange of > an API to an another for getting the pages. You already mentioned > the fast path is being worked on, which is an obvious difference. > But is there some other improvement one would be expecting, beyond > the page pinning? > > Also, is the requirement for a single non-file-backed VMA in the > plans of being eliminated or is that inherent restriction of the > HMM_MIRROR feature? We're currently not imposing such a limitation. I think a clear plus for HMM would be if this helps us fix the deadlocks and races we're seeing. But I have no idea whether this gets us any closer here or not. -Daniel > > Regards, Joonas > > Quoting jglisse@redhat.com (2018-09-10 03:57:36) > > From: J?r?me Glisse > > > > This replace existing code that rely on get_user_page() aka GUP with > > code that now use HMM mirror to mirror a range of virtual address as > > a buffer object accessible by the GPU. There is no functional changes > > from userspace point of view. > > > > From kernel point of view we no longer pin pages for userptr buffer > > object which is a welcome change (i am assuming that everyone dislike > > page pin as i do). > > > > Another change, from kernel point of view, is that it does no longer > > have a fast path with get_user_pages_fast() this can eventually added > > back through HMM. > > > > Signed-off-by: J?r?me Glisse > > Cc: dri-devel@lists.freedesktop.org > > Cc: David Airlie > > Cc: Daniel Vetter > > Cc: Chris Wilson > > Cc: Lionel Landwerlin > > Cc: Jani Nikula > > Cc: Joonas Lahtinen > > Cc: Rodrigo Vivi > > Cc: intel-gfx@lists.freedesktop.org -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch