All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sinclair Yeh <syeh@vmware.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: "Thomas Hellstrom" <thellstrom@vmware.com>,
	"Michel Dänzer" <michel@daenzer.net>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/ttm: Make sure BOs being swapped out are cacheable
Date: Wed, 25 Jan 2017 16:46:33 -0800	[thread overview]
Message-ID: <20170126004632.GA3457@vmware.com> (raw)
In-Reply-To: <56e0a49e-89b6-4542-e905-57f0dc2ae79c@amd.com>

On Wed, Jan 25, 2017 at 10:49:33AM +0100, Christian König wrote:
> Am 25.01.2017 um 10:25 schrieb Thomas Hellstrom:
> >On 01/25/2017 09:21 AM, Michel Dänzer wrote:
> >>From: Michel Dänzer <michel.daenzer@amd.com>
> >>
> >>The current caching state may not be tt_cached, even though the
> >>placement contains TTM_PL_FLAG_CACHED, because placement can contain
> >>multiple caching flags. Trying to swap out such a BO would trip up the
> >>
> >>	BUG_ON(ttm->caching_state != tt_cached);
> >>
> >>in ttm_tt_swapout.
> >>
> >>Cc: stable@vger.kernel.org
> >>Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> >Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
> 
> Reviewed-by: Christian König <christian.koenig@amd.com>.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>

> 
> >
> >>---
> >>  drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >>diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> >>index d5063618efa7..86e3b233b722 100644
> >>--- a/drivers/gpu/drm/ttm/ttm_bo.c
> >>+++ b/drivers/gpu/drm/ttm/ttm_bo.c
> >>@@ -1670,7 +1670,6 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
> >>  	struct ttm_buffer_object *bo;
> >>  	int ret = -EBUSY;
> >>  	int put_count;
> >>-	uint32_t swap_placement = (TTM_PL_FLAG_CACHED | TTM_PL_FLAG_SYSTEM);
> >>  	spin_lock(&glob->lru_lock);
> >>  	list_for_each_entry(bo, &glob->swap_lru, swap) {
> >>@@ -1701,7 +1700,8 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
> >>  	 * Move to system cached
> >>  	 */
> >>-	if ((bo->mem.placement & swap_placement) != swap_placement) {
> >>+	if (bo->mem.mem_type != TTM_PL_SYSTEM ||
> >>+	    bo->ttm->caching_state != tt_cached) {
> >>  		struct ttm_mem_reg evict_mem;
> >>  		evict_mem = bo->mem;
> >
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Sinclair Yeh <syeh@vmware.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: "Thomas Hellstrom" <thellstrom@vmware.com>,
	"Michel Dänzer" <michel@daenzer.net>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/ttm: Make sure BOs being swapped out are cacheable
Date: Wed, 25 Jan 2017 16:46:33 -0800	[thread overview]
Message-ID: <20170126004632.GA3457@vmware.com> (raw)
In-Reply-To: <56e0a49e-89b6-4542-e905-57f0dc2ae79c@amd.com>

On Wed, Jan 25, 2017 at 10:49:33AM +0100, Christian König wrote:
> Am 25.01.2017 um 10:25 schrieb Thomas Hellstrom:
> >On 01/25/2017 09:21 AM, Michel Dänzer wrote:
> >>From: Michel Dänzer <michel.daenzer@amd.com>
> >>
> >>The current caching state may not be tt_cached, even though the
> >>placement contains TTM_PL_FLAG_CACHED, because placement can contain
> >>multiple caching flags. Trying to swap out such a BO would trip up the
> >>
> >>	BUG_ON(ttm->caching_state != tt_cached);
> >>
> >>in ttm_tt_swapout.
> >>
> >>Cc: stable@vger.kernel.org
> >>Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> >Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
> 
> Reviewed-by: Christian König <christian.koenig@amd.com>.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>

> 
> >
> >>---
> >>  drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >>diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> >>index d5063618efa7..86e3b233b722 100644
> >>--- a/drivers/gpu/drm/ttm/ttm_bo.c
> >>+++ b/drivers/gpu/drm/ttm/ttm_bo.c
> >>@@ -1670,7 +1670,6 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
> >>  	struct ttm_buffer_object *bo;
> >>  	int ret = -EBUSY;
> >>  	int put_count;
> >>-	uint32_t swap_placement = (TTM_PL_FLAG_CACHED | TTM_PL_FLAG_SYSTEM);
> >>  	spin_lock(&glob->lru_lock);
> >>  	list_for_each_entry(bo, &glob->swap_lru, swap) {
> >>@@ -1701,7 +1700,8 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
> >>  	 * Move to system cached
> >>  	 */
> >>-	if ((bo->mem.placement & swap_placement) != swap_placement) {
> >>+	if (bo->mem.mem_type != TTM_PL_SYSTEM ||
> >>+	    bo->ttm->caching_state != tt_cached) {
> >>  		struct ttm_mem_reg evict_mem;
> >>  		evict_mem = bo->mem;
> >
> 

  reply	other threads:[~2017-01-26  0:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25  8:21 [PATCH] drm/ttm: Make sure BOs being swapped out are cacheable Michel Dänzer
2017-01-25  9:25 ` Thomas Hellstrom
2017-01-25  9:25   ` Thomas Hellstrom
2017-01-25  9:49   ` Christian König
2017-01-25  9:49     ` Christian König
2017-01-26  0:46     ` Sinclair Yeh [this message]
2017-01-26  0:46       ` Sinclair Yeh
2017-01-27  2:29       ` Michel Dänzer
2017-01-27  2:29         ` Michel Dänzer
2017-01-27  6:23         ` Thomas Hellstrom
2017-01-27  6:23           ` Thomas Hellstrom
2017-01-27  7:30           ` Daniel Vetter
2017-01-27  7:30             ` Daniel Vetter
2017-01-27  8:22             ` Christian König
2017-01-27  8:22               ` Christian König
2017-01-27 14:12               ` Daniel Vetter
2017-01-27 14:12                 ` Daniel Vetter
2017-01-27 14:43                 ` Christian König
2017-01-27 14:43                   ` Christian König
2017-01-27 14:52                   ` Daniel Vetter
2017-01-27 14:52                     ` Daniel Vetter
2017-01-27 15:03               ` Alex Deucher
2017-01-27 15:03                 ` Alex Deucher

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=20170126004632.GA3457@vmware.com \
    --to=syeh@vmware.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michel@daenzer.net \
    --cc=thellstrom@vmware.com \
    /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 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.