From: Daniel Vetter <daniel.vetter@ffwll.ch> To: DRI Development <dri-devel@lists.freedesktop.org> Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>, Daniel Vetter <daniel.vetter@ffwll.ch> Subject: [PATCH 0/9] remove rcu support from i915_address_space Date: Mon, 2 Aug 2021 17:47:57 +0200 [thread overview] Message-ID: <20210802154806.3710472-1-daniel.vetter@ffwll.ch> (raw) Hi all, Jason wanted to do that as part of the scheduler series, but I object since rcu is very, very hard to review when adding, and much, much harder even to review when removing. This is because simply looking for __rcu pointer annotations and rcu functions isn't enough, rcu is also relied upon in many datastructures which have internally and rcu_read_lock protection (or at least the required amount of barriers), like xarray. The other problem is that it inherits when chasing pointers, e.g. i915_gem_engines has an rcu pointer to intel_context, which has a non-rcu pointer to i915_address_space. But since we could look-up the entire chain under rcu i.e. engines->context[i]->vm this means more code to audit. The audit explodes pretty quickly. Anyway I'm reasonable confident I got them all in the current code, and slightly less confident that I managed to stitch together the full history. References to relevant commits throughout the series. Cheers, Daniel Daniel Vetter (9): drm/i915: Drop code to handle set-vm races from execbuf drm/i915: Rename i915_gem_context_get_vm_rcu to i915_gem_context_get_eb_vm drm/i915: Use i915_gem_context_get_eb_vm in ctx_getparam drm/i915: Add i915_gem_context_is_full_ppgtt drm/i915: Use i915_gem_context_get_eb_vm in intel_context_set_gem drm/i915: Drop __rcu from gem_context->vm drm/i915: use xa_lock/unlock for fpriv->vm_xa lookups drm/i915: Stop rcu support for i915_address_space drm/i915: Split out intel_context_create_user drivers/gpu/drm/i915/gem/i915_gem_context.c | 82 ++++--------------- drivers/gpu/drm/i915/gem/i915_gem_context.h | 13 ++- .../gpu/drm/i915/gem/i915_gem_context_types.h | 2 +- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 12 ++- .../gpu/drm/i915/gem/selftests/huge_pages.c | 8 +- .../drm/i915/gem/selftests/i915_gem_context.c | 32 +++----- .../gpu/drm/i915/gem/selftests/mock_context.c | 2 +- drivers/gpu/drm/i915/gt/intel_context.c | 22 ++++- drivers/gpu/drm/i915/gt/intel_context.h | 2 + drivers/gpu/drm/i915/gt/intel_ggtt.c | 1 - drivers/gpu/drm/i915/gt/intel_gtt.c | 6 +- drivers/gpu/drm/i915/gt/intel_gtt.h | 2 +- drivers/gpu/drm/i915/gt/selftest_execlists.c | 2 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 4 +- drivers/gpu/drm/i915/i915_trace.h | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 4 +- drivers/gpu/drm/i915/selftests/i915_vma.c | 4 +- 18 files changed, 79 insertions(+), 123 deletions(-) -- 2.32.0
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel.vetter@ffwll.ch> To: DRI Development <dri-devel@lists.freedesktop.org> Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>, Daniel Vetter <daniel.vetter@ffwll.ch> Subject: [Intel-gfx] [PATCH 0/9] remove rcu support from i915_address_space Date: Mon, 2 Aug 2021 17:47:57 +0200 [thread overview] Message-ID: <20210802154806.3710472-1-daniel.vetter@ffwll.ch> (raw) Hi all, Jason wanted to do that as part of the scheduler series, but I object since rcu is very, very hard to review when adding, and much, much harder even to review when removing. This is because simply looking for __rcu pointer annotations and rcu functions isn't enough, rcu is also relied upon in many datastructures which have internally and rcu_read_lock protection (or at least the required amount of barriers), like xarray. The other problem is that it inherits when chasing pointers, e.g. i915_gem_engines has an rcu pointer to intel_context, which has a non-rcu pointer to i915_address_space. But since we could look-up the entire chain under rcu i.e. engines->context[i]->vm this means more code to audit. The audit explodes pretty quickly. Anyway I'm reasonable confident I got them all in the current code, and slightly less confident that I managed to stitch together the full history. References to relevant commits throughout the series. Cheers, Daniel Daniel Vetter (9): drm/i915: Drop code to handle set-vm races from execbuf drm/i915: Rename i915_gem_context_get_vm_rcu to i915_gem_context_get_eb_vm drm/i915: Use i915_gem_context_get_eb_vm in ctx_getparam drm/i915: Add i915_gem_context_is_full_ppgtt drm/i915: Use i915_gem_context_get_eb_vm in intel_context_set_gem drm/i915: Drop __rcu from gem_context->vm drm/i915: use xa_lock/unlock for fpriv->vm_xa lookups drm/i915: Stop rcu support for i915_address_space drm/i915: Split out intel_context_create_user drivers/gpu/drm/i915/gem/i915_gem_context.c | 82 ++++--------------- drivers/gpu/drm/i915/gem/i915_gem_context.h | 13 ++- .../gpu/drm/i915/gem/i915_gem_context_types.h | 2 +- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 12 ++- .../gpu/drm/i915/gem/selftests/huge_pages.c | 8 +- .../drm/i915/gem/selftests/i915_gem_context.c | 32 +++----- .../gpu/drm/i915/gem/selftests/mock_context.c | 2 +- drivers/gpu/drm/i915/gt/intel_context.c | 22 ++++- drivers/gpu/drm/i915/gt/intel_context.h | 2 + drivers/gpu/drm/i915/gt/intel_ggtt.c | 1 - drivers/gpu/drm/i915/gt/intel_gtt.c | 6 +- drivers/gpu/drm/i915/gt/intel_gtt.h | 2 +- drivers/gpu/drm/i915/gt/selftest_execlists.c | 2 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 4 +- drivers/gpu/drm/i915/i915_trace.h | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 4 +- drivers/gpu/drm/i915/selftests/i915_vma.c | 4 +- 18 files changed, 79 insertions(+), 123 deletions(-) -- 2.32.0
next reply other threads:[~2021-08-02 15:48 UTC|newest] Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-02 15:47 Daniel Vetter [this message] 2021-08-02 15:47 ` [Intel-gfx] [PATCH 0/9] remove rcu support from i915_address_space Daniel Vetter 2021-08-02 15:47 ` [PATCH 1/9] drm/i915: Drop code to handle set-vm races from execbuf Daniel Vetter 2021-08-02 15:47 ` [Intel-gfx] " Daniel Vetter 2021-08-02 15:47 ` [PATCH 2/9] drm/i915: Rename i915_gem_context_get_vm_rcu to i915_gem_context_get_eb_vm Daniel Vetter 2021-08-02 15:47 ` [Intel-gfx] " Daniel Vetter 2021-08-02 15:48 ` [PATCH 3/9] drm/i915: Use i915_gem_context_get_eb_vm in ctx_getparam Daniel Vetter 2021-08-02 15:48 ` [Intel-gfx] " Daniel Vetter 2021-08-02 15:48 ` [PATCH 4/9] drm/i915: Add i915_gem_context_is_full_ppgtt Daniel Vetter 2021-08-02 15:48 ` [Intel-gfx] " Daniel Vetter 2021-08-02 15:48 ` [PATCH 5/9] drm/i915: Use i915_gem_context_get_eb_vm in intel_context_set_gem Daniel Vetter 2021-08-02 15:48 ` [Intel-gfx] " Daniel Vetter 2021-08-02 15:48 ` [PATCH 6/9] drm/i915: Drop __rcu from gem_context->vm Daniel Vetter 2021-08-02 15:48 ` [Intel-gfx] " Daniel Vetter 2021-08-03 0:35 ` kernel test robot 2021-08-03 0:35 ` kernel test robot 2021-08-02 15:48 ` [PATCH 7/9] drm/i915: use xa_lock/unlock for fpriv->vm_xa lookups Daniel Vetter 2021-08-02 15:48 ` [Intel-gfx] " Daniel Vetter 2021-08-02 15:48 ` [PATCH 8/9] drm/i915: Stop rcu support for i915_address_space Daniel Vetter 2021-08-02 15:48 ` [Intel-gfx] " Daniel Vetter 2021-08-02 15:48 ` [PATCH 9/9] drm/i915: Split out intel_context_create_user Daniel Vetter 2021-08-02 15:48 ` [Intel-gfx] " Daniel Vetter 2021-08-02 16:44 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for remove rcu support from i915_address_space Patchwork 2021-08-02 16:45 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork 2021-08-02 17:14 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork 2021-08-03 12:38 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for remove rcu support from i915_address_space (rev2) Patchwork 2021-08-03 12:40 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork 2021-08-03 13:09 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork 2021-08-04 14:25 [PATCH 0/9] remove rcu support from i915_address_space Daniel Vetter
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=20210802154806.3710472-1-daniel.vetter@ffwll.ch \ --to=daniel.vetter@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.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: linkBe 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.