Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	intel-gvt-dev@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gvt: remove local storage of debugfs file
Date: Wed, 19 May 2021 08:40:12 +0800	[thread overview]
Message-ID: <20210519004012.GF4589@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <20210518161705.3697143-1-gregkh@linuxfoundation.org>


[-- Attachment #1.1: Type: text/plain, Size: 2647 bytes --]

On 2021.05.18 18:17:05 +0200, Greg Kroah-Hartman wrote:
> There is no need to keep the dentry around for the debugfs kvmgt cache
> file, as we can just look it up when we want to remove it later on.
> Simplify the structure by removing the dentry and relying on debugfs
> to find the dentry to remove when we want to.
> 
> By doing this change, we remove the last in-kernel user that was storing
> the result of debugfs_create_long(), so that api can be cleaned up.
> 
> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
> Cc: Zhi Wang <zhi.a.wang@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: intel-gvt-dev@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/gpu/drm/i915/gvt/kvmgt.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index 65ff43cfc0f7..433c2a448f2d 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -88,6 +88,7 @@ struct kvmgt_pgfn {
>  	struct hlist_node hnode;
>  };
>  
> +#define KVMGT_DEBUGFS_FILENAME "kvmgt_nr_cache_entries"
>  struct kvmgt_guest_info {
>  	struct kvm *kvm;
>  	struct intel_vgpu *vgpu;
> @@ -95,7 +96,6 @@ struct kvmgt_guest_info {
>  #define NR_BKT (1 << 18)
>  	struct hlist_head ptable[NR_BKT];
>  #undef NR_BKT
> -	struct dentry *debugfs_cache_entries;
>  };
>  
>  struct gvt_dma {
> @@ -1843,16 +1843,15 @@ static int kvmgt_guest_init(struct mdev_device *mdev)
>  	info->track_node.track_flush_slot = kvmgt_page_track_flush_slot;
>  	kvm_page_track_register_notifier(kvm, &info->track_node);
>  
> -	info->debugfs_cache_entries = debugfs_create_ulong(
> -						"kvmgt_nr_cache_entries",
> -						0444, vgpu->debugfs,
> -						&vdev->nr_cache_entries);
> +	debugfs_create_ulong(KVMGT_DEBUGFS_FILENAME, 0444, vgpu->debugfs,
> +			     &vdev->nr_cache_entries);
>  	return 0;
>  }
>  
>  static bool kvmgt_guest_exit(struct kvmgt_guest_info *info)
>  {
> -	debugfs_remove(info->debugfs_cache_entries);
> +	debugfs_remove(debugfs_lookup(KVMGT_DEBUGFS_FILENAME,
> +				      info->vgpu->debugfs));
>  
>  	kvm_page_track_unregister_notifier(info->kvm, &info->track_node);
>  	kvm_put_kvm(info->kvm);
> -- 

Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>

Thanks!

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2021-05-19  0:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 16:17 [Intel-gfx] [PATCH] drm/i915/gvt: remove local storage of debugfs file Greg Kroah-Hartman
2021-05-18 16:28 ` Greg Kroah-Hartman
2021-05-19  8:03   ` Zhenyu Wang
2021-05-19  8:31     ` Greg Kroah-Hartman
2021-05-19  8:21       ` Zhenyu Wang
2021-05-21 18:43         ` Greg Kroah-Hartman
2021-05-18 17:26 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-05-19  0:40 ` Zhenyu Wang [this message]
2021-05-19  6:36   ` [Intel-gfx] [PATCH] " Jani Nikula
2021-05-19 13:45 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " 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=20210519004012.GF4589@zhen-hp.sh.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox