From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH 3/3] drm/ttm: switch to per device LRU lock
Date: Thu, 11 Feb 2021 07:28:29 +0800 [thread overview]
Message-ID: <202102110704.2t6rt7Tj-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4606 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210210152114.1134-3-christian.koenig@amd.com>
References: <20210210152114.1134-3-christian.koenig@amd.com>
TO: "Christian König" <ckoenig.leichtzumerken@gmail.com>
TO: dri-devel(a)lists.freedesktop.org
TO: ray.huang(a)amd.com
Hi "Christian,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next tegra-drm/drm/tegra/for-next linus/master drm-exynos/exynos-drm-next drm/drm-next v5.11-rc7 next-20210125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Christian-K-nig/drm-ttm-move-swapout-logic-around/20210210-232812
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: ia64-randconfig-m031-20210209 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
drivers/gpu/drm/ttm/ttm_device.c:157 ttm_device_swapout() warn: inconsistent returns 'bdev->lru_lock'.
drivers/gpu/drm/ttm/ttm_bo.c:661 ttm_mem_evict_first() error: we previously assumed 'bo' could be null (see line 658)
Old smatch warnings:
drivers/gpu/drm/ttm/ttm_device.c:142 ttm_device_swapout() warn: variable dereferenced before check 'bo->ttm' (see line 140)
vim +157 drivers/gpu/drm/ttm/ttm_device.c
d37e3072dc32c7 Christian König 2021-02-10 123
d37e3072dc32c7 Christian König 2021-02-10 124 long ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,
d37e3072dc32c7 Christian König 2021-02-10 125 gfp_t gfp_flags)
d37e3072dc32c7 Christian König 2021-02-10 126 {
d37e3072dc32c7 Christian König 2021-02-10 127 struct ttm_resource_manager *man;
22b09b650f7486 Christian König 2021-02-10 128 struct ttm_buffer_object *bo;
d37e3072dc32c7 Christian König 2021-02-10 129 unsigned i, j;
22b09b650f7486 Christian König 2021-02-10 130 int ret;
22b09b650f7486 Christian König 2021-02-10 131
12b3da401dc93d Christian König 2021-02-10 132 spin_lock(&bdev->lru_lock);
d37e3072dc32c7 Christian König 2021-02-10 133 for (i = TTM_PL_SYSTEM; i < TTM_NUM_MEM_TYPES; ++i) {
d37e3072dc32c7 Christian König 2021-02-10 134 man = ttm_manager_type(bdev, i);
d37e3072dc32c7 Christian König 2021-02-10 135 if (!man || !man->use_tt)
d37e3072dc32c7 Christian König 2021-02-10 136 continue;
d37e3072dc32c7 Christian König 2021-02-10 137
d37e3072dc32c7 Christian König 2021-02-10 138 for (j = 0; j < TTM_MAX_BO_PRIORITY; ++j) {
d37e3072dc32c7 Christian König 2021-02-10 139 list_for_each_entry(bo, &man->lru[j], lru) {
d37e3072dc32c7 Christian König 2021-02-10 140 long num_pages = bo->ttm->num_pages;
d37e3072dc32c7 Christian König 2021-02-10 141
d37e3072dc32c7 Christian König 2021-02-10 142 if (!bo->ttm ||
d37e3072dc32c7 Christian König 2021-02-10 143 bo->ttm->page_flags & TTM_PAGE_FLAG_SG ||
d37e3072dc32c7 Christian König 2021-02-10 144 bo->ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)
d37e3072dc32c7 Christian König 2021-02-10 145 continue;
22b09b650f7486 Christian König 2021-02-10 146
22b09b650f7486 Christian König 2021-02-10 147 ret = ttm_bo_swapout(bo, ctx, gfp_flags);
22b09b650f7486 Christian König 2021-02-10 148 /* ttm_bo_swapout has dropped the lru_lock */
22b09b650f7486 Christian König 2021-02-10 149 if (!ret)
22b09b650f7486 Christian König 2021-02-10 150 return num_pages;
22b09b650f7486 Christian König 2021-02-10 151 if (ret != -EBUSY)
22b09b650f7486 Christian König 2021-02-10 152 return ret;
22b09b650f7486 Christian König 2021-02-10 153 }
22b09b650f7486 Christian König 2021-02-10 154 }
d37e3072dc32c7 Christian König 2021-02-10 155 }
12b3da401dc93d Christian König 2021-02-10 156 spin_unlock(&bdev->lru_lock);
22b09b650f7486 Christian König 2021-02-10 @157 return 0;
22b09b650f7486 Christian König 2021-02-10 158 }
d37e3072dc32c7 Christian König 2021-02-10 159 EXPORT_SYMBOL(ttm_device_swapout);
22b09b650f7486 Christian König 2021-02-10 160
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31987 bytes --]
next reply other threads:[~2021-02-10 23:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-10 23:28 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-03-18 12:47 [PATCH 1/3] drm/ttm: move swapout logic around v2 Christian König
2021-03-18 12:47 ` [PATCH 3/3] drm/ttm: switch to per device LRU lock Christian König
2021-03-19 4:32 ` Huang Rui
2021-03-19 12:10 ` Christian König
2021-03-22 7:13 ` Huang Rui
2021-03-15 16:04 [PATCH 1/3] drm/ttm: move swapout logic around Christian König
2021-03-15 16:04 ` [PATCH 3/3] drm/ttm: switch to per device LRU lock Christian König
2021-03-15 20:17 ` kernel test robot
2021-03-15 20:17 ` kernel test robot
2021-03-16 9:35 ` Daniel Vetter
2021-03-16 12:03 ` Christian König
2021-03-16 12:05 ` Daniel Vetter
2021-03-16 15:13 ` Christian König
2021-02-11 13:29 [PATCH 1/3] drm/ttm: move swapout logic around Christian König
2021-02-11 13:29 ` [PATCH 3/3] drm/ttm: switch to per device LRU lock Christian König
2021-02-10 15:21 [PATCH 1/3] drm/ttm: move swapout logic around Christian König
2021-02-10 15:21 ` [PATCH 3/3] drm/ttm: switch to per device LRU lock Christian König
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=202102110704.2t6rt7Tj-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.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.