From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH] kunit: split resource API from test.h into new resource.h
Date: Thu, 17 Mar 2022 05:41:43 +0800 [thread overview]
Message-ID: <202203170501.cCagiYT2-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 15715 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220316024432.1454366-1-dlatypov@google.com>
References: <20220316024432.1454366-1-dlatypov@google.com>
TO: Daniel Latypov <dlatypov@google.com>
TO: brendanhiggins(a)google.com
TO: davidgow(a)google.com
CC: linux-kernel(a)vger.kernel.org
CC: kunit-dev(a)googlegroups.com
CC: linux-kselftest(a)vger.kernel.org
CC: skhan(a)linuxfoundation.org
CC: Daniel Latypov <dlatypov@google.com>
Hi Daniel,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on 09688c0166e76ce2fb85e86b9d99be8b0084cdf9]
url: https://github.com/0day-ci/linux/commits/Daniel-Latypov/kunit-split-resource-API-from-test-h-into-new-resource-h/20220316-104559
base: 09688c0166e76ce2fb85e86b9d99be8b0084cdf9
:::::: branch date: 19 hours ago
:::::: commit date: 19 hours ago
config: arm-randconfig-c002-20220313 (https://download.01.org/0day-ci/archive/20220317/202203170501.cCagiYT2-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project a6ec1e3d798f8eab43fb3a91028c6ab04e115fcb)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/132662b59a0f2d3d7b21c94ff6829725a6b606f5
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Daniel-Latypov/kunit-split-resource-API-from-test-h-into-new-resource-h/20220316-104559
git checkout 132662b59a0f2d3d7b21c94ff6829725a6b606f5
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
kernel/rcu/rcuscale.c:453:7: note: Left side of '&&' is true
if (!started &&
^
kernel/rcu/rcuscale.c:454:7: note: Assuming the condition is false
atomic_read(&n_rcu_scale_writer_started) >= nrealwriters)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/rcu/rcuscale.c:453:3: note: Taking false branch
if (!started &&
^
kernel/rcu/rcuscale.c:456:8: note: 'done' is false
if (!done && i >= MIN_MEAS) {
^~~~
kernel/rcu/rcuscale.c:456:7: note: Left side of '&&' is true
if (!done && i >= MIN_MEAS) {
^
kernel/rcu/rcuscale.c:456:16: note: 'i' is < MIN_MEAS
if (!done && i >= MIN_MEAS) {
^
kernel/rcu/rcuscale.c:456:3: note: Taking false branch
if (!done && i >= MIN_MEAS) {
^
kernel/rcu/rcuscale.c:480:7: note: 'done' is false
if (done && !alldone &&
^~~~
kernel/rcu/rcuscale.c:480:12: note: Left side of '&&' is false
if (done && !alldone &&
^
kernel/rcu/rcuscale.c:483:7: note: 'started' is false
if (started && !alldone && i < MAX_MEAS - 1)
^~~~~~~
kernel/rcu/rcuscale.c:483:15: note: Left side of '&&' is false
if (started && !alldone && i < MAX_MEAS - 1)
^
kernel/rcu/rcuscale.c:486:11: note: Assuming the condition is true
} while (!torture_must_stop());
^~~~~~~~~~~~~~~~~~~~
kernel/rcu/rcuscale.c:426:2: note: Loop condition is true. Execution continues on line 427
do {
^
kernel/rcu/rcuscale.c:427:7: note: Assuming 'writer_holdoff' is 0
if (writer_holdoff)
^~~~~~~~~~~~~~
kernel/rcu/rcuscale.c:427:3: note: Taking false branch
if (writer_holdoff)
^
kernel/rcu/rcuscale.c:431:7: note: Assuming 'gp_async' is true
if (gp_async) {
^~~~~~~~
kernel/rcu/rcuscale.c:431:3: note: Taking true branch
if (gp_async) {
^
kernel/rcu/rcuscale.c:433:9: note: 'rhp' is non-null
if (!rhp)
^~~
kernel/rcu/rcuscale.c:433:4: note: Taking false branch
if (!rhp)
^
kernel/rcu/rcuscale.c:435:8: note: 'rhp' is non-null
if (rhp && atomic_read(this_cpu_ptr(&n_async_inflight)) < gp_async_max) {
^~~
kernel/rcu/rcuscale.c:435:8: note: Left side of '&&' is true
kernel/rcu/rcuscale.c:435:27: note: Loop condition is false. Exiting loop
if (rhp && atomic_read(this_cpu_ptr(&n_async_inflight)) < gp_async_max) {
^
include/linux/percpu-defs.h:265:27: note: expanded from macro 'this_cpu_ptr'
#define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)
^
include/linux/percpu-defs.h:264:26: note: expanded from macro 'raw_cpu_ptr'
#define raw_cpu_ptr(ptr) per_cpu_ptr(ptr, 0)
^
include/linux/percpu-defs.h:263:47: note: expanded from macro 'per_cpu_ptr'
#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); })
^
include/linux/percpu-defs.h:259:2: note: expanded from macro 'VERIFY_PERCPU_PTR'
__verify_pcpu_ptr(__p); \
^
include/linux/percpu-defs.h:217:37: note: expanded from macro '__verify_pcpu_ptr'
#define __verify_pcpu_ptr(ptr) \
^
kernel/rcu/rcuscale.c:435:15: note: Assuming the condition is false
if (rhp && atomic_read(this_cpu_ptr(&n_async_inflight)) < gp_async_max) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/rcu/rcuscale.c:435:4: note: Taking false branch
if (rhp && atomic_read(this_cpu_ptr(&n_async_inflight)) < gp_async_max) {
^
kernel/rcu/rcuscale.c:439:15: note: Assuming the condition is false
} else if (!kthread_should_stop()) {
^~~~~~~~~~~~~~~~~~~~~~
kernel/rcu/rcuscale.c:439:11: note: Taking false branch
} else if (!kthread_should_stop()) {
^
kernel/rcu/rcuscale.c:443:5: note: Attempt to free released memory
kfree(rhp); /* Because we are stopping. */
^~~~~~~~~~
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (2 in non-user code, 4 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
>> include/kunit/resource.h:125:3: warning: Argument to kfree() is the address of a local stack variable, which is not memory allocated by malloc() [clang-analyzer-unix.Malloc]
kfree(res);
^
lib/kunit/kunit-test.c:333:2: note: Assuming '__left' is not equal to '__right'
KUNIT_EXPECT_EQ(test,
^
include/kunit/test.h:1063:2: note: expanded from macro 'KUNIT_EXPECT_EQ'
KUNIT_BINARY_EQ_ASSERTION(test, KUNIT_EXPECTATION, left, right)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:700:2: note: expanded from macro 'KUNIT_BINARY_EQ_ASSERTION'
KUNIT_BINARY_EQ_MSG_ASSERTION(test, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:690:2: note: expanded from macro 'KUNIT_BINARY_EQ_MSG_ASSERTION'
KUNIT_BASE_EQ_MSG_ASSERTION(test, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:601:2: note: expanded from macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
KUNIT_BASE_BINARY_ASSERTION(test, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:580:4: note: expanded from macro 'KUNIT_BASE_BINARY_ASSERTION'
__left op __right, \
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:483:7: note: expanded from macro 'KUNIT_ASSERTION'
pass, \
^~~~
lib/kunit/kunit-test.c:333:2: note: Loop condition is false. Exiting loop
KUNIT_EXPECT_EQ(test,
^
include/kunit/test.h:1063:2: note: expanded from macro 'KUNIT_EXPECT_EQ'
KUNIT_BINARY_EQ_ASSERTION(test, KUNIT_EXPECTATION, left, right)
^
include/kunit/test.h:700:2: note: expanded from macro 'KUNIT_BINARY_EQ_ASSERTION'
KUNIT_BINARY_EQ_MSG_ASSERTION(test, \
^
include/kunit/test.h:690:2: note: expanded from macro 'KUNIT_BINARY_EQ_MSG_ASSERTION'
KUNIT_BASE_EQ_MSG_ASSERTION(test, \
^
include/kunit/test.h:601:2: note: expanded from macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
KUNIT_BASE_BINARY_ASSERTION(test, \
^
include/kunit/test.h:579:2: note: expanded from macro 'KUNIT_BASE_BINARY_ASSERTION'
KUNIT_ASSERTION(test, \
^
include/kunit/test.h:479:74: note: expanded from macro 'KUNIT_ASSERTION'
#define KUNIT_ASSERTION(test, pass, assert_class, INITIALIZER, fmt, ...) do { \
^
lib/kunit/kunit-test.c:333:2: note: Loop condition is false. Exiting loop
KUNIT_EXPECT_EQ(test,
^
include/kunit/test.h:1063:2: note: expanded from macro 'KUNIT_EXPECT_EQ'
KUNIT_BINARY_EQ_ASSERTION(test, KUNIT_EXPECTATION, left, right)
^
include/kunit/test.h:700:2: note: expanded from macro 'KUNIT_BINARY_EQ_ASSERTION'
KUNIT_BINARY_EQ_MSG_ASSERTION(test, \
^
include/kunit/test.h:690:2: note: expanded from macro 'KUNIT_BINARY_EQ_MSG_ASSERTION'
KUNIT_BASE_EQ_MSG_ASSERTION(test, \
^
include/kunit/test.h:601:2: note: expanded from macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
KUNIT_BASE_BINARY_ASSERTION(test, \
^
include/kunit/test.h:574:24: note: expanded from macro 'KUNIT_BASE_BINARY_ASSERTION'
...) \
^
lib/kunit/kunit-test.c:337:2: note: Loop condition is false. Exiting loop
KUNIT_EXPECT_PTR_EQ(test, res1.data, (void *)&ctx);
^
include/kunit/test.h:1085:2: note: expanded from macro 'KUNIT_EXPECT_PTR_EQ'
KUNIT_BINARY_PTR_EQ_ASSERTION(test, \
^
include/kunit/test.h:722:2: note: expanded from macro 'KUNIT_BINARY_PTR_EQ_ASSERTION'
KUNIT_BINARY_PTR_EQ_MSG_ASSERTION(test, \
^
include/kunit/test.h:712:2: note: expanded from macro 'KUNIT_BINARY_PTR_EQ_MSG_ASSERTION'
KUNIT_BASE_EQ_MSG_ASSERTION(test, \
^
include/kunit/test.h:601:2: note: expanded from macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
KUNIT_BASE_BINARY_ASSERTION(test, \
^
include/kunit/test.h:579:2: note: expanded from macro 'KUNIT_BASE_BINARY_ASSERTION'
KUNIT_ASSERTION(test, \
^
include/kunit/test.h:479:74: note: expanded from macro 'KUNIT_ASSERTION'
#define KUNIT_ASSERTION(test, pass, assert_class, INITIALIZER, fmt, ...) do { \
^
lib/kunit/kunit-test.c:337:2: note: Loop condition is false. Exiting loop
KUNIT_EXPECT_PTR_EQ(test, res1.data, (void *)&ctx);
^
include/kunit/test.h:1085:2: note: expanded from macro 'KUNIT_EXPECT_PTR_EQ'
KUNIT_BINARY_PTR_EQ_ASSERTION(test, \
^
include/kunit/test.h:722:2: note: expanded from macro 'KUNIT_BINARY_PTR_EQ_ASSERTION'
KUNIT_BINARY_PTR_EQ_MSG_ASSERTION(test, \
^
include/kunit/test.h:712:2: note: expanded from macro 'KUNIT_BINARY_PTR_EQ_MSG_ASSERTION'
KUNIT_BASE_EQ_MSG_ASSERTION(test, \
^
include/kunit/test.h:601:2: note: expanded from macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
KUNIT_BASE_BINARY_ASSERTION(test, \
^
include/kunit/test.h:574:24: note: expanded from macro 'KUNIT_BASE_BINARY_ASSERTION'
...) \
vim +125 include/kunit/resource.h
132662b59a0f2d3 Daniel Latypov 2022-03-15 112
132662b59a0f2d3 Daniel Latypov 2022-03-15 113 /*
132662b59a0f2d3 Daniel Latypov 2022-03-15 114 * Called when refcount reaches zero via kunit_put_resource();
132662b59a0f2d3 Daniel Latypov 2022-03-15 115 * should not be called directly.
132662b59a0f2d3 Daniel Latypov 2022-03-15 116 */
132662b59a0f2d3 Daniel Latypov 2022-03-15 117 static inline void kunit_release_resource(struct kref *kref)
132662b59a0f2d3 Daniel Latypov 2022-03-15 118 {
132662b59a0f2d3 Daniel Latypov 2022-03-15 119 struct kunit_resource *res = container_of(kref, struct kunit_resource,
132662b59a0f2d3 Daniel Latypov 2022-03-15 120 refcount);
132662b59a0f2d3 Daniel Latypov 2022-03-15 121
132662b59a0f2d3 Daniel Latypov 2022-03-15 122 /* If free function is defined, resource was dynamically allocated. */
132662b59a0f2d3 Daniel Latypov 2022-03-15 123 if (res->free) {
132662b59a0f2d3 Daniel Latypov 2022-03-15 124 res->free(res);
132662b59a0f2d3 Daniel Latypov 2022-03-15 @125 kfree(res);
132662b59a0f2d3 Daniel Latypov 2022-03-15 126 }
132662b59a0f2d3 Daniel Latypov 2022-03-15 127 }
132662b59a0f2d3 Daniel Latypov 2022-03-15 128
---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2022-03-16 21:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 21:41 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-03-16 2:44 [PATCH] kunit: split resource API from test.h into new resource.h Daniel Latypov
2022-03-16 5:41 ` David Gow
2022-03-16 16:19 ` Daniel Latypov
2022-03-17 8:03 ` David Gow
2022-03-23 23:51 ` Brendan Higgins
2022-03-25 0:08 ` Daniel Latypov
2022-03-23 23:52 ` Brendan Higgins
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=202203170501.cCagiYT2-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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.