From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 107328] radeon_gart_table_vram_pin takes 473 ms during ACPI S3 resume Date: Sun, 22 Jul 2018 07:45:52 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0033647618==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id 715466E0D5 for ; Sun, 22 Jul 2018 07:45:53 +0000 (UTC) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0033647618== Content-Type: multipart/alternative; boundary="15322455531.532945dA.10530" Content-Transfer-Encoding: 7bit --15322455531.532945dA.10530 Date: Sun, 22 Jul 2018 07:45:53 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D107328 Bug ID: 107328 Summary: radeon_gart_table_vram_pin takes 473 ms during ACPI S3 resume Product: DRI Version: DRI git Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: DRM/Radeon Assignee: dri-devel@lists.freedesktop.org Reporter: pmenzel+bugs.freedesktop@molgen.mpg.de Created attachment 140760 --> https://bugs.freedesktop.org/attachment.cgi?id=3D140760&action=3Dedit Screenshot from HTML output of `sleepgraph.py` with `devicefilter: radeon` = and `maxdepth: 20` On a ASRock E350M1 with Linux 4.18-rc5+, profiling ACPI S3 suspend and resu= me time with `sleepgraph.py` from pm-graph [1], the radeon module over half a second to resume, which is also visible adding `initcall_debug` to the comm= and line. > radeon @ 0000:00:01.0 {radeon} async_device (Total Suspend: 36.541 ms Tot= al Resume: 687.797 ms) evergreen_startup [radeon] (562.983 ms @ 403.615437) =E2=86=92 radeon_gart_table_vram_pin [radeon] (473.376 ms @ 403.617537) The function from `drivers/gpu/drm/radeon/radeon_gart.c` looks like below, = and the problem is the for loop in the end. /** * radeon_gart_table_vram_pin - pin gart page table in vram * * @rdev: radeon_device pointer * * Pin the GART page table in vram so it will not be moved * by the memory manager (pcie r4xx, r5xx+). These asics require the * gart table to be in video memory. * Returns 0 for success, error for failure. */ int radeon_gart_table_vram_pin(struct radeon_device *rdev) { uint64_t gpu_addr; int r; r =3D radeon_bo_reserve(rdev->gart.robj, false); if (unlikely(r !=3D 0)) return r; r =3D radeon_bo_pin(rdev->gart.robj, RADEON_GEM_DOMAIN_VRAM, &gpu_addr); if (r) { radeon_bo_unreserve(rdev->gart.robj); return r; } r =3D radeon_bo_kmap(rdev->gart.robj, &rdev->gart.ptr); if (r)=20=20 radeon_bo_unpin(rdev->gart.robj); radeon_bo_unreserve(rdev->gart.robj); rdev->gart.table_addr =3D gpu_addr; if (!r) { int i; /* We might have dropped some GART table updates while it wasn't * mapped, restore all entries */ for (i =3D 0; i < rdev->gart.num_gpu_pages; i++) radeon_gart_set_page(rdev, i, rdev->gart.pages_entry[i]); mb(); radeon_gart_tlb_flush(rdev); } return r; } Is there a way to get rid of the for loop? Some memset equivalent? [1]: https://github.com/01org/pm-graph --=20 You are receiving this mail because: You are the assignee for the bug.= --15322455531.532945dA.10530 Date: Sun, 22 Jul 2018 07:45:53 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated
Bug ID 107328
Summary radeon_gart_table_vram_pin takes 473 ms during ACPI S3 resume
Product DRI
Version DRI git
Hardware Other
OS All
Status NEW
Severity normal
Priority medium
Component DRM/Radeon
Assignee dri-devel@lists.freedesktop.org
Reporter pmenzel+bugs.freedesktop@molgen.mpg.de

Created attachment 140760=
 [details]
Screenshot from HTML output of `sleepgraph.py` with `devicefilter: radeon` =
and
`maxdepth: 20`

On a ASRock E350M1 with Linux 4.18-rc5+, profiling ACPI S3 suspend and resu=
me
time with `sleepgraph.py` from pm-graph [1], the radeon module over half a
second to resume, which is also visible adding `initcall_debug` to the comm=
and
line.

> radeon @ 0000:00:01.0 {radeon} async_device =
(Total Suspend: 36.541 ms Total Resume: 687.797 ms)

evergreen_startup [radeon] (562.983 ms @ 403.615437)
=E2=86=92 radeon_gart_table_vram_pin [radeon] (473.376 ms @ 403.617537)

The function from `drivers/gpu/drm/radeon/radeon_gart.c` looks like below, =
and
the problem is the for loop in the end.

/**
 * radeon_gart_table_vram_pin - pin gart page table in vram
 *
 * @rdev: radeon_device pointer
 *
 * Pin the GART page table in vram so it will not be moved
 * by the memory manager (pcie r4xx, r5xx+).  These asics require the
 * gart table to be in video memory.
 * Returns 0 for success, error for failure.
 */
int radeon_gart_table_vram_pin(struct radeon_device *rdev)
{
        uint64_t gpu_addr;
        int r;

        r =3D radeon_bo_reserve(rdev->gart.robj, false);
        if (unlikely(r !=3D 0))
                return r;
        r =3D radeon_bo_pin(rdev->gart.robj,
                                RADEON_GEM_DOMAIN_VRAM, &gpu_addr);
        if (r) {
                radeon_bo_unreserve(rdev->gart.robj);
                return r;
        }
        r =3D radeon_bo_kmap(rdev->gart.robj, &rdev->gart.ptr);
        if (r)=20=20
                radeon_bo_unpin(rdev->gart.robj);
        radeon_bo_unreserve(rdev->gart.robj);
        rdev->gart.table_addr =3D gpu_addr;

        if (!r) {
                int i;

                /* We might have dropped some GART table updates while it
wasn't
                 * mapped, restore all entries
                 */
                for (i =3D 0; i < rdev->gart.num_gpu_pages; i++)
                        radeon_gart_set_page(rdev, i,
rdev->gart.pages_entry[i]);
                mb();
                radeon_gart_tlb_flush(rdev);
        }

        return r;
}

Is there a way to get rid of the for loop? Some memset equivalent?

[1]: https://github.com/01org=
/pm-graph


You are receiving this mail because:
  • You are the assignee for the bug.
= --15322455531.532945dA.10530-- --===============0033647618== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0033647618==--