All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	Linux-MM <linux-mm@kvack.org>, Pavel Machek <pavel@ucw.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Joerg Roedel <jroedel@suse.de>, Dave Airlie <airlied@redhat.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	stable <stable@vger.kernel.org>
Subject: Re: [PATCH 2/4] drm/i915/gem: Sync the vmap PTEs upon construction
Date: Fri, 21 Aug 2020 14:01:41 +0100	[thread overview]
Message-ID: <159801490171.29194.13892566081151243171@build.alporthouse.com> (raw)
In-Reply-To: <CAHk-=wiu1WHD0x0VXKoLQGy43S7KLCY=Yd-TPDh=7tDW08554w@mail.gmail.com>

Quoting Linus Torvalds (2020-08-21 13:41:03)
> On Fri, Aug 21, 2020 at 1:50 AM Chris Wilson <chris@chris-wilson.co.uk> 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

WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Joerg Roedel <jroedel@suse.de>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable <stable@vger.kernel.org>, Linux-MM <linux-mm@kvack.org>,
	Pavel Machek <pavel@ucw.cz>, Dave Airlie <airlied@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [Intel-gfx] [PATCH 2/4] drm/i915/gem: Sync the vmap PTEs upon construction
Date: Fri, 21 Aug 2020 14:01:41 +0100	[thread overview]
Message-ID: <159801490171.29194.13892566081151243171@build.alporthouse.com> (raw)
In-Reply-To: <CAHk-=wiu1WHD0x0VXKoLQGy43S7KLCY=Yd-TPDh=7tDW08554w@mail.gmail.com>

Quoting Linus Torvalds (2020-08-21 13:41:03)
> On Fri, Aug 21, 2020 at 1:50 AM Chris Wilson <chris@chris-wilson.co.uk> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-08-21 13:01 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21  8:50 [PATCH 1/4] mm: Export flush_vm_area() to sync the PTEs upon construction Chris Wilson
2020-08-21  8:50 ` [Intel-gfx] " Chris Wilson
2020-08-21  8:50 ` [PATCH 2/4] drm/i915/gem: Sync the vmap " Chris Wilson
2020-08-21  8:50   ` [Intel-gfx] " Chris Wilson
2020-08-21 12:41   ` Linus Torvalds
2020-08-21 12:41     ` [Intel-gfx] " Linus Torvalds
2020-08-21 12:41     ` Linus Torvalds
2020-08-21 13:01     ` Chris Wilson [this message]
2020-08-21 13:01       ` [Intel-gfx] " Chris Wilson
2020-08-21  8:50 ` [PATCH 3/4] drm/i915/gem: Use set_pte_at() for assigning the vmapped PTE Chris Wilson
2020-08-21  8:50   ` [Intel-gfx] " Chris Wilson
2020-08-21  8:50 ` [PATCH 4/4] drm/i915/gem: Replace reloc chain with terminator on error unwind Chris Wilson
2020-08-21  8:50   ` [Intel-gfx] " Chris Wilson
2020-08-21  9:14 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] mm: Export flush_vm_area() to sync the PTEs upon construction Patchwork
2020-08-21  9:16 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-08-21  9:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-08-21  9:51 ` [PATCH 1/4] " Joerg Roedel
2020-08-21  9:51   ` [Intel-gfx] " Joerg Roedel
2020-08-21  9:54   ` Chris Wilson
2020-08-21  9:54     ` [Intel-gfx] " Chris Wilson
2020-08-21 10:22     ` Joerg Roedel
2020-08-21 10:22       ` [Intel-gfx] " Joerg Roedel
2020-08-21 10:36       ` Chris Wilson
2020-08-21 10:36         ` [Intel-gfx] " Chris Wilson
2020-08-21 10:09 ` [PATCH] mm: Track page table modifications in __apply_to_page_range() construction Joerg Roedel
2020-08-21 10:09   ` [Intel-gfx] " Joerg Roedel
2020-08-21 10:13   ` Chris Wilson
2020-08-21 10:13     ` [Intel-gfx] " Chris Wilson
2020-08-21 10:23     ` Joerg Roedel
2020-08-21 10:23       ` [Intel-gfx] " Joerg Roedel
2020-08-21 10:39       ` Chris Wilson
2020-08-21 10:39         ` [Intel-gfx] " Chris Wilson
2020-08-21 11:38         ` Chris Wilson
2020-08-21 11:38           ` [Intel-gfx] " Chris Wilson
2020-08-21 12:18           ` Joerg Roedel
2020-08-21 12:18             ` [Intel-gfx] " Joerg Roedel
2020-08-21 10:53   ` Greg KH
2020-08-21 10:53     ` [Intel-gfx] " Greg KH
2020-08-21 10:27 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with mm: Track page table modifications in __apply_to_page_range() construction (rev2) Patchwork
2020-08-21 11:33 ` [Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [1/4] mm: Export flush_vm_area() to sync the PTEs upon construction Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=159801490171.29194.13892566081151243171@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pavel@ucw.cz \
    --cc=rodrigo.vivi@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.