lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOeoa-cbQv2pkpxhXMV++NY3MbouPP077UVPnp7fu3zjFxt8Uw@mail.gmail.com>
Date:   Thu, 3 Sep 2020 00:23:08 -0700
From:   Kristian Høgsberg <hoegsberg@...il.com>
To:     Rob Clark <robdclark@...il.com>
Cc:     dri-devel <dri-devel@...ts.freedesktop.org>,
        Rob Clark <robdclark@...omium.org>,
        "open list:DRM DRIVER FOR MSM ADRENO GPU" 
        <freedreno@...ts.freedesktop.org>, David Airlie <airlied@...ux.ie>,
        "open list:DRM DRIVER FOR MSM ADRENO GPU" 
        <linux-arm-msm@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        Daniel Vetter <daniel@...ll.ch>, Sean Paul <sean@...rly.run>
Subject: Re: [Freedreno] [PATCH 2/3] drm/msm: Convert shrinker msgs to tracepoints

On Tue, Sep 1, 2020 at 8:41 AM Rob Clark <robdclark@...il.com> wrote:
>
> From: Rob Clark <robdclark@...omium.org>
>
> This reduces the spam in dmesg when we start hitting the shrinker, and
> replaces it with something we can put on a timeline while profiling or
> debugging system issues.

That is a good solution,

Reviewed-by: Kristian H. Kristensen <hoegsberg@...gle.com>

> Signed-off-by: Rob Clark <robdclark@...omium.org>
> ---
>  drivers/gpu/drm/msm/msm_gem_shrinker.c |  5 +++--
>  drivers/gpu/drm/msm/msm_gpu_trace.h    | 26 ++++++++++++++++++++++++++
>  2 files changed, 29 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_gem_shrinker.c b/drivers/gpu/drm/msm/msm_gem_shrinker.c
> index 722d61668a97..482576d7a39a 100644
> --- a/drivers/gpu/drm/msm/msm_gem_shrinker.c
> +++ b/drivers/gpu/drm/msm/msm_gem_shrinker.c
> @@ -6,6 +6,7 @@
>
>  #include "msm_drv.h"
>  #include "msm_gem.h"
> +#include "msm_gpu_trace.h"
>
>  static bool msm_gem_shrinker_lock(struct drm_device *dev, bool *unlock)
>  {
> @@ -87,7 +88,7 @@ msm_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
>                 mutex_unlock(&dev->struct_mutex);
>
>         if (freed > 0)
> -               pr_info_ratelimited("Purging %lu bytes\n", freed << PAGE_SHIFT);
> +               trace_msm_gem_purge(freed << PAGE_SHIFT);
>
>         return freed;
>  }
> @@ -123,7 +124,7 @@ msm_gem_shrinker_vmap(struct notifier_block *nb, unsigned long event, void *ptr)
>         *(unsigned long *)ptr += unmapped;
>
>         if (unmapped > 0)
> -               pr_info_ratelimited("Purging %u vmaps\n", unmapped);
> +               trace_msm_gem_purge_vmaps(unmapped);
>
>         return NOTIFY_DONE;
>  }
> diff --git a/drivers/gpu/drm/msm/msm_gpu_trace.h b/drivers/gpu/drm/msm/msm_gpu_trace.h
> index 07572ab179fa..1079fe551279 100644
> --- a/drivers/gpu/drm/msm/msm_gpu_trace.h
> +++ b/drivers/gpu/drm/msm/msm_gpu_trace.h
> @@ -114,6 +114,32 @@ TRACE_EVENT(msm_gmu_freq_change,
>                 TP_printk("freq=%u, perf_index=%u", __entry->freq, __entry->perf_index)
>  );
>
> +
> +TRACE_EVENT(msm_gem_purge,
> +               TP_PROTO(u32 bytes),
> +               TP_ARGS(bytes),
> +               TP_STRUCT__entry(
> +                       __field(u32, bytes)
> +                       ),
> +               TP_fast_assign(
> +                       __entry->bytes = bytes;
> +                       ),
> +               TP_printk("Purging %u bytes", __entry->bytes)
> +);
> +
> +
> +TRACE_EVENT(msm_gem_purge_vmaps,
> +               TP_PROTO(u32 unmapped),
> +               TP_ARGS(unmapped),
> +               TP_STRUCT__entry(
> +                       __field(u32, unmapped)
> +                       ),
> +               TP_fast_assign(
> +                       __entry->unmapped = unmapped;
> +                       ),
> +               TP_printk("Purging %u vmaps", __entry->unmapped)
> +);
> +
>  #endif
>
>  #undef TRACE_INCLUDE_PATH
> --
> 2.26.2
>
> _______________________________________________
> Freedreno mailing list
> Freedreno@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ