Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp232250pxa; Fri, 21 Aug 2020 06:03:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhzAVj3xrE4t/8AnWPQkDzqgU8dcxvuvyQz7PKfDdveNWSwZ/hQBW5VVkNSLiUQ49943VD X-Received: by 2002:a17:906:cc4d:: with SMTP id mm13mr2641015ejb.191.1598014981368; Fri, 21 Aug 2020 06:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598014981; cv=none; d=google.com; s=arc-20160816; b=casAwMLehX3qZ2hw2go1CDg5eKdKx4dWgzW1aBWMGRkBXGRDcVS+f5dS1uT9WkPMLu DM4Is3oqe5PjsOma4p5MWisl3QRCe1VzbyIL+S8s+N+ZmQrzoxG18TZ3a6AuPBCXOlgi QAYI+/svHgGK2ISzsOAPRzgP4D3AzOSY505QW4e05Vv6p1ERGlofHlVkZId9whIuo4LS a2yCoEbhviT5GYS4ng1n8p6eNdF3Hw5cIuWAxHi9XJg/iayo+PM9SZmYheHl11gH2NnB CeFfh6VqbDsFPkItrzK/shu1Wwyq1yTLO/Mui5Q51KH4GoAA/mQZzceE+k0MTQdzlnJj T6zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version; bh=urvjST1lyRB+rvRRYqLUUWA5xQI99Tfv2NMLMtwy+8Y=; b=lZtuGTVFA+dEChAafLZDo96JrsUCAdBHh2HdiWn6zFKxjf0H/qx+RrgdlU7cU/MWMk 39n/sIO534lre2QoC0bGmbCC5o87IS9Qqyd1+QT+f+BvWbhICmom8Fp5NKJVDS+kZnIZ I89gW2vOxTemNpagruzSIXKmL6S9L89aTLTBJv3RYlmTI+cpgaQEjsmlYZ5iOULHtJEL t1Z6IgeFRjkYbLRtgLmzJShGOCbOJe7PTStB8sOoPU56QqFrnJCfBGFPLrPdf7wi0Q2Q DFbcGXeBfXRU+GDU3bsPi3H0feHWo0oRm02e7Zp+Wl/rGiUgYlT1MXNKJ0KF/vuyGR7m jJcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o3si1115703ejm.346.2020.08.21.06.02.37; Fri, 21 Aug 2020 06:03:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727937AbgHUNBt convert rfc822-to-8bit (ORCPT + 99 others); Fri, 21 Aug 2020 09:01:49 -0400 Received: from mail.fireflyinternet.com ([77.68.26.236]:62309 "EHLO fireflyinternet.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727123AbgHUNBs (ORCPT ); Fri, 21 Aug 2020 09:01:48 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 22198351-1500050 for multiple; Fri, 21 Aug 2020 14:01:43 +0100 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT In-Reply-To: References: <20200821085011.28878-1-chris@chris-wilson.co.uk> <20200821085011.28878-2-chris@chris-wilson.co.uk> Subject: Re: [PATCH 2/4] drm/i915/gem: Sync the vmap PTEs upon construction From: Chris Wilson Cc: Linux Kernel Mailing List , intel-gfx , Linux-MM , Pavel Machek , Andrew Morton , Joerg Roedel , Dave Airlie , Joonas Lahtinen , Rodrigo Vivi , stable To: Linus Torvalds Date: Fri, 21 Aug 2020 14:01:41 +0100 Message-ID: <159801490171.29194.13892566081151243171@build.alporthouse.com> User-Agent: alot/0.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Linus Torvalds (2020-08-21 13:41:03) > On Fri, Aug 21, 2020 at 1:50 AM Chris Wilson wrote: > > > > Since synchronising the PTE after assignment is a manual step, use the > > newly exported interface to flush the PTE after assigning via > > alloc_vm_area(). > > This commit message doesn't make much sense to me. > > Are you talking about synchronizing the page directory structure > across processes after possibly creating new kernel page tables? > > Because that has nothing to do with the PTE. It's all about making > sure the _upper_ layers of the page directories are populated > everywhere.. > > The name seems off to me too - what are you "flushing"? (And yes, I > know about the flush_cache_vmap(), but that looks just bogus, since > any non-mapped area shouldn't have any virtual caches to begin with, > so I suspect that is just the crazy architectures being confused - > flush_cache_vmap() is a no-op on any sane architecture - and powerpc > that mis-uses it for other things). I was trying to mimic map_kernel_range() which does the arch_sync_kernel_mappings and flush_cache_vmap on top of the apply_to_page_range performed by alloc_vm_area, because buried away in there, on x86-32, is a set_pmd(). Since map_kernel_range() wrapped map_kernel_range_noflush(), flush seemed like the right verb. Joerg pointed out that the sync belonged to __apply_to_page_range and fixed it in situ. -Chris