Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, xinhui pan <xinhui.pan@amd.com>,
	amd-gfx@lists.freedesktop.org
Cc: arunpravin.paneerselvam@amd.com, intel-gfx@lists.freedesktop.org,
	xinhui pan <xinhui.pan@amd.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	matthew.auld@intel.com, daniel@ffwll.ch,
	oe-kbuild-all@lists.linux.dev, christian.koenig@amd.com
Subject: Re: [Intel-gfx] [PATCH v6] drm: Optimise for continuous memory allocation
Date: Thu, 22 Dec 2022 21:53:20 +0300	[thread overview]
Message-ID: <202212222042.6Dhv6XWG-lkp@intel.com> (raw)
In-Reply-To: <20221218065708.93332-1-xinhui.pan@amd.com>

Hi xinhui,

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/xinhui-pan/drm-Optimise-for-continuous-memory-allocation/20221218-145922
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:    https://lore.kernel.org/r/20221218065708.93332-1-xinhui.pan%40amd.com
patch subject: [PATCH v6] drm: Optimise for continuous memory allocation
config: s390-randconfig-m041-20221218
compiler: s390-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>

smatch warnings:
drivers/gpu/drm/drm_buddy.c:501 find_continuous_blocks() error: uninitialized symbol 'block'.

vim +/block +501 drivers/gpu/drm/drm_buddy.c

8a257b57bc11a2 xinhui pan 2022-12-18  472  static struct drm_buddy_block *
8a257b57bc11a2 xinhui pan 2022-12-18  473  find_continuous_blocks(struct drm_buddy *mm,
8a257b57bc11a2 xinhui pan 2022-12-18  474  		       int order,
8a257b57bc11a2 xinhui pan 2022-12-18  475  		       unsigned long flags,
8a257b57bc11a2 xinhui pan 2022-12-18  476  		       struct drm_buddy_block **lb)
8a257b57bc11a2 xinhui pan 2022-12-18  477  {
8a257b57bc11a2 xinhui pan 2022-12-18  478  	struct list_head *head = &mm->free_list[order - 1];
8a257b57bc11a2 xinhui pan 2022-12-18  479  	struct drm_buddy_block *free_block, *first = NULL, *last = NULL;
8a257b57bc11a2 xinhui pan 2022-12-18  480  
8a257b57bc11a2 xinhui pan 2022-12-18  481  	/*
8a257b57bc11a2 xinhui pan 2022-12-18  482  	 * Look for continuous free memory in buddy and buddy-in-law.
8a257b57bc11a2 xinhui pan 2022-12-18  483  	 * IOW, the most left blocks at right of free block and the most right
8a257b57bc11a2 xinhui pan 2022-12-18  484  	 * blocks at left of free block.
8a257b57bc11a2 xinhui pan 2022-12-18  485  	 */
8a257b57bc11a2 xinhui pan 2022-12-18  486  
8a257b57bc11a2 xinhui pan 2022-12-18  487  	list_for_each_entry(free_block, head, link) {
8a257b57bc11a2 xinhui pan 2022-12-18  488  		struct drm_buddy_block *buddy, *parent, *block;
8a257b57bc11a2 xinhui pan 2022-12-18  489  		int left, min_order = 0;
8a257b57bc11a2 xinhui pan 2022-12-18  490  		LIST_HEAD(fbl);
8a257b57bc11a2 xinhui pan 2022-12-18  491  
8a257b57bc11a2 xinhui pan 2022-12-18  492  		parent = free_block->parent;
8a257b57bc11a2 xinhui pan 2022-12-18  493  		if (!parent)
8a257b57bc11a2 xinhui pan 2022-12-18  494  			continue;
8a257b57bc11a2 xinhui pan 2022-12-18  495  
8a257b57bc11a2 xinhui pan 2022-12-18  496  		left = parent->left == free_block;
8a257b57bc11a2 xinhui pan 2022-12-18  497  		list_add(&free_block->tmp_link, &fbl);
8a257b57bc11a2 xinhui pan 2022-12-18  498  		buddy = __get_buddy(free_block);
8a257b57bc11a2 xinhui pan 2022-12-18  499  		__continuous_block_in_tree(buddy, &fbl, left, min_order);
8a257b57bc11a2 xinhui pan 2022-12-18  500  
8a257b57bc11a2 xinhui pan 2022-12-18 @501  		while (parent && !((parent->left == block) ^ left)) {
                                                                                            ^^^^^
Not initialized on first iteration.

8a257b57bc11a2 xinhui pan 2022-12-18  502  			block = parent;
8a257b57bc11a2 xinhui pan 2022-12-18  503  			parent = parent->parent;
8a257b57bc11a2 xinhui pan 2022-12-18  504  		}
8a257b57bc11a2 xinhui pan 2022-12-18  505  
8a257b57bc11a2 xinhui pan 2022-12-18  506  		if (!parent)
8a257b57bc11a2 xinhui pan 2022-12-18  507  			continue;
8a257b57bc11a2 xinhui pan 2022-12-18  508  
8a257b57bc11a2 xinhui pan 2022-12-18  509  		buddy = __get_buddy(block);
8a257b57bc11a2 xinhui pan 2022-12-18  510  		__continuous_block_in_tree(buddy, &fbl, !left, min_order);
8a257b57bc11a2 xinhui pan 2022-12-18  511  
8a257b57bc11a2 xinhui pan 2022-12-18  512  		/* list head of fbl is invalid outside.
8a257b57bc11a2 xinhui pan 2022-12-18  513  		 * Walk through list from first fo last only.
8a257b57bc11a2 xinhui pan 2022-12-18  514  		 */
8a257b57bc11a2 xinhui pan 2022-12-18  515  		if (__free_block_in_order(&fbl, free_block, order, &first, &last))
8a257b57bc11a2 xinhui pan 2022-12-18  516  			break;
8a257b57bc11a2 xinhui pan 2022-12-18  517  	}
8a257b57bc11a2 xinhui pan 2022-12-18  518  
8a257b57bc11a2 xinhui pan 2022-12-18  519  	*lb = last;
8a257b57bc11a2 xinhui pan 2022-12-18  520  	return first;
8a257b57bc11a2 xinhui pan 2022-12-18  521  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


      parent reply	other threads:[~2022-12-27 16:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-18  6:57 [Intel-gfx] [PATCH v6] drm: Optimise for continuous memory allocation xinhui pan
2022-12-19  0:13 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm: Optimise for continuous memory allocation (rev4) Patchwork
2022-12-19  0:40 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-12-19  2:58 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-12-19  8:37 ` [Intel-gfx] [PATCH v6] drm: Optimise for continuous memory allocation Christian König
2022-12-22 18:53 ` Dan Carpenter [this message]

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=202212222042.6Dhv6XWG-lkp@intel.com \
    --to=error27@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arunpravin.paneerselvam@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.auld@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=xinhui.pan@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox