linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj38.park@gmail.com>
To: kbuild test robot <lkp@intel.com>
Cc: sj38.park@gmail.com, kbuild-all@lists.01.org,
	akpm@linux-foundation.org, SeongJae Park <sjpark@amazon.de>,
	acme@kernel.org, alexander.shishkin@linux.intel.com,
	amit@kernel.org, brendan.d.gregg@gmail.com,
	brendanhiggins@google.com, cai@lca.pw, colin.king@canonical.com,
	corbet@lwn.net, dwmw@amazon.com, jolsa@redhat.com,
	kirill@shutemov.name, mark.rutland@arm.com, mgorman@suse.de,
	minchan@kernel.org, mingo@redhat.com, namhyung@kernel.org,
	peterz@infradead.org, rdunlap@infradead.org, rostedt@goodmis.org,
	vdavydov.dev@gmail.com, linux-mm@kvack.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH v3 10/11] mm/damon: Add kunit tests
Date: Wed,  5 Feb 2020 17:47:09 +0100	[thread overview]
Message-ID: <20200205164709.19920-1-sj38.park@gmail.com> (raw)
In-Reply-To: <202002051834.cKoViGVl%lkp@intel.com> (raw)

On Wed, 5 Feb 2020 18:38:48 +0800 kbuild test robot <lkp@intel.com> wrote:

> [-- Attachment #1: Type: text/plain, Size: 24012 bytes --]
> 
> Hi,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on linus/master]
> [also build test WARNING on v5.5]
> [cannot apply to next-20200205]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> 
> url:    https://github.com/0day-ci/linux/commits/sj38-park-gmail-com/Introduce-Data-Access-MONitor-DAMON/20200204-143127
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 322bf2d3446aabdaf5e8887775bd9ced80dbc0f0
> config: i386-allyesconfig (attached as .config)
> compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
>    In file included from include/linux/list.h:9:0,
>                     from include/linux/random.h:10,
>                     from include/linux/damon.h:13,
>                     from mm/damon.c:14:
>    mm/damon-test.h: In function 'damon_test_str_to_pids':
>    include/linux/kernel.h:835:29: warning: comparison of distinct pointer types lacks a cast
>       (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
>                                 ^
> >> include/kunit/test.h:510:9: note: in expansion of macro '__typecheck'
>      ((void)__typecheck(__left, __right));           \
>             ^~~~~~~~~~~
> >> include/kunit/test.h:534:2: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
>      KUNIT_BASE_BINARY_ASSERTION(test,           \
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> include/kunit/test.h:623:2: note: in expansion of macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
>      KUNIT_BASE_EQ_MSG_ASSERTION(test,           \
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> include/kunit/test.h:633:2: note: in expansion of macro 'KUNIT_BINARY_EQ_MSG_ASSERTION'
>      KUNIT_BINARY_EQ_MSG_ASSERTION(test,           \
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> include/kunit/test.h:996:2: note: in expansion of macro 'KUNIT_BINARY_EQ_ASSERTION'
>      KUNIT_BINARY_EQ_ASSERTION(test, KUNIT_EXPECTATION, left, right)
>      ^~~~~~~~~~~~~~~~~~~~~~~~~
> >> mm/damon-test.h:26:2: note: in expansion of macro 'KUNIT_EXPECT_EQ'
>      KUNIT_EXPECT_EQ(test, 1l, nr_integers);
>      ^~~~~~~~~~~~~~~
[...]

Thank you for the reporting!  Fixed the warnings and an error for i386 build
with below changes.  If anything wrong, please let me know.


Thanks,
SeongJae Park


diff --git a/mm/damon-test.h b/mm/damon-test.h
index ad3ffd1c20e2..c7dc21325c77 100644
--- a/mm/damon-test.h
+++ b/mm/damon-test.h
@@ -23,51 +23,51 @@ static void damon_test_str_to_pids(struct kunit *test)

        question = "123";
        answers = str_to_pids(question, strnlen(question, 128), &nr_integers);
-       KUNIT_EXPECT_EQ(test, 1l, nr_integers);
+       KUNIT_EXPECT_EQ(test, (ssize_t)1, nr_integers);
        KUNIT_EXPECT_EQ(test, 123ul, answers[0]);
        kfree(answers);

        question = "123abc";
        answers = str_to_pids(question, strnlen(question, 128), &nr_integers);
-       KUNIT_EXPECT_EQ(test, 1l, nr_integers);
+       KUNIT_EXPECT_EQ(test, (ssize_t)1, nr_integers);
        KUNIT_EXPECT_EQ(test, 123ul, answers[0]);
        kfree(answers);

        question = "a123";
        answers = str_to_pids(question, strnlen(question, 128), &nr_integers);
-       KUNIT_EXPECT_EQ(test, 0l, nr_integers);
+       KUNIT_EXPECT_EQ(test, (ssize_t)0, nr_integers);
        KUNIT_EXPECT_PTR_EQ(test, answers, (unsigned long *)NULL);

        question = "12 35";
        answers = str_to_pids(question, strnlen(question, 128), &nr_integers);
-       KUNIT_EXPECT_EQ(test, 2l, nr_integers);
+       KUNIT_EXPECT_EQ(test, (ssize_t)2, nr_integers);
        for (i = 0; i < nr_integers; i++)
                KUNIT_EXPECT_EQ(test, expected[i], answers[i]);
        kfree(answers);

        question = "12 35 46";
        answers = str_to_pids(question, strnlen(question, 128), &nr_integers);
-       KUNIT_EXPECT_EQ(test, 3l, nr_integers);
+       KUNIT_EXPECT_EQ(test, (ssize_t)3, nr_integers);
        for (i = 0; i < nr_integers; i++)
                KUNIT_EXPECT_EQ(test, expected[i], answers[i]);
        kfree(answers);

        question = "12 35 abc 46";
        answers = str_to_pids(question, strnlen(question, 128), &nr_integers);
-       KUNIT_EXPECT_EQ(test, 2l, nr_integers);
+       KUNIT_EXPECT_EQ(test, (ssize_t)2, nr_integers);
        for (i = 0; i < 2; i++)
                KUNIT_EXPECT_EQ(test, expected[i], answers[i]);
        kfree(answers);

        question = "";
        answers = str_to_pids(question, strnlen(question, 128), &nr_integers);
-       KUNIT_EXPECT_EQ(test, 0l, nr_integers);
+       KUNIT_EXPECT_EQ(test, (ssize_t)0, nr_integers);
        KUNIT_EXPECT_PTR_EQ(test, (unsigned long *)NULL, answers);
        kfree(answers);

        question = "\n";
        answers = str_to_pids(question, strnlen(question, 128), &nr_integers);
-       KUNIT_EXPECT_EQ(test, 0l, nr_integers);
+       KUNIT_EXPECT_EQ(test, (ssize_t)0, nr_integers);
        KUNIT_EXPECT_PTR_EQ(test, (unsigned long *)NULL, answers);
        kfree(answers);
 }
diff --git a/mm/damon.c b/mm/damon.c
index 108476b07555..c6c5b975f1f5 100644
--- a/mm/damon.c
+++ b/mm/damon.c
@@ -509,8 +509,8 @@ static bool damon_check_reset_time_interval(struct timespec64 *baseline,
        struct timespec64 now;

        ktime_get_coarse_ts64(&now);
-       if ((timespec64_to_ns(&now) - timespec64_to_ns(baseline)) / 1000 <
-                       interval)
+       if ((timespec64_to_ns(&now) - timespec64_to_ns(baseline)) <
+                       interval * 1000)
                return false;
        *baseline = now;
        return true;

> 
> ---
> 0-DAY kernel test infrastructure                 Open Source Technology Center
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
> 
> [-- Attachment #2: .config.gz --]
> [-- Type: application/gzip, Size: 71233 bytes --]

  reply	other threads:[~2020-02-05 16:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04  6:23 [PATCH v3 00/11] Introduce Data Access MONitor (DAMON) sj38.park
2020-02-04  6:23 ` [PATCH v3 01/11] " sj38.park
2020-02-04  6:23 ` [PATCH v3 02/11] mm/damon: Implement region based sampling sj38.park
2020-02-04  6:23 ` [PATCH v3 03/11] mm/damon: Adaptively adjust regions sj38.park
2020-02-04  6:23 ` [PATCH v3 04/11] mm/damon: Apply dynamic memory mapping changes sj38.park
2020-02-04  6:23 ` [PATCH v3 05/11] mm/damon: Implement kernel space API sj38.park
2020-02-04  6:23 ` [PATCH v3 06/11] mm/damon: Add debugfs interface sj38.park
2020-02-04  6:23 ` [PATCH v3 07/11] mm/damon: Add a tracepoint for result writing sj38.park
2020-02-04  6:23 ` [PATCH v3 08/11] mm/damon: Add minimal user-space tools sj38.park
2020-02-04  6:23 ` [PATCH v3 09/11] Documentation/admin-guide/mm: Add a document for DAMON sj38.park
2020-02-04  6:23 ` [PATCH v3 10/11] mm/damon: Add kunit tests sj38.park
2020-02-05 10:38   ` kbuild test robot
2020-02-05 16:47     ` SeongJae Park [this message]
2020-02-04  6:23 ` [PATCH v3 11/11] MAINTAINERS: Update for DAMON sj38.park

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=20200205164709.19920-1-sj38.park@gmail.com \
    --to=sj38.park@gmail.com \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=amit@kernel.org \
    --cc=brendan.d.gregg@gmail.com \
    --cc=brendanhiggins@google.com \
    --cc=cai@lca.pw \
    --cc=colin.king@canonical.com \
    --cc=corbet@lwn.net \
    --cc=dwmw@amazon.com \
    --cc=jolsa@redhat.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kirill@shutemov.name \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=mark.rutland@arm.com \
    --cc=mgorman@suse.de \
    --cc=minchan@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sjpark@amazon.de \
    --cc=vdavydov.dev@gmail.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;
as well as URLs for NNTP newsgroup(s).