Linux bcache driver list
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Qiliang Yuan <realwujing@gmail.com>, Coly Li <colyli@fygo.io>,
	Kent Overstreet <kent.overstreet@linux.dev>
Cc: oe-kbuild-all@lists.linux.dev, linux-bcache@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Qiliang Yuan <yuanql9@chinatelecom.cn>,
	Jing Wu <realwujing@gmail.com>
Subject: Re: [PATCH RESEND v2] bcache: convert bch_register_lock to rw_semaphore
Date: Tue, 7 Jul 2026 16:29:42 +0800	[thread overview]
Message-ID: <202607071617.e4elNFQN-lkp@intel.com> (raw)
In-Reply-To: <20260706-feat-bcache-v2-1-70a4b6e246c0@gmail.com>

Hi Qiliang,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 502d801f0ab03e4f32f9a33d203154ce84887921]

url:    https://github.com/intel-lab-lkp/linux/commits/Qiliang-Yuan/bcache-convert-bch_register_lock-to-rw_semaphore/20260706-212031
base:   502d801f0ab03e4f32f9a33d203154ce84887921
patch link:    https://lore.kernel.org/r/20260706-feat-bcache-v2-1-70a4b6e246c0%40gmail.com
patch subject: [PATCH RESEND v2] bcache: convert bch_register_lock to rw_semaphore
config: arc-allmodconfig (https://download.01.org/0day-ci/archive/20260707/202607071617.e4elNFQN-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260707/202607071617.e4elNFQN-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607071617.e4elNFQN-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/md/bcache/sysfs.c: In function 'bch_cached_dev_show':
>> drivers/md/bcache/sysfs.c:290:28: warning: unused variable 'dc' [-Wunused-variable]
     290 |         struct cached_dev *dc = container_of(kobj, struct cached_dev,
         |                            ^~


vim +/dc +290 drivers/md/bcache/sysfs.c

   178	
   179		if (attr == &sysfs_cache_mode)
   180			return bch_snprint_string_list(buf, PAGE_SIZE,
   181						       bch_cache_modes,
   182						       BDEV_CACHE_MODE(&dc->sb));
   183	
   184		if (attr == &sysfs_readahead_cache_policy)
   185			return bch_snprint_string_list(buf, PAGE_SIZE,
   186						      bch_reada_cache_policies,
   187						      dc->cache_readahead_policy);
   188	
   189		if (attr == &sysfs_stop_when_cache_set_failed)
   190			return bch_snprint_string_list(buf, PAGE_SIZE,
   191						       bch_stop_on_failure_modes,
   192						       dc->stop_when_cache_set_failed);
   193	
   194	
   195		sysfs_printf(data_csum,		"%i", dc->disk.data_csum);
   196		var_printf(verify,		"%i");
   197		var_printf(bypass_torture_test,	"%i");
   198		var_printf(writeback_metadata,	"%i");
   199		var_printf(writeback_running,	"%i");
   200		var_printf(writeback_consider_fragment,	"%i");
   201		var_print(writeback_delay);
   202		var_print(writeback_percent);
   203		sysfs_hprint(writeback_rate,
   204			     wb ? atomic_long_read(&dc->writeback_rate.rate) << 9 : 0);
   205		sysfs_printf(io_errors,		"%i", atomic_read(&dc->io_errors));
   206		sysfs_printf(io_error_limit,	"%i", dc->error_limit);
   207		sysfs_printf(io_disable,	"%i", dc->io_disable);
   208		var_print(writeback_rate_update_seconds);
   209		var_print(writeback_rate_i_term_inverse);
   210		var_print(writeback_rate_p_term_inverse);
   211		var_print(writeback_rate_fp_term_low);
   212		var_print(writeback_rate_fp_term_mid);
   213		var_print(writeback_rate_fp_term_high);
   214		var_print(writeback_rate_minimum);
   215	
   216		if (attr == &sysfs_writeback_rate_debug) {
   217			char rate[20];
   218			char dirty[20];
   219			char target[20];
   220			char proportional[20];
   221			char integral[20];
   222			char change[20];
   223			s64 next_io;
   224	
   225			/*
   226			 * Except for dirty and target, other values should
   227			 * be 0 if writeback is not running.
   228			 */
   229			bch_hprint(rate,
   230				   wb ? atomic_long_read(&dc->writeback_rate.rate) << 9
   231				      : 0);
   232			bch_hprint(dirty, bcache_dev_sectors_dirty(&dc->disk) << 9);
   233			bch_hprint(target, dc->writeback_rate_target << 9);
   234			bch_hprint(proportional,
   235				   wb ? dc->writeback_rate_proportional << 9 : 0);
   236			bch_hprint(integral,
   237				   wb ? dc->writeback_rate_integral_scaled << 9 : 0);
   238			bch_hprint(change, wb ? dc->writeback_rate_change << 9 : 0);
   239			next_io = wb ? div64_s64(dc->writeback_rate.next-local_clock(),
   240						 NSEC_PER_MSEC) : 0;
   241	
   242			return sprintf(buf,
   243				       "rate:\t\t%s/sec\n"
   244				       "dirty:\t\t%s\n"
   245				       "target:\t\t%s\n"
   246				       "proportional:\t%s\n"
   247				       "integral:\t%s\n"
   248				       "change:\t\t%s/sec\n"
   249				       "next io:\t%llims\n",
   250				       rate, dirty, target, proportional,
   251				       integral, change, next_io);
   252		}
   253	
   254		sysfs_hprint(dirty_data,
   255			     bcache_dev_sectors_dirty(&dc->disk) << 9);
   256	
   257		sysfs_hprint(stripe_size,	 ((uint64_t)dc->disk.stripe_size) << 9);
   258		var_printf(partial_stripes_expensive,	"%u");
   259	
   260		var_hprint(sequential_cutoff);
   261	
   262		sysfs_print(running,		atomic_read(&dc->running));
   263		sysfs_print(state,		states[BDEV_STATE(&dc->sb)]);
   264	
   265		if (attr == &sysfs_label) {
   266			memcpy(buf, dc->sb.label, SB_LABEL_SIZE);
   267			buf[SB_LABEL_SIZE + 1] = '\0';
   268			strcat(buf, "\n");
   269			return strlen(buf);
   270		}
   271	
   272		if (attr == &sysfs_backing_dev_name) {
   273			snprintf(buf, BDEVNAME_SIZE + 1, "%pg", dc->bdev);
   274			strcat(buf, "\n");
   275			return strlen(buf);
   276		}
   277	
   278		if (attr == &sysfs_backing_dev_uuid) {
   279			/* convert binary uuid into 36-byte string plus '\0' */
   280			snprintf(buf, 36+1, "%pU", dc->sb.uuid);
   281			strcat(buf, "\n");
   282			return strlen(buf);
   283		}
   284	
   285	#undef var
   286		return 0;
   287	}
   288	SHOW(bch_cached_dev)
   289	{
 > 290		struct cached_dev *dc = container_of(kobj, struct cached_dev,
   291						     disk.kobj);
   292		ssize_t ret;
   293	
   294		/*
   295		 * Statistics attributes like dirty_data read atomic variables and
   296		 * can be shown without holding the global bch_register_lock.
   297		 */
   298		if (attr == &sysfs_dirty_data ||
   299		    attr == &sysfs_writeback_rate_debug)
   300			return __bch_cached_dev_show(kobj, attr, buf);
   301	
   302		down_read(&bch_register_lock);
   303		ret = __bch_cached_dev_show(kobj, attr, buf);
   304		up_read(&bch_register_lock);
   305	
   306		return ret;
   307	}
   308	

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

      reply	other threads:[~2026-07-07  8:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 13:04 [PATCH RESEND v2] bcache: convert bch_register_lock to rw_semaphore Qiliang Yuan
2026-07-07  8:29 ` kernel test robot [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=202607071617.e4elNFQN-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=colyli@fygo.io \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=realwujing@gmail.com \
    --cc=yuanql9@chinatelecom.cn \
    /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