From: kernel test robot <lkp@intel.com>
To: Yu Kuai <yukuai1@huaweicloud.com>,
tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk,
yukuai3@huawei.com, mkoutny@suse.com
Cc: oe-kbuild-all@lists.linux.dev, cgroups@vger.kernel.org,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
yukuai1@huaweicloud.com, yi.zhang@huawei.com,
yangerkun@huawei.com
Subject: Re: [PATCH -next 3/4] blk-throttle: use calculate_io/bytes_allowed() for throtl_trim_slice()
Date: Tue, 15 Aug 2023 23:48:06 +0800 [thread overview]
Message-ID: <202308152351.JdDlpV4Q-lkp@intel.com> (raw)
In-Reply-To: <20230815014123.368929-4-yukuai1@huaweicloud.com>
Hi Yu,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20230809]
url: https://github.com/intel-lab-lkp/linux/commits/Yu-Kuai/blk-throttle-print-signed-value-carryover_bytes-ios-for-user/20230815-095025
base: next-20230809
patch link: https://lore.kernel.org/r/20230815014123.368929-4-yukuai1%40huaweicloud.com
patch subject: [PATCH -next 3/4] blk-throttle: use calculate_io/bytes_allowed() for throtl_trim_slice()
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230815/202308152351.JdDlpV4Q-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230815/202308152351.JdDlpV4Q-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/202308152351.JdDlpV4Q-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from block/blk-throttle.c:12:
block/blk-throttle.c: In function 'throtl_trim_slice':
>> block/blk-throttle.c:780:44: error: 'nr_slices' undeclared (first use in this function)
780 | rw == READ ? 'R' : 'W', nr_slices, bytes_trim, io_trim,
| ^~~~~~~~~
include/linux/blktrace_api.h:56:66: note: in definition of macro 'blk_add_cgroup_trace_msg'
56 | __blk_trace_note_message(bt, css, fmt, ##__VA_ARGS__);\
| ^~~~~~~~~~~
block/blk-throttle.c:778:9: note: in expansion of macro 'throtl_log'
778 | throtl_log(&tg->service_queue,
| ^~~~~~~~~~
block/blk-throttle.c:780:44: note: each undeclared identifier is reported only once for each function it appears in
780 | rw == READ ? 'R' : 'W', nr_slices, bytes_trim, io_trim,
| ^~~~~~~~~
include/linux/blktrace_api.h:56:66: note: in definition of macro 'blk_add_cgroup_trace_msg'
56 | __blk_trace_note_message(bt, css, fmt, ##__VA_ARGS__);\
| ^~~~~~~~~~~
block/blk-throttle.c:778:9: note: in expansion of macro 'throtl_log'
778 | throtl_log(&tg->service_queue,
| ^~~~~~~~~~
vim +/nr_slices +780 block/blk-throttle.c
1a46ae7773b475 Yu Kuai 2023-08-15 728
e43473b7f223ec Vivek Goyal 2010-09-15 729 /* Trim the used slices and adjust slice start accordingly */
0f3457f60edc57 Tejun Heo 2013-05-14 730 static inline void throtl_trim_slice(struct throtl_grp *tg, bool rw)
e43473b7f223ec Vivek Goyal 2010-09-15 731 {
1a46ae7773b475 Yu Kuai 2023-08-15 732 unsigned long time_elapsed, io_trim;
1a46ae7773b475 Yu Kuai 2023-08-15 733 u64 bytes_trim;
e43473b7f223ec Vivek Goyal 2010-09-15 734
e43473b7f223ec Vivek Goyal 2010-09-15 735 BUG_ON(time_before(tg->slice_end[rw], tg->slice_start[rw]));
e43473b7f223ec Vivek Goyal 2010-09-15 736
e43473b7f223ec Vivek Goyal 2010-09-15 737 /*
e43473b7f223ec Vivek Goyal 2010-09-15 738 * If bps are unlimited (-1), then time slice don't get
e43473b7f223ec Vivek Goyal 2010-09-15 739 * renewed. Don't try to trim the slice if slice is used. A new
e43473b7f223ec Vivek Goyal 2010-09-15 740 * slice will start when appropriate.
e43473b7f223ec Vivek Goyal 2010-09-15 741 */
0f3457f60edc57 Tejun Heo 2013-05-14 742 if (throtl_slice_used(tg, rw))
e43473b7f223ec Vivek Goyal 2010-09-15 743 return;
e43473b7f223ec Vivek Goyal 2010-09-15 744
d1ae8ffdfaa16b Vivek Goyal 2010-12-01 745 /*
d1ae8ffdfaa16b Vivek Goyal 2010-12-01 746 * A bio has been dispatched. Also adjust slice_end. It might happen
d1ae8ffdfaa16b Vivek Goyal 2010-12-01 747 * that initially cgroup limit was very low resulting in high
b53b072c4bb579 Baolin Wang 2020-09-07 748 * slice_end, but later limit was bumped up and bio was dispatched
d1ae8ffdfaa16b Vivek Goyal 2010-12-01 749 * sooner, then we need to reduce slice_end. A high bogus slice_end
d1ae8ffdfaa16b Vivek Goyal 2010-12-01 750 * is bad because it does not allow new slice to start.
d1ae8ffdfaa16b Vivek Goyal 2010-12-01 751 */
d1ae8ffdfaa16b Vivek Goyal 2010-12-01 752
297e3d85478482 Shaohua Li 2017-03-27 753 throtl_set_slice_end(tg, rw, jiffies + tg->td->throtl_slice);
d1ae8ffdfaa16b Vivek Goyal 2010-12-01 754
1a46ae7773b475 Yu Kuai 2023-08-15 755 time_elapsed = rounddown(jiffies - tg->slice_start[rw],
1a46ae7773b475 Yu Kuai 2023-08-15 756 tg->td->throtl_slice);
1a46ae7773b475 Yu Kuai 2023-08-15 757 if (!time_elapsed)
e43473b7f223ec Vivek Goyal 2010-09-15 758 return;
e43473b7f223ec Vivek Goyal 2010-09-15 759
1a46ae7773b475 Yu Kuai 2023-08-15 760 bytes_trim = calculate_bytes_allowed(tg_bps_limit(tg, rw),
1a46ae7773b475 Yu Kuai 2023-08-15 761 time_elapsed);
1a46ae7773b475 Yu Kuai 2023-08-15 762 io_trim = calculate_io_allowed(tg_iops_limit(tg, rw), time_elapsed);
8e89d13f4ede24 Vivek Goyal 2010-09-15 763 if (!bytes_trim && !io_trim)
e43473b7f223ec Vivek Goyal 2010-09-15 764 return;
e43473b7f223ec Vivek Goyal 2010-09-15 765
e43473b7f223ec Vivek Goyal 2010-09-15 766 if (tg->bytes_disp[rw] >= bytes_trim)
e43473b7f223ec Vivek Goyal 2010-09-15 767 tg->bytes_disp[rw] -= bytes_trim;
e43473b7f223ec Vivek Goyal 2010-09-15 768 else
e43473b7f223ec Vivek Goyal 2010-09-15 769 tg->bytes_disp[rw] = 0;
e43473b7f223ec Vivek Goyal 2010-09-15 770
8e89d13f4ede24 Vivek Goyal 2010-09-15 771 if (tg->io_disp[rw] >= io_trim)
8e89d13f4ede24 Vivek Goyal 2010-09-15 772 tg->io_disp[rw] -= io_trim;
8e89d13f4ede24 Vivek Goyal 2010-09-15 773 else
8e89d13f4ede24 Vivek Goyal 2010-09-15 774 tg->io_disp[rw] = 0;
8e89d13f4ede24 Vivek Goyal 2010-09-15 775
1a46ae7773b475 Yu Kuai 2023-08-15 776 tg->slice_start[rw] += time_elapsed;
e43473b7f223ec Vivek Goyal 2010-09-15 777
fda6f272c77a7a Tejun Heo 2013-05-14 778 throtl_log(&tg->service_queue,
fda6f272c77a7a Tejun Heo 2013-05-14 779 "[%c] trim slice nr=%lu bytes=%llu io=%lu start=%lu end=%lu jiffies=%lu",
8e89d13f4ede24 Vivek Goyal 2010-09-15 @780 rw == READ ? 'R' : 'W', nr_slices, bytes_trim, io_trim,
e43473b7f223ec Vivek Goyal 2010-09-15 781 tg->slice_start[rw], tg->slice_end[rw], jiffies);
e43473b7f223ec Vivek Goyal 2010-09-15 782 }
e43473b7f223ec Vivek Goyal 2010-09-15 783
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2023-08-15 15:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 1:41 [PATCH -next 0/4] cleanup and fixes for 'carryover_ios/bytes' Yu Kuai
2023-08-15 1:41 ` [PATCH -next 1/4] blk-throttle: print signed value 'carryover_bytes/ios' for user Yu Kuai
2023-08-15 1:41 ` [PATCH -next 2/4] blk-throttle: fix wrong comparation while 'carryover_ios/bytes' is negative Yu Kuai
2023-08-15 1:41 ` [PATCH -next 3/4] blk-throttle: use calculate_io/bytes_allowed() for throtl_trim_slice() Yu Kuai
2023-08-15 15:48 ` kernel test robot [this message]
2023-08-15 1:41 ` [PATCH -next 4/4] blk-throttle: consider 'carryover_ios/bytes' in throtl_trim_slice() Yu Kuai
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=202308152351.JdDlpV4Q-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkoutny@suse.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tj@kernel.org \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@huawei.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
Powered by JetHome