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, Dan Carpenter <error27@gmail.com>
Subject: [linyunsheng:page_frag_cache_v5 14/14] mm/page_frag_cache.c:291 __page_frag_alloc_va_align() error: uninitialized symbol 'remaining'.
Date: Sun, 19 May 2024 02:41:52 +0800	[thread overview]
Message-ID: <202405190246.CAWMWHpE-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Yunsheng Lin <linyunsheng@huawei.com>

tree:   https://github.com/gestionlin/linux.git page_frag_cache_v5
head:   e6543161a8d13e28e244803a755a007021b9dea7
commit: e6543161a8d13e28e244803a755a007021b9dea7 [14/14] add alloc_pg api and refactor alloc_va api
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: i386-randconfig-141-20240518 (https://download.01.org/0day-ci/archive/20240519/202405190246.CAWMWHpE-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)

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: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202405190246.CAWMWHpE-lkp@intel.com/

smatch warnings:
mm/page_frag_cache.c:291 __page_frag_alloc_va_align() error: uninitialized symbol 'remaining'.

vim +/remaining +291 mm/page_frag_cache.c

8b045aa063651c Yunsheng Lin 2024-05-15  269  
616ae9b1b510e1 Yunsheng Lin 2024-05-15  270  /**
616ae9b1b510e1 Yunsheng Lin 2024-05-15  271   * __page_frag_alloc_va_align() - Alloc a page fragment with aligning
616ae9b1b510e1 Yunsheng Lin 2024-05-15  272   * requirement.
616ae9b1b510e1 Yunsheng Lin 2024-05-15  273   * @nc: page_frag cache from which to allocate
616ae9b1b510e1 Yunsheng Lin 2024-05-15  274   * @fragsz: the requested fragment size
616ae9b1b510e1 Yunsheng Lin 2024-05-15  275   * @gfp_mask: the allocation gfp to use when cache need to be refilled
616ae9b1b510e1 Yunsheng Lin 2024-05-15  276   * @align_mask: the requested aligning requirement for the 'va'
616ae9b1b510e1 Yunsheng Lin 2024-05-15  277   *
616ae9b1b510e1 Yunsheng Lin 2024-05-15  278   * Get a page fragment from page_frag cache with aligning requirement.
616ae9b1b510e1 Yunsheng Lin 2024-05-15  279   *
616ae9b1b510e1 Yunsheng Lin 2024-05-15  280   * Return:
616ae9b1b510e1 Yunsheng Lin 2024-05-15  281   * Return va of the page fragment, otherwise return NULL.
616ae9b1b510e1 Yunsheng Lin 2024-05-15  282   */
3ba205fc955f3f Yunsheng Lin 2024-05-15  283  void *__page_frag_alloc_va_align(struct page_frag_cache *nc,
8b045aa063651c Yunsheng Lin 2024-05-15  284  				 unsigned int fragsz, gfp_t gfp_mask,
8b045aa063651c Yunsheng Lin 2024-05-15  285  				 unsigned int align_mask)
8b045aa063651c Yunsheng Lin 2024-05-15  286  {
96b2e1c760d339 Yunsheng Lin 2024-05-15  287  	struct encoded_va *encoded_va;
96b2e1c760d339 Yunsheng Lin 2024-05-15  288  	unsigned int remaining;
8b045aa063651c Yunsheng Lin 2024-05-15  289  	struct page *page;
8b045aa063651c Yunsheng Lin 2024-05-15  290  
e6543161a8d13e Yunsheng Lin 2024-05-18 @291  	if (unlikely(fragsz > remaining)) {
96b2e1c760d339 Yunsheng Lin 2024-05-15  292  		/* fragsz is not supposed to be bigger than PAGE_SIZE as we are
96b2e1c760d339 Yunsheng Lin 2024-05-15  293  		 * allowing order 3 page allocation to fail easily under low
96b2e1c760d339 Yunsheng Lin 2024-05-15  294  		 * memory condition.
96b2e1c760d339 Yunsheng Lin 2024-05-15  295  		 */
e6543161a8d13e Yunsheng Lin 2024-05-18  296  		if (WARN_ON_ONCE(fragsz > PAGE_SIZE) ||
e6543161a8d13e Yunsheng Lin 2024-05-18  297  		    unlikely(!page_frag_cache_refill(nc, gfp_mask)))
96b2e1c760d339 Yunsheng Lin 2024-05-15  298  			return NULL;
8b045aa063651c Yunsheng Lin 2024-05-15  299  	}
8b045aa063651c Yunsheng Lin 2024-05-15  300  
e6543161a8d13e Yunsheng Lin 2024-05-18  301  	encoded_va = nc->encoded_va;
96b2e1c760d339 Yunsheng Lin 2024-05-15  302  	remaining = nc->remaining & align_mask;
96b2e1c760d339 Yunsheng Lin 2024-05-15  303  	nc->remaining = remaining - fragsz;
8b045aa063651c Yunsheng Lin 2024-05-15  304  	nc->pagecnt_bias--;
8b045aa063651c Yunsheng Lin 2024-05-15  305  
96b2e1c760d339 Yunsheng Lin 2024-05-15  306  	return encoded_page_address(encoded_va) +
96b2e1c760d339 Yunsheng Lin 2024-05-15  307  		__page_frag_cache_page_offset(encoded_va, remaining);
8b045aa063651c Yunsheng Lin 2024-05-15  308  }
3ba205fc955f3f Yunsheng Lin 2024-05-15  309  EXPORT_SYMBOL(__page_frag_alloc_va_align);
8b045aa063651c Yunsheng Lin 2024-05-15  310  

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

                 reply	other threads:[~2024-05-18 18:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202405190246.CAWMWHpE-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --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.