All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: Re: [PATCH v4 4/4] drm/ttm: Allow continued swapout after -ENOSPC falure
Date: Wed, 13 Mar 2024 02:55:29 +0800	[thread overview]
Message-ID: <202403130229.ada3fBTp-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20240306070125.27071-5-thomas.hellstrom@linux.intel.com>
References: <20240306070125.27071-5-thomas.hellstrom@linux.intel.com>
TO: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
TO: intel-xe@lists.freedesktop.org
TO: intel-gfx@lists.freedesktop.org
CC: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
CC: "Christian König" <christian.koenig@amd.com>
CC: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>
CC: dri-devel@lists.freedesktop.org

Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on drm-intel/for-linux-next]
[cannot apply to drm-intel/for-linux-next-fixes drm-tip/drm-tip linus/master v6.8 next-20240312]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Hellstr-m/drm-ttm-Allow-TTM-LRU-list-nodes-of-different-types/20240306-150355
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:    https://lore.kernel.org/r/20240306070125.27071-5-thomas.hellstrom%40linux.intel.com
patch subject: [PATCH v4 4/4] drm/ttm: Allow continued swapout after -ENOSPC falure
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago
config: x86_64-randconfig-r051-20240312 (https://download.01.org/0day-ci/archive/20240313/202403130229.ada3fBTp-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202403130229.ada3fBTp-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/ttm/ttm_device.c:156:1-10: second lock on line 176
   drivers/gpu/drm/ttm/ttm_device.c:176:4-13: second lock on line 176

vim +156 drivers/gpu/drm/ttm/ttm_device.c

f9e2a03e110ad0 Christian König  2020-10-06  146  
f9e2a03e110ad0 Christian König  2020-10-06  147  int ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,
f9e2a03e110ad0 Christian König  2020-10-06  148  		       gfp_t gfp_flags)
f9e2a03e110ad0 Christian König  2020-10-06  149  {
5d05b988f1c0fd Christian König  2021-06-08  150  	struct ttm_resource_cursor cursor;
f9e2a03e110ad0 Christian König  2020-10-06  151  	struct ttm_resource_manager *man;
6a9b028994025f Christian König  2021-07-16  152  	struct ttm_resource *res;
5d05b988f1c0fd Christian König  2021-06-08  153  	unsigned i;
ebd59851c796c2 Christian König  2020-10-06  154  	int ret;
ebd59851c796c2 Christian König  2020-10-06  155  
a1f091f8ef2b68 Christian König  2020-10-06 @156  	spin_lock(&bdev->lru_lock);
f9e2a03e110ad0 Christian König  2020-10-06  157  	for (i = TTM_PL_SYSTEM; i < TTM_NUM_MEM_TYPES; ++i) {
f9e2a03e110ad0 Christian König  2020-10-06  158  		man = ttm_manager_type(bdev, i);
f9e2a03e110ad0 Christian König  2020-10-06  159  		if (!man || !man->use_tt)
f9e2a03e110ad0 Christian König  2020-10-06  160  			continue;
f9e2a03e110ad0 Christian König  2020-10-06  161  
5d05b988f1c0fd Christian König  2021-06-08  162  		ttm_resource_manager_for_each_res(man, &cursor, res) {
5d05b988f1c0fd Christian König  2021-06-08  163  			struct ttm_buffer_object *bo = res->bo;
81b0d0e4f81155 Christian König  2022-06-03  164  			uint32_t num_pages;
ebd59851c796c2 Christian König  2020-10-06  165  
9a9a8fe2675133 Thomas Hellström 2023-03-07  166  			if (!bo || bo->resource != res)
81b0d0e4f81155 Christian König  2022-06-03  167  				continue;
81b0d0e4f81155 Christian König  2022-06-03  168  
81b0d0e4f81155 Christian König  2022-06-03  169  			num_pages = PFN_UP(bo->base.size);
ebd59851c796c2 Christian König  2020-10-06  170  			ret = ttm_bo_swapout(bo, ctx, gfp_flags);
14fb6041b4dee4 Thomas Hellström 2024-03-06  171  			/* Couldn't swap out, and retained the lru_lock */
14fb6041b4dee4 Thomas Hellström 2024-03-06  172  			if (ret == -EBUSY)
14fb6041b4dee4 Thomas Hellström 2024-03-06  173  				continue;
14fb6041b4dee4 Thomas Hellström 2024-03-06  174  			/* Couldn't swap out and dropped the lru_lock */
14fb6041b4dee4 Thomas Hellström 2024-03-06  175  			if (ret == -ENOSPC) {
14fb6041b4dee4 Thomas Hellström 2024-03-06 @176  				spin_lock(&bdev->lru_lock);
14fb6041b4dee4 Thomas Hellström 2024-03-06  177  				continue;
cd259b6156f7e7 Thomas Hellström 2024-03-06  178  			}
14fb6041b4dee4 Thomas Hellström 2024-03-06  179  			/*
14fb6041b4dee4 Thomas Hellström 2024-03-06  180  			 * Dropped the lock and either succeeded or
14fb6041b4dee4 Thomas Hellström 2024-03-06  181  			 * hit an error that forces us to break.
14fb6041b4dee4 Thomas Hellström 2024-03-06  182  			 */
cd259b6156f7e7 Thomas Hellström 2024-03-06  183  			ttm_resource_cursor_fini(&cursor);
14fb6041b4dee4 Thomas Hellström 2024-03-06  184  			return ret ? ret : num_pages;
ebd59851c796c2 Christian König  2020-10-06  185  		}
cd259b6156f7e7 Thomas Hellström 2024-03-06  186  	}
cd259b6156f7e7 Thomas Hellström 2024-03-06  187  	ttm_resource_cursor_fini_locked(&cursor);
a1f091f8ef2b68 Christian König  2020-10-06  188  	spin_unlock(&bdev->lru_lock);
ebd59851c796c2 Christian König  2020-10-06  189  	return 0;
ebd59851c796c2 Christian König  2020-10-06  190  }
f9e2a03e110ad0 Christian König  2020-10-06  191  EXPORT_SYMBOL(ttm_device_swapout);
ebd59851c796c2 Christian König  2020-10-06  192  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2024-03-12 18:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 18:55 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-06  7:01 [PATCH v4 0/4] TTM unlockable restartable LRU list iteration Thomas Hellström
2024-03-06  7:01 ` [PATCH v4 4/4] drm/ttm: Allow continued swapout after -ENOSPC falure Thomas Hellström

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=202403130229.ada3fBTp-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=julia.lawall@inria.fr \
    --cc=oe-kbuild@lists.linux.dev \
    /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.