Skip to content

Commit

Permalink
drm/amdkfd: Work around mmu_notifier_put issue on RHEL 8.3
Browse files Browse the repository at this point in the history
The DRM backport from kernel 5.6 includes some MMU notifier changes
that cause problems with the mmu_notifier_put function. The
free_notifier never gets called. This leads to a leak of kfd_process
structures and their doorbells.

Work around this by falling back to the old method of releasing the
MMU notifier and destryoing the process structure.

Change-Id: I711a61efee2b284e385251b7f826e228e64c04f2
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Flora Cui<flora.cui@amd.com>
  • Loading branch information
fxkamd authored and amd-aakash committed Jan 15, 2021
1 parent 9b141c0 commit 0d07f6d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/amdkfd/kfd_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,11 @@ struct kfd_process {
/* We want to receive a notification when the mm_struct is destroyed */
struct mmu_notifier mmu_notifier;

#if defined(DRM_VER) && defined(DRM_PATCH) && DRM_VER == 5 && DRM_PATCH == 6 \
&& LINUX_VERSION_CODE == KERNEL_VERSION(4, 18, 0)
/* mmu_notifier_put in the RH DRM backport from 5.6 is broken */
# undef HAVE_MMU_NOTIFIER_PUT
#endif
#ifndef HAVE_MMU_NOTIFIER_PUT
/* Use for delayed freeing of kfd_process structure */
struct rcu_head rcu;
Expand Down

0 comments on commit 0d07f6d

Please sign in to comment.