Re: [PATCH 2/3] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM
by kernel test robot
Hi Keqian,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on vfio/next]
[also build test ERROR on linux/master linus/master v5.12-rc7 next-20210413]
[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]
url: https://github.com/0day-ci/linux/commits/Keqian-Zhu/vfio-iommu_type1-Impl...
base: https://github.com/awilliam/linux-vfio.git next
config: arm-randconfig-r015-20210413 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/5553c39f302409e175a70157c47679e61...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Keqian-Zhu/vfio-iommu_type1-Implement-dirty-log-tracking-based-on-IOMMU-HWDBM/20210413-171632
git checkout 5553c39f302409e175a70157c47679e61297dec5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/vfio/vfio_iommu_type1.c: In function 'vfio_iommu_dirty_log_clear':
>> drivers/vfio/vfio_iommu_type1.c:1215:9: error: implicit declaration of function 'iommu_clear_dirty_log' [-Werror=implicit-function-declaration]
1215 | ret = iommu_clear_dirty_log(d->domain, start_iova, size,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c: In function 'vfio_iommu_dirty_log_sync':
>> drivers/vfio/vfio_iommu_type1.c:1234:9: error: implicit declaration of function 'iommu_sync_dirty_log' [-Werror=implicit-function-declaration]
1234 | ret = iommu_sync_dirty_log(d->domain, dma->iova, dma->size,
| ^~~~~~~~~~~~~~~~~~~~
In file included from arch/arm/include/asm/bug.h:60,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/preempt.h:5,
from ./arch/arm/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/ipc.h:5,
from include/uapi/linux/sem.h:5,
from include/linux/sem.h:5,
from include/linux/compat.h:14,
from drivers/vfio/vfio_iommu_type1.c:24:
drivers/vfio/vfio_iommu_type1.c: In function 'vfio_dma_dirty_log_switch':
>> drivers/vfio/vfio_iommu_type1.c:1373:11: error: implicit declaration of function 'iommu_switch_dirty_log' [-Werror=implicit-function-declaration]
1373 | WARN_ON(iommu_switch_dirty_log(d->domain, enable, dma->iova,
| ^~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/bug.h:188:25: note: in definition of macro 'WARN_ON'
188 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
drivers/vfio/vfio_iommu_type1.c: In function 'vfio_group_supports_hwdbm':
drivers/vfio/vfio_iommu_type1.c:2360:33: error: 'IOMMU_DEV_FEAT_HWDBM' undeclared (first use in this function); did you mean 'IOMMU_DEV_FEAT_SVA'?
2360 | enum iommu_dev_features feat = IOMMU_DEV_FEAT_HWDBM;
| ^~~~~~~~~~~~~~~~~~~~
| IOMMU_DEV_FEAT_SVA
drivers/vfio/vfio_iommu_type1.c:2360:33: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
vim +/iommu_clear_dirty_log +1215 drivers/vfio/vfio_iommu_type1.c
1204
1205 static int vfio_iommu_dirty_log_clear(struct vfio_iommu *iommu,
1206 dma_addr_t start_iova, size_t size,
1207 unsigned long *bitmap_buffer,
1208 dma_addr_t base_iova,
1209 unsigned long pgshift)
1210 {
1211 struct vfio_domain *d;
1212 int ret = 0;
1213
1214 list_for_each_entry(d, &iommu->domain_list, next) {
> 1215 ret = iommu_clear_dirty_log(d->domain, start_iova, size,
1216 bitmap_buffer, base_iova, pgshift);
1217 if (ret) {
1218 pr_warn("vfio_iommu dirty log clear failed!\n");
1219 break;
1220 }
1221 }
1222
1223 return ret;
1224 }
1225
1226 static int vfio_iommu_dirty_log_sync(struct vfio_iommu *iommu,
1227 struct vfio_dma *dma,
1228 unsigned long pgshift)
1229 {
1230 struct vfio_domain *d;
1231 int ret = 0;
1232
1233 list_for_each_entry(d, &iommu->domain_list, next) {
> 1234 ret = iommu_sync_dirty_log(d->domain, dma->iova, dma->size,
1235 dma->bitmap, dma->iova, pgshift);
1236 if (ret) {
1237 pr_warn("vfio_iommu dirty log sync failed!\n");
1238 break;
1239 }
1240 }
1241
1242 return ret;
1243 }
1244
1245 static int update_user_bitmap(u64 __user *bitmap, struct vfio_iommu *iommu,
1246 struct vfio_dma *dma, dma_addr_t base_iova,
1247 size_t pgsize)
1248 {
1249 unsigned long pgshift = __ffs(pgsize);
1250 unsigned long nbits = dma->size >> pgshift;
1251 unsigned long bit_offset = (dma->iova - base_iova) >> pgshift;
1252 unsigned long copy_offset = bit_offset / BITS_PER_LONG;
1253 unsigned long shift = bit_offset % BITS_PER_LONG;
1254 unsigned long leftover;
1255 int ret;
1256
1257 if (!iommu->num_non_pinned_groups || !dma->iommu_mapped) {
1258 /* nothing to do */
1259 } else if (!iommu->num_non_hwdbm_groups) {
1260 /* try to get dirty log from IOMMU */
1261 ret = vfio_iommu_dirty_log_sync(iommu, dma, pgshift);
1262 if (ret)
1263 return ret;
1264 } else {
1265 /*
1266 * mark all pages dirty if any IOMMU capable device is not able
1267 * to report dirty pages and all pages are pinned and mapped.
1268 */
1269 bitmap_set(dma->bitmap, 0, nbits);
1270 }
1271
1272 if (shift) {
1273 bitmap_shift_left(dma->bitmap, dma->bitmap, shift,
1274 nbits + shift);
1275
1276 if (copy_from_user(&leftover,
1277 (void __user *)(bitmap + copy_offset),
1278 sizeof(leftover)))
1279 return -EFAULT;
1280
1281 bitmap_or(dma->bitmap, dma->bitmap, &leftover, shift);
1282 }
1283
1284 if (copy_to_user((void __user *)(bitmap + copy_offset), dma->bitmap,
1285 DIRTY_BITMAP_BYTES(nbits + shift)))
1286 return -EFAULT;
1287
1288 /* Recover the bitmap if it'll be used to clear hardware dirty log */
1289 if (shift && iommu->num_non_pinned_groups && dma->iommu_mapped &&
1290 !iommu->num_non_hwdbm_groups)
1291 bitmap_shift_right(dma->bitmap, dma->bitmap, shift,
1292 nbits + shift);
1293
1294 return 0;
1295 }
1296
1297 static int vfio_iova_dirty_bitmap(u64 __user *bitmap, struct vfio_iommu *iommu,
1298 dma_addr_t iova, size_t size, size_t pgsize)
1299 {
1300 struct vfio_dma *dma;
1301 struct rb_node *n;
1302 unsigned long pgshift = __ffs(pgsize);
1303 int ret;
1304
1305 /*
1306 * GET_BITMAP request must fully cover vfio_dma mappings. Multiple
1307 * vfio_dma mappings may be clubbed by specifying large ranges, but
1308 * there must not be any previous mappings bisected by the range.
1309 * An error will be returned if these conditions are not met.
1310 */
1311 dma = vfio_find_dma(iommu, iova, 1);
1312 if (dma && dma->iova != iova)
1313 return -EINVAL;
1314
1315 dma = vfio_find_dma(iommu, iova + size - 1, 0);
1316 if (dma && dma->iova + dma->size != iova + size)
1317 return -EINVAL;
1318
1319 for (n = rb_first(&iommu->dma_list); n; n = rb_next(n)) {
1320 struct vfio_dma *dma = rb_entry(n, struct vfio_dma, node);
1321
1322 if (dma->iova < iova)
1323 continue;
1324
1325 if (dma->iova > iova + size - 1)
1326 break;
1327
1328 ret = update_user_bitmap(bitmap, iommu, dma, iova, pgsize);
1329 if (ret)
1330 return ret;
1331
1332 /* Clear iommu dirty log to re-enable dirty log tracking */
1333 if (iommu->num_non_pinned_groups && dma->iommu_mapped &&
1334 !iommu->num_non_hwdbm_groups) {
1335 ret = vfio_iommu_dirty_log_clear(iommu, dma->iova,
1336 dma->size, dma->bitmap, dma->iova,
1337 pgshift);
1338 if (ret)
1339 return ret;
1340 }
1341
1342 /*
1343 * Re-populate bitmap to include all pinned pages which are
1344 * considered as dirty but exclude pages which are unpinned and
1345 * pages which are marked dirty by vfio_dma_rw()
1346 */
1347 bitmap_clear(dma->bitmap, 0, dma->size >> pgshift);
1348 vfio_dma_populate_bitmap(dma, pgsize);
1349 }
1350 return 0;
1351 }
1352
1353 static int verify_bitmap_size(uint64_t npages, uint64_t bitmap_size)
1354 {
1355 if (!npages || !bitmap_size || (bitmap_size > DIRTY_BITMAP_SIZE_MAX) ||
1356 (bitmap_size < DIRTY_BITMAP_BYTES(npages)))
1357 return -EINVAL;
1358
1359 return 0;
1360 }
1361
1362 static void vfio_dma_dirty_log_switch(struct vfio_iommu *iommu,
1363 struct vfio_dma *dma, bool enable)
1364 {
1365 struct vfio_domain *d;
1366
1367 if (!dma->iommu_mapped)
1368 return;
1369
1370 list_for_each_entry(d, &iommu->domain_list, next) {
1371 if (d->num_non_hwdbm_groups)
1372 continue;
> 1373 WARN_ON(iommu_switch_dirty_log(d->domain, enable, dma->iova,
1374 dma->size, d->prot | dma->prot));
1375 }
1376 }
1377
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
Re: [PATCH v1 2/4] i2c: mpc: Remove CONFIG_PM_SLEEP ifdeffery
by kernel test robot
Hi Andy,
I love your patch! Yet something to improve:
[auto build test ERROR on wsa/i2c/for-next]
[also build test ERROR on next-20210413]
[cannot apply to linux/master linus/master v5.12-rc7]
[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]
url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/i2c-mpc-Use-devm...
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: powerpc64-randconfig-r015-20210413 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9829f5e6b1bca9b61efc629770d28bb9014dec45)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://github.com/0day-ci/linux/commit/31fed803b49f17742a0bfa9fb3940b5bc...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andy-Shevchenko/i2c-mpc-Use-devm_clk_get_optional/20210413-223941
git checkout 31fed803b49f17742a0bfa9fb3940b5bc487e4dd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/i2c/busses/i2c-mpc.c:824:9: error: use of undeclared identifier 'MPC_I2C_PM_OPS'
.pm = MPC_I2C_PM_OPS,
^
1 error generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_SOC_MPC5200_AC97
Depends on SOUND && !UML && SND && SND_SOC && SND_POWERPC_SOC && PPC_MPC52xx && PPC_BESTCOMM
Selected by
- SND_MPC52xx_SOC_EFIKA && SOUND && !UML && SND && SND_SOC && SND_POWERPC_SOC && PPC_EFIKA
vim +/MPC_I2C_PM_OPS +824 drivers/i2c/busses/i2c-mpc.c
0d1cde235874b0 Jon Smirl 2008-06-30 816
8c86cb127b2b76 Kumar Gala 2005-07-27 817 /* Structure for a device driver */
1c48a5c93da631 Grant Likely 2011-02-17 818 static struct platform_driver mpc_i2c_driver = {
8c86cb127b2b76 Kumar Gala 2005-07-27 819 .probe = fsl_i2c_probe,
0b255e927d47b5 Bill Pemberton 2012-11-27 820 .remove = fsl_i2c_remove,
3ae5eaec1d2d9c Russell King 2005-11-09 821 .driver = {
0d1cde235874b0 Jon Smirl 2008-06-30 822 .name = DRV_NAME,
4018294b53d1da Grant Likely 2010-04-13 823 .of_match_table = mpc_i2c_of_match,
0a488c49eac0ad Jingoo Han 2013-07-15 @824 .pm = MPC_I2C_PM_OPS,
3ae5eaec1d2d9c Russell King 2005-11-09 825 },
8c86cb127b2b76 Kumar Gala 2005-07-27 826 };
8c86cb127b2b76 Kumar Gala 2005-07-27 827
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
Re: [PATCH 1/1] sched/fair:Reduce unnecessary check preempt in the sched tick
by kernel test robot
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on tip/sched/core]
[also build test WARNING on v5.12-rc7 next-20210413]
[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]
url: https://github.com/0day-ci/linux/commits/qianjun-kernel-gmail-com/sched-f...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 4aed8aa41524a1fc6439171881c2bb7ace197528
config: i386-randconfig-s001-20210413 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-280-g2cd6d34e-dirty
# https://github.com/0day-ci/linux/commit/dbe8fdaf74553572909be6f118565862c...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review qianjun-kernel-gmail-com/sched-fair-Reduce-unnecessary-check-preempt-in-the-sched-tick/20210413-212057
git checkout dbe8fdaf74553572909be6f118565862c4cdfac5
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
kernel/sched/fair.c:871:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sched_entity *se @@ got struct sched_entity [noderef] __rcu * @@
kernel/sched/fair.c:871:34: sparse: expected struct sched_entity *se
kernel/sched/fair.c:871:34: sparse: got struct sched_entity [noderef] __rcu *
>> kernel/sched/fair.c:4386:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *tsk @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:4386:37: sparse: expected struct task_struct *tsk
kernel/sched/fair.c:4386:37: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:7000:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:7000:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:7000:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:7251:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:7251:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:7251:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:5383:35: sparse: sparse: marked inline, but without a definition
kernel/sched/fair.c: note: in included file:
kernel/sched/sched.h:1887:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1887:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1887:9: sparse: struct task_struct *
kernel/sched/sched.h:1732:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1732:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1732:25: sparse: struct task_struct *
kernel/sched/sched.h:1732:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1732:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1732:25: sparse: struct task_struct *
vim +4386 kernel/sched/fair.c
4373
4374 /*
4375 * Preempt the current task with a newly woken task if needed:
4376 */
4377 static void
4378 check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
4379 {
4380 unsigned long ideal_runtime, delta_exec;
4381 struct sched_entity *se;
4382 struct rq *rq = rq_of(cfs_rq);
4383 s64 delta;
4384
4385 /* If the TIF_NEED_RESCHED has been set, it is no need to check again */
> 4386 if (test_tsk_need_resched(rq->curr))
4387 return;
4388
4389 ideal_runtime = sched_slice(cfs_rq, curr);
4390 delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
4391 if (delta_exec > ideal_runtime) {
4392 resched_curr(rq_of(cfs_rq));
4393 /*
4394 * The current task ran long enough, ensure it doesn't get
4395 * re-elected due to buddy favours.
4396 */
4397 clear_buddies(cfs_rq, curr);
4398 return;
4399 }
4400
4401 /*
4402 * Ensure that a task that missed wakeup preemption by a
4403 * narrow margin doesn't have to wait for a full slice.
4404 * This also mitigates buddy induced latencies under load.
4405 */
4406 if (delta_exec < sysctl_sched_min_granularity)
4407 return;
4408
4409 se = __pick_first_entity(cfs_rq);
4410 delta = curr->vruntime - se->vruntime;
4411
4412 if (delta < 0)
4413 return;
4414
4415 if (delta > ideal_runtime)
4416 resched_curr(rq_of(cfs_rq));
4417 }
4418
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[jolsa-perf:bpf/ftrace 3/7] kernel/bpf/syscall.c:2937:3: error: implicit declaration of function 'bpf_trace_run2'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/ftrace
head: 75bc48cb4414f68f3a427d021860af113920adfd
commit: a1f1f141147a15afbfcc897661c59e23285f941a [3/7] bpf: Add support to attach program to ftrace probe
config: powerpc64-randconfig-r016-20210413 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9829f5e6b1bca9b61efc629770d28bb9014dec45)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id...
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf bpf/ftrace
git checkout a1f1f141147a15afbfcc897661c59e23285f941a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> kernel/bpf/syscall.c:2937:3: error: implicit declaration of function 'bpf_trace_run2' [-Werror,-Wimplicit-function-declaration]
bpf_trace_run2(tr_link->link.prog, ip, parent_ip);
^
1 error generated.
vim +/bpf_trace_run2 +2937 kernel/bpf/syscall.c
2919
2920 static void
2921 bpf_ftrace_function_call(unsigned long ip, unsigned long parent_ip,
2922 struct ftrace_ops *ops, struct ftrace_regs *fregs)
2923 {
2924 struct bpf_tracing_ftrace_link *tr_link;
2925 struct bpf_prog *prog;
2926 u64 start;
2927
2928 tr_link = container_of(ops, struct bpf_tracing_ftrace_link, ops);
2929 prog = tr_link->link.prog;
2930
2931 if (prog->aux->sleepable)
2932 start = __bpf_prog_enter_sleepable(prog);
2933 else
2934 start = __bpf_prog_enter(prog);
2935
2936 if (start)
> 2937 bpf_trace_run2(tr_link->link.prog, ip, parent_ip);
2938
2939 if (prog->aux->sleepable)
2940 __bpf_prog_exit_sleepable(prog, start);
2941 else
2942 __bpf_prog_exit(prog, start);
2943 }
2944
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
Re: [PATCH v5 1/3] riscv: Move kernel mapping outside of linear mapping
by kernel test robot
In-Reply-To: <20210411164146.20232-2-alex(a)ghiti.fr>
References: <20210411164146.20232-2-alex(a)ghiti.fr>
TO: Alexandre Ghiti <alex(a)ghiti.fr>
TO: Jonathan Corbet <corbet(a)lwn.net>
TO: Paul Walmsley <paul.walmsley(a)sifive.com>
TO: Palmer Dabbelt <palmer(a)dabbelt.com>
TO: Albert Ou <aou(a)eecs.berkeley.edu>
TO: Arnd Bergmann <arnd(a)arndb.de>
TO: Andrey Ryabinin <aryabinin(a)virtuozzo.com>
TO: Alexander Potapenko <glider(a)google.com>
TO: Dmitry Vyukov <dvyukov(a)google.com>
TO: linux-doc(a)vger.kernel.org
TO: linux-riscv(a)lists.infradead.org
Hi Alexandre,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on lwn/docs-next]
[also build test ERROR on soc/for-next linus/master v5.12-rc7]
[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]
url: https://github.com/0day-ci/linux/commits/Alexandre-Ghiti/Move-kernel-mapp...
base: git://git.lwn.net/linux-2.6 docs-next
config: riscv-randconfig-r012-20210413 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9829f5e6b1bca9b61efc629770d28bb9014dec45)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/e63d2d35b5270033fc2942172f2cda857...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexandre-Ghiti/Move-kernel-mapping-outside-the-linear-mapping/20210412-004552
git checkout e63d2d35b5270033fc2942172f2cda85776c9081
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x8): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x3E): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x154): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x1152): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x1196): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x11B6): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
>> ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x11D0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/built-in.a(kernel/entry.o):(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/built-in.a(kernel/entry.o):(.text+0x24C): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/built-in.a(kernel/entry.o):(.text+0x25E): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/built-in.a(kernel/entry.o):(.text+0x274): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: signal.c:(.fixup+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: signal.c:(.fixup+0xE): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: signal.c:(.fixup+0x1C): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: signal.c:(.fixup+0x2A): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: signal.c:(.fixup+0x36): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: signal.c:(.fixup+0x42): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: signal.c:(.fixup+0x4E): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: signal.c:(.fixup+0x5A): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
fs/f2fs/gc.c:622:12: warning: stack frame size of 1616 bytes in function 'get_victim_by_default'
by kernel test robot
Hi Chao,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 89698becf06d341a700913c3d89ce2a914af69a2
commit: 093749e296e29a4b0162eb925a6701a01e8c9a98 f2fs: support age threshold based garbage collection
date: 7 months ago
config: powerpc64-randconfig-r014-20210413 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9829f5e6b1bca9b61efc629770d28bb9014dec45)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 093749e296e29a4b0162eb925a6701a01e8c9a98
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:187:1: note: expanded from here
__do_insw
^
arch/powerpc/include/asm/io.h:542:56: note: expanded from macro '__do_insw'
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from fs/f2fs/gc.c:10:
In file included from include/linux/backing-dev.h:15:
In file included from include/linux/blkdev.h:13:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:189:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:543:56: note: expanded from macro '__do_insl'
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from fs/f2fs/gc.c:10:
In file included from include/linux/backing-dev.h:15:
In file included from include/linux/blkdev.h:13:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:191:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:544:58: note: expanded from macro '__do_outsb'
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from fs/f2fs/gc.c:10:
In file included from include/linux/backing-dev.h:15:
In file included from include/linux/blkdev.h:13:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:193:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:545:58: note: expanded from macro '__do_outsw'
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from fs/f2fs/gc.c:10:
In file included from include/linux/backing-dev.h:15:
In file included from include/linux/blkdev.h:13:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:195:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:546:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
>> fs/f2fs/gc.c:622:12: warning: stack frame size of 1616 bytes in function 'get_victim_by_default' [-Wframe-larger-than=]
static int get_victim_by_default(struct f2fs_sb_info *sbi,
^
7 warnings generated.
vim +/get_victim_by_default +622 fs/f2fs/gc.c
093749e296e29a4 Chao Yu 2020-08-04 613
0a8165d7c2cf139 Jaegeuk Kim 2012-11-29 614 /*
111d2495a8a8fbd Masanari Iida 2013-03-19 615 * This function is called from two paths.
7bc0900347e069a Jaegeuk Kim 2012-11-02 616 * One is garbage collection and the other is SSR segment selection.
7bc0900347e069a Jaegeuk Kim 2012-11-02 617 * When it is called during GC, it just gets a victim segment
7bc0900347e069a Jaegeuk Kim 2012-11-02 618 * and it does not remove it from dirty seglist.
7bc0900347e069a Jaegeuk Kim 2012-11-02 619 * When it is called from SSR segment selection, it finds a segment
7bc0900347e069a Jaegeuk Kim 2012-11-02 620 * which has minimum valid blocks and removes it from dirty seglist.
7bc0900347e069a Jaegeuk Kim 2012-11-02 621 */
7bc0900347e069a Jaegeuk Kim 2012-11-02 @622 static int get_victim_by_default(struct f2fs_sb_info *sbi,
093749e296e29a4 Chao Yu 2020-08-04 623 unsigned int *result, int gc_type, int type,
093749e296e29a4 Chao Yu 2020-08-04 624 char alloc_mode, unsigned long long age)
7bc0900347e069a Jaegeuk Kim 2012-11-02 625 {
7bc0900347e069a Jaegeuk Kim 2012-11-02 626 struct dirty_seglist_info *dirty_i = DIRTY_I(sbi);
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 627 struct sit_info *sm = SIT_I(sbi);
7bc0900347e069a Jaegeuk Kim 2012-11-02 628 struct victim_sel_policy p;
3fa565039e3338f Sheng Yong 2016-09-29 629 unsigned int secno, last_victim;
04f0b2eaa3b3ee2 Qiuyang Sun 2019-06-05 630 unsigned int last_segment;
093749e296e29a4 Chao Yu 2020-08-04 631 unsigned int nsearched;
093749e296e29a4 Chao Yu 2020-08-04 632 bool is_atgc;
97767500781fae9 Qilong Zhang 2020-06-28 633 int ret = 0;
7bc0900347e069a Jaegeuk Kim 2012-11-02 634
210f41bc048263d Chao Yu 2014-09-15 635 mutex_lock(&dirty_i->seglist_lock);
04f0b2eaa3b3ee2 Qiuyang Sun 2019-06-05 636 last_segment = MAIN_SECS(sbi) * sbi->segs_per_sec;
210f41bc048263d Chao Yu 2014-09-15 637
7bc0900347e069a Jaegeuk Kim 2012-11-02 638 p.alloc_mode = alloc_mode;
093749e296e29a4 Chao Yu 2020-08-04 639 p.age = age;
093749e296e29a4 Chao Yu 2020-08-04 640 p.age_threshold = sbi->am.age_threshold;
7bc0900347e069a Jaegeuk Kim 2012-11-02 641
093749e296e29a4 Chao Yu 2020-08-04 642 retry:
093749e296e29a4 Chao Yu 2020-08-04 643 select_policy(sbi, gc_type, type, &p);
7bc0900347e069a Jaegeuk Kim 2012-11-02 644 p.min_segno = NULL_SEGNO;
093749e296e29a4 Chao Yu 2020-08-04 645 p.oldest_age = 0;
3fa565039e3338f Sheng Yong 2016-09-29 646 p.min_cost = get_max_cost(sbi, &p);
7bc0900347e069a Jaegeuk Kim 2012-11-02 647
093749e296e29a4 Chao Yu 2020-08-04 648 is_atgc = (p.gc_mode == GC_AT || p.alloc_mode == AT_SSR);
093749e296e29a4 Chao Yu 2020-08-04 649 nsearched = 0;
093749e296e29a4 Chao Yu 2020-08-04 650
093749e296e29a4 Chao Yu 2020-08-04 651 if (is_atgc)
093749e296e29a4 Chao Yu 2020-08-04 652 SIT_I(sbi)->dirty_min_mtime = ULLONG_MAX;
093749e296e29a4 Chao Yu 2020-08-04 653
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 654 if (*result != NULL_SEGNO) {
97767500781fae9 Qilong Zhang 2020-06-28 655 if (!get_valid_blocks(sbi, *result, false)) {
97767500781fae9 Qilong Zhang 2020-06-28 656 ret = -ENODATA;
97767500781fae9 Qilong Zhang 2020-06-28 657 goto out;
97767500781fae9 Qilong Zhang 2020-06-28 658 }
97767500781fae9 Qilong Zhang 2020-06-28 659
97767500781fae9 Qilong Zhang 2020-06-28 660 if (sec_usage_check(sbi, GET_SEC_FROM_SEG(sbi, *result)))
97767500781fae9 Qilong Zhang 2020-06-28 661 ret = -EBUSY;
97767500781fae9 Qilong Zhang 2020-06-28 662 else
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 663 p.min_segno = *result;
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 664 goto out;
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 665 }
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 666
97767500781fae9 Qilong Zhang 2020-06-28 667 ret = -ENODATA;
3342bb303bf48dd Chao Yu 2015-10-05 668 if (p.max_search == 0)
3342bb303bf48dd Chao Yu 2015-10-05 669 goto out;
3342bb303bf48dd Chao Yu 2015-10-05 670
e3080b0120a15e6 Chao Yu 2018-10-24 671 if (__is_large_section(sbi) && p.alloc_mode == LFS) {
e3080b0120a15e6 Chao Yu 2018-10-24 672 if (sbi->next_victim_seg[BG_GC] != NULL_SEGNO) {
e3080b0120a15e6 Chao Yu 2018-10-24 673 p.min_segno = sbi->next_victim_seg[BG_GC];
e3080b0120a15e6 Chao Yu 2018-10-24 674 *result = p.min_segno;
e3080b0120a15e6 Chao Yu 2018-10-24 675 sbi->next_victim_seg[BG_GC] = NULL_SEGNO;
e3080b0120a15e6 Chao Yu 2018-10-24 676 goto got_result;
e3080b0120a15e6 Chao Yu 2018-10-24 677 }
e3080b0120a15e6 Chao Yu 2018-10-24 678 if (gc_type == FG_GC &&
e3080b0120a15e6 Chao Yu 2018-10-24 679 sbi->next_victim_seg[FG_GC] != NULL_SEGNO) {
e3080b0120a15e6 Chao Yu 2018-10-24 680 p.min_segno = sbi->next_victim_seg[FG_GC];
e3080b0120a15e6 Chao Yu 2018-10-24 681 *result = p.min_segno;
e3080b0120a15e6 Chao Yu 2018-10-24 682 sbi->next_victim_seg[FG_GC] = NULL_SEGNO;
e3080b0120a15e6 Chao Yu 2018-10-24 683 goto got_result;
e3080b0120a15e6 Chao Yu 2018-10-24 684 }
e3080b0120a15e6 Chao Yu 2018-10-24 685 }
e3080b0120a15e6 Chao Yu 2018-10-24 686
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 687 last_victim = sm->last_victim[p.gc_mode];
7bc0900347e069a Jaegeuk Kim 2012-11-02 688 if (p.alloc_mode == LFS && gc_type == FG_GC) {
7bc0900347e069a Jaegeuk Kim 2012-11-02 689 p.min_segno = check_bg_victims(sbi);
7bc0900347e069a Jaegeuk Kim 2012-11-02 690 if (p.min_segno != NULL_SEGNO)
7bc0900347e069a Jaegeuk Kim 2012-11-02 691 goto got_it;
7bc0900347e069a Jaegeuk Kim 2012-11-02 692 }
7bc0900347e069a Jaegeuk Kim 2012-11-02 693
7bc0900347e069a Jaegeuk Kim 2012-11-02 694 while (1) {
da52f8ade40b032 Jack Qiu 2020-06-18 695 unsigned long cost, *dirty_bitmap;
da52f8ade40b032 Jack Qiu 2020-06-18 696 unsigned int unit_no, segno;
da52f8ade40b032 Jack Qiu 2020-06-18 697
da52f8ade40b032 Jack Qiu 2020-06-18 698 dirty_bitmap = p.dirty_bitmap;
da52f8ade40b032 Jack Qiu 2020-06-18 699 unit_no = find_next_bit(dirty_bitmap,
da52f8ade40b032 Jack Qiu 2020-06-18 700 last_segment / p.ofs_unit,
da52f8ade40b032 Jack Qiu 2020-06-18 701 p.offset / p.ofs_unit);
da52f8ade40b032 Jack Qiu 2020-06-18 702 segno = unit_no * p.ofs_unit;
a43f7ec327b0d86 Chao Yu 2015-10-05 703 if (segno >= last_segment) {
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 704 if (sm->last_victim[p.gc_mode]) {
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 705 last_segment =
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 706 sm->last_victim[p.gc_mode];
e066b83c9b40f3a Jaegeuk Kim 2017-04-13 707 sm->last_victim[p.gc_mode] = 0;
7bc0900347e069a Jaegeuk Kim 2012-11-02 708 p.offset = 0;
7bc0900347e069a Jaegeuk Kim 2012-11-02 709 continue;
7bc0900347e069a Jaegeuk Kim 2012-11-02 710 }
7bc0900347e069a Jaegeuk Kim 2012-11-02 711 break;
7bc0900347e069a Jaegeuk Kim 2012-11-02 712 }
a57e564d14d9d12 Jin Xu 2013-09-13 713
a57e564d14d9d12 Jin Xu 2013-09-13 714 p.offset = segno + p.ofs_unit;
688159b6db47a9e Fan Li 2016-02-03 715 nsearched++;
688159b6db47a9e Fan Li 2016-02-03 716
:::::: The code at line 622 was first introduced by commit
:::::: 7bc0900347e069a1676d28ad6f98cafaf8cfd6e9 f2fs: add garbage collection functions
:::::: TO: Jaegeuk Kim <jaegeuk.kim(a)samsung.com>
:::::: CC: Jaegeuk Kim <jaegeuk.kim(a)samsung.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[hch-xfs:xfs-array-size 14/14] fs/xfs/xfs_extfree_item.c:158:42: warning: variable 'efip' is uninitialized when used here
by kernel test robot
tree: git://git.infradead.org/users/hch/xfs xfs-array-size
head: 0e7da51da807eb42b92b287738899d1ee6ca029e
commit: 0e7da51da807eb42b92b287738899d1ee6ca029e [14/14] xfs: Replace one-element arrays with flexible-array members
config: riscv-randconfig-r026-20210413 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9829f5e6b1bca9b61efc629770d28bb9014dec45)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
git remote add hch-xfs git://git.infradead.org/users/hch/xfs
git fetch --no-tags hch-xfs xfs-array-size
git checkout 0e7da51da807eb42b92b287738899d1ee6ca029e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> fs/xfs/xfs_extfree_item.c:158:42: warning: variable 'efip' is uninitialized when used here [-Wuninitialized]
efip = kmem_zalloc(xfs_efi_item_sizeof(efip, nextents), 0);
^~~~
fs/xfs/xfs_extfree_item.c:154:31: note: initialize the variable 'efip' to silence this warning
struct xfs_efi_log_item *efip;
^
= NULL
>> fs/xfs/xfs_extfree_item.c:270:42: warning: variable 'efdp' is uninitialized when used here [-Wuninitialized]
efdp = kmem_zalloc(xfs_efd_item_sizeof(efdp, nextents), 0);
^~~~
fs/xfs/xfs_extfree_item.c:266:32: note: initialize the variable 'efdp' to silence this warning
struct xfs_efd_log_item *efdp;
^
= NULL
2 warnings generated.
vim +/efip +158 fs/xfs/xfs_extfree_item.c
144
145 /*
146 * Allocate and initialize an efi item with the given number of extents.
147 */
148 STATIC struct xfs_efi_log_item *
149 xfs_efi_init(
150 struct xfs_mount *mp,
151 uint nextents)
152
153 {
154 struct xfs_efi_log_item *efip;
155
156 ASSERT(nextents > 0);
157 if (nextents > XFS_EFI_MAX_FAST_EXTENTS)
> 158 efip = kmem_zalloc(xfs_efi_item_sizeof(efip, nextents), 0);
159 else
160 efip = kmem_cache_zalloc(xfs_efi_zone,
161 GFP_KERNEL | __GFP_NOFAIL);
162
163 xfs_log_item_init(mp, &efip->efi_item, XFS_LI_EFI, &xfs_efi_item_ops);
164 efip->efi_format.efi_nextents = nextents;
165 efip->efi_format.efi_id = (uintptr_t)(void *)efip;
166 atomic_set(&efip->efi_next_extent, 0);
167 atomic_set(&efip->efi_refcount, 2);
168
169 return efip;
170 }
171
172 static inline struct xfs_efd_log_item *EFD_ITEM(struct xfs_log_item *lip)
173 {
174 return container_of(lip, struct xfs_efd_log_item, efd_item);
175 }
176
177 STATIC void
178 xfs_efd_item_free(struct xfs_efd_log_item *efdp)
179 {
180 kmem_free(efdp->efd_item.li_lv_shadow);
181 if (efdp->efd_format.efd_nextents > XFS_EFD_MAX_FAST_EXTENTS)
182 kmem_free(efdp);
183 else
184 kmem_cache_free(xfs_efd_zone, efdp);
185 }
186
187 /*
188 * This returns the number of iovecs needed to log the given efd item.
189 * We only need 1 iovec for an efd item. It just logs the efd_log_format
190 * structure.
191 */
192 static inline int
193 xfs_efd_log_item_sizeof(
194 struct xfs_efd_log_format *elf)
195 {
196 return struct_size(elf, efd_extents, elf->efd_nextents);
197 }
198
199 STATIC void
200 xfs_efd_item_size(
201 struct xfs_log_item *lip,
202 int *nvecs,
203 int *nbytes)
204 {
205 *nvecs += 1;
206 *nbytes += xfs_efd_log_item_sizeof(&EFD_ITEM(lip)->efd_format);
207 }
208
209 /*
210 * This is called to fill in the vector of log iovecs for the
211 * given efd log item. We use only 1 iovec, and we point that
212 * at the efd_log_format structure embedded in the efd item.
213 * It is at this point that we assert that all of the extent
214 * slots in the efd item have been filled.
215 */
216 STATIC void
217 xfs_efd_item_format(
218 struct xfs_log_item *lip,
219 struct xfs_log_vec *lv)
220 {
221 struct xfs_efd_log_item *efdp = EFD_ITEM(lip);
222 struct xfs_log_iovec *vecp = NULL;
223
224 ASSERT(efdp->efd_next_extent == efdp->efd_format.efd_nextents);
225
226 efdp->efd_format.efd_type = XFS_LI_EFD;
227 efdp->efd_format.efd_size = 1;
228
229 xlog_copy_iovec(lv, &vecp, XLOG_REG_TYPE_EFD_FORMAT,
230 &efdp->efd_format,
231 xfs_efd_log_item_sizeof(&efdp->efd_format));
232 }
233
234 /*
235 * The EFD is either committed or aborted if the transaction is cancelled. If
236 * the transaction is cancelled, drop our reference to the EFI and free the EFD.
237 */
238 STATIC void
239 xfs_efd_item_release(
240 struct xfs_log_item *lip)
241 {
242 struct xfs_efd_log_item *efdp = EFD_ITEM(lip);
243
244 xfs_efi_release(efdp->efd_efip);
245 xfs_efd_item_free(efdp);
246 }
247
248 static const struct xfs_item_ops xfs_efd_item_ops = {
249 .flags = XFS_ITEM_RELEASE_WHEN_COMMITTED,
250 .iop_size = xfs_efd_item_size,
251 .iop_format = xfs_efd_item_format,
252 .iop_release = xfs_efd_item_release,
253 };
254
255 /*
256 * Allocate an "extent free done" log item that will hold nextents worth of
257 * extents. The caller must use all nextents extents, because we are not
258 * flexible about this at all.
259 */
260 static struct xfs_efd_log_item *
261 xfs_trans_get_efd(
262 struct xfs_trans *tp,
263 struct xfs_efi_log_item *efip,
264 unsigned int nextents)
265 {
266 struct xfs_efd_log_item *efdp;
267
268 ASSERT(nextents > 0);
269 if (nextents > XFS_EFD_MAX_FAST_EXTENTS)
> 270 efdp = kmem_zalloc(xfs_efd_item_sizeof(efdp, nextents), 0);
271 else
272 efdp = kmem_cache_zalloc(xfs_efd_zone,
273 GFP_KERNEL | __GFP_NOFAIL);
274
275 xfs_log_item_init(tp->t_mountp, &efdp->efd_item, XFS_LI_EFD,
276 &xfs_efd_item_ops);
277 efdp->efd_efip = efip;
278 efdp->efd_format.efd_nextents = nextents;
279 efdp->efd_format.efd_efi_id = efip->efi_format.efi_id;
280
281 xfs_trans_add_item(tp, &efdp->efd_item);
282 return efdp;
283 }
284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
Re: [PATCH v2 15/16] mm: multigenerational lru: Kconfig
by kernel test robot
Hi Yu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/x86/core]
[also build test ERROR on cgroup/for-next tip/x86/mm fuse/for-next tip/perf/core tip/sched/core linus/master v5.12-rc7]
[cannot apply to hnaz-linux-mm/master next-20210413]
[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]
url: https://github.com/0day-ci/linux/commits/Yu-Zhao/Multigenerational-LRU-Fr...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 99cb64de36d5c9397a664808b92943e35bdce25e
config: um-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/f05f4c64bb8f0b8bcc40c9931f51bffdb...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yu-Zhao/Multigenerational-LRU-Framework/20210413-145844
git checkout f05f4c64bb8f0b8bcc40c9931f51bffdb6502cdd
# save the attached .config to linux build tree
make W=1 ARCH=um
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
mm/vmscan.c: In function 'walk_pmd_range_unlocked':
>> mm/vmscan.c:5055:24: error: implicit declaration of function 'pmd_pfn'; did you mean 'pmd_off'? [-Werror=implicit-function-declaration]
5055 | unsigned long pfn = pmd_pfn(val);
| ^~~~~~~
| pmd_off
>> mm/vmscan.c:5057:9: error: implicit declaration of function 'pmd_young'; did you mean 'pte_young'? [-Werror=implicit-function-declaration]
5057 | if (!pmd_young(val)) {
| ^~~~~~~~~
| pte_young
cc1: some warnings being treated as errors
--
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
mm/memcontrol.c: In function 'mem_cgroup_attach':
>> mm/memcontrol.c:6176:3: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
6176 | ;
| ^
vim +5055 mm/vmscan.c
4aa138b42a5c9f Yu Zhao 2021-04-13 5029
4aa138b42a5c9f Yu Zhao 2021-04-13 5030 static bool walk_pmd_range_unlocked(pud_t *pud, unsigned long start, unsigned long end,
4aa138b42a5c9f Yu Zhao 2021-04-13 5031 struct mm_walk *walk)
4aa138b42a5c9f Yu Zhao 2021-04-13 5032 {
4aa138b42a5c9f Yu Zhao 2021-04-13 5033 int i;
4aa138b42a5c9f Yu Zhao 2021-04-13 5034 pmd_t *pmd;
4aa138b42a5c9f Yu Zhao 2021-04-13 5035 unsigned long next;
4aa138b42a5c9f Yu Zhao 2021-04-13 5036 int young = 0;
4aa138b42a5c9f Yu Zhao 2021-04-13 5037 struct mm_walk_args *args = walk->private;
4aa138b42a5c9f Yu Zhao 2021-04-13 5038
4aa138b42a5c9f Yu Zhao 2021-04-13 5039 VM_BUG_ON(pud_leaf(*pud));
4aa138b42a5c9f Yu Zhao 2021-04-13 5040
4aa138b42a5c9f Yu Zhao 2021-04-13 5041 pmd = pmd_offset(pud, start & PUD_MASK);
4aa138b42a5c9f Yu Zhao 2021-04-13 5042 restart:
4aa138b42a5c9f Yu Zhao 2021-04-13 5043 for (i = pmd_index(start); start != end; i++, start = next) {
4aa138b42a5c9f Yu Zhao 2021-04-13 5044 pmd_t val = pmd_read_atomic(pmd + i);
4aa138b42a5c9f Yu Zhao 2021-04-13 5045
4aa138b42a5c9f Yu Zhao 2021-04-13 5046 next = pmd_addr_end(start, end);
4aa138b42a5c9f Yu Zhao 2021-04-13 5047
4aa138b42a5c9f Yu Zhao 2021-04-13 5048 barrier();
4aa138b42a5c9f Yu Zhao 2021-04-13 5049 if (!pmd_present(val) || is_huge_zero_pmd(val)) {
4aa138b42a5c9f Yu Zhao 2021-04-13 5050 args->mm_stats[MM_LEAF_HOLE]++;
4aa138b42a5c9f Yu Zhao 2021-04-13 5051 continue;
4aa138b42a5c9f Yu Zhao 2021-04-13 5052 }
4aa138b42a5c9f Yu Zhao 2021-04-13 5053
4aa138b42a5c9f Yu Zhao 2021-04-13 5054 if (pmd_trans_huge(val)) {
4aa138b42a5c9f Yu Zhao 2021-04-13 @5055 unsigned long pfn = pmd_pfn(val);
4aa138b42a5c9f Yu Zhao 2021-04-13 5056
4aa138b42a5c9f Yu Zhao 2021-04-13 @5057 if (!pmd_young(val)) {
4aa138b42a5c9f Yu Zhao 2021-04-13 5058 args->mm_stats[MM_LEAF_OLD]++;
4aa138b42a5c9f Yu Zhao 2021-04-13 5059 continue;
4aa138b42a5c9f Yu Zhao 2021-04-13 5060 }
4aa138b42a5c9f Yu Zhao 2021-04-13 5061
4aa138b42a5c9f Yu Zhao 2021-04-13 5062 if (pfn < args->start_pfn || pfn >= args->end_pfn) {
4aa138b42a5c9f Yu Zhao 2021-04-13 5063 args->mm_stats[MM_LEAF_OTHER_NODE]++;
4aa138b42a5c9f Yu Zhao 2021-04-13 5064 continue;
4aa138b42a5c9f Yu Zhao 2021-04-13 5065 }
4aa138b42a5c9f Yu Zhao 2021-04-13 5066
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[android-common:android12-5.10 7469/7578] mm/hugetlb.c:5458:8: error: conflicting types for 'huge_pmd_share'
by kernel test robot
tree: https://android.googlesource.com/kernel/common android12-5.10
head: 09eafb2817274145e936cc918c82288a3bc09cb3
commit: 59caf93f36aed4b7c5960672376b966e3f5b2bf1 [7469/7578] BACKPORT: FROMGIT: hugetlb: pass vma into huge_pte_alloc() and huge_pmd_share()
config: arm64-randconfig-r004-20210413 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android12-5.10
git checkout 59caf93f36aed4b7c5960672376b966e3f5b2bf1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> mm/hugetlb.c:5458:8: error: conflicting types for 'huge_pmd_share'
5458 | pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct vma,
| ^~~~~~~~~~~~~~
In file included from mm/hugetlb.c:39:
include/linux/hugetlb.h:155:8: note: previous declaration of 'huge_pmd_share' was here
155 | pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
| ^~~~~~~~~~~~~~
vim +/huge_pmd_share +5458 mm/hugetlb.c
5425
5426 /*
5427 * unmap huge page backed by shared pte.
5428 *
5429 * Hugetlb pte page is ref counted at the time of mapping. If pte is shared
5430 * indicated by page_count > 1, unmap is achieved by clearing pud and
5431 * decrementing the ref count. If count == 1, the pte page is not shared.
5432 *
5433 * Called with page table lock held and i_mmap_rwsem held in write mode.
5434 *
5435 * returns: 1 successfully unmapped a shared pte page
5436 * 0 the underlying pte page is not shared, or it is the last user
5437 */
5438 int huge_pmd_unshare(struct mm_struct *mm, struct vm_area_struct *vma,
5439 unsigned long *addr, pte_t *ptep)
5440 {
5441 pgd_t *pgd = pgd_offset(mm, *addr);
5442 p4d_t *p4d = p4d_offset(pgd, *addr);
5443 pud_t *pud = pud_offset(p4d, *addr);
5444
5445 i_mmap_assert_write_locked(vma->vm_file->f_mapping);
5446 BUG_ON(page_count(virt_to_page(ptep)) == 0);
5447 if (page_count(virt_to_page(ptep)) == 1)
5448 return 0;
5449
5450 pud_clear(pud);
5451 put_page(virt_to_page(ptep));
5452 mm_dec_nr_pmds(mm);
5453 *addr = ALIGN(*addr, HPAGE_SIZE * PTRS_PER_PTE) - HPAGE_SIZE;
5454 return 1;
5455 }
5456 #define want_pmd_share() (1)
5457 #else /* !CONFIG_ARCH_WANT_HUGE_PMD_SHARE */
> 5458 pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct vma,
5459 unsigned long addr, pud_t *pud)
5460 {
5461 return NULL;
5462 }
5463
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months