From: Zhiyuan Lv <zhiyuan.lv@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: benjamin.widawsky@intel.com
Subject: [PATCH] Fix list empty check in i915_gem_evict_everything
Date: Wed, 26 Aug 2015 15:01:26 +0800 [thread overview]
Message-ID: <1440572486-14715-1-git-send-email-zhiyuan.lv@intel.com> (raw)
That seems to be a typo. The original code will override the previous
list empty check value in the loop. As the result, only the last vm in
vm_list impacts the empty check. The problem is fixed by using local
bool variable inside the loop.
Signed-off-by: Zhiyuan Lv <zhiyuan.lv@intel.com>
---
drivers/gpu/drm/i915/i915_gem_evict.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index d09e35e..a45cffa 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -255,10 +255,12 @@ i915_gem_evict_everything(struct drm_device *dev)
int ret;
list_for_each_entry(vm, &dev_priv->vm_list, global_link) {
- lists_empty = (list_empty(&vm->inactive_list) &&
+ bool empty = (list_empty(&vm->inactive_list) &&
list_empty(&vm->active_list));
- if (!lists_empty)
+ if (!empty) {
lists_empty = false;
+ break;
+ }
}
if (lists_empty)
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2015-08-26 7:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-26 7:01 Zhiyuan Lv [this message]
2015-08-26 7:28 ` [PATCH] Fix list empty check in i915_gem_evict_everything Chris Wilson
2015-08-26 7:52 ` Zhiyuan Lv
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=1440572486-14715-1-git-send-email-zhiyuan.lv@intel.com \
--to=zhiyuan.lv@intel.com \
--cc=benjamin.widawsky@intel.com \
--cc=intel-gfx@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 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.