Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
From: SeongJae Park <sjpark@amazon.com>
To: kbuild test robot <lkp@intel.com>
Cc: <sjpark@amazon.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>,
	<sj38.park@gmail.com>, <vdavydov.dev@gmail.com>,
	<linux-mm@kvack.org>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: Re: [PATCH v4 10/11] mm/damon: Add kunit tests
Date: Fri, 14 Feb 2020 12:19:07 +0100
Message-ID: <20200214111907.7017-1-sjpark@amazon.com> (raw)
In-Reply-To: <202002140021.Pr9vTFO6%lkp@intel.com> (raw)

On Fri, 14 Feb 2020 00:56:50 +0800 kbuild test robot <lkp@intel.com> wrote:

> [-- Attachment #1: Type: text/plain, Size: 3435 bytes --]
> 
> Hi,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on d5226fa6dbae0569ee43ecfc08bdcd6770fc4755]
> 
> url:    https://github.com/0day-ci/linux/commits/sjpark-amazon-com/Introduce-Data-Access-MONitor-DAMON/20200213-003254
> base:    d5226fa6dbae0569ee43ecfc08bdcd6770fc4755
> config: x86_64-allmodconfig (attached as .config)
> compiler: gcc-7 (Debian 7.5.0-4) 7.5.0
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from mm/damon.c:19:0:
> >> include/linux/module.h:131:42: error: redefinition of '__inittest'
>      static inline initcall_t __maybe_unused __inittest(void)  \
>                                              ^
>    include/linux/module.h:124:28: note: in expansion of macro 'module_init'
>     #define late_initcall(fn)  module_init(fn)
>                                ^~~~~~~~~~~
>    include/kunit/test.h:224:2: note: in expansion of macro 'late_initcall'
>      late_initcall(kunit_suite_init##suite)
>      ^~~~~~~~~~~~~
>    mm/damon-test.h:600:1: note: in expansion of macro 'kunit_test_suite'
>     kunit_test_suite(damon_test_suite);
>     ^~~~~~~~~~~~~~~~
>    include/linux/module.h:131:42: note: previous definition of '__inittest' was here
>      static inline initcall_t __maybe_unused __inittest(void)  \
>                                              ^
>    mm/damon.c:1406:1: note: in expansion of macro 'module_init'
>     module_init(damon_init);
>     ^~~~~~~~~~~
> >> include/linux/module.h:133:6: error: redefinition of 'init_module'
>      int init_module(void) __copy(initfn) __attribute__((alias(#initfn)));
>          ^
>    include/linux/module.h:124:28: note: in expansion of macro 'module_init'
>     #define late_initcall(fn)  module_init(fn)
>                                ^~~~~~~~~~~
>    include/kunit/test.h:224:2: note: in expansion of macro 'late_initcall'
>      late_initcall(kunit_suite_init##suite)
>      ^~~~~~~~~~~~~
>    mm/damon-test.h:600:1: note: in expansion of macro 'kunit_test_suite'
>     kunit_test_suite(damon_test_suite);
>     ^~~~~~~~~~~~~~~~
>    include/linux/module.h:133:6: note: previous definition of 'init_module' was here
>      int init_module(void) __copy(initfn) __attribute__((alias(#initfn)));
>          ^
>    mm/damon.c:1406:1: note: in expansion of macro 'module_init'
>     module_init(damon_init);
>     ^~~~~~~~~~~
> 
> vim +/__inittest +131 include/linux/module.h
> 
> 0fd972a7d91d6e1 Paul Gortmaker 2015-05-01  128  
> 0fd972a7d91d6e1 Paul Gortmaker 2015-05-01  129  /* Each module must use one module_init(). */
> 0fd972a7d91d6e1 Paul Gortmaker 2015-05-01  130  #define module_init(initfn)					\
> 1f318a8bafcfba9 Arnd Bergmann  2017-02-01 @131  	static inline initcall_t __maybe_unused __inittest(void)		\
> 0fd972a7d91d6e1 Paul Gortmaker 2015-05-01  132  	{ return initfn; }					\
> a6e60d84989fa0e Miguel Ojeda   2019-01-19 @133  	int init_module(void) __copy(initfn) __attribute__((alias(#initfn)));
> 0fd972a7d91d6e1 Paul Gortmaker 2015-05-01  134  
> 
> :::::: The code at line 131 was first introduced by commit
> :::::: 1f318a8bafcfba9f0d623f4870c4e890fd22e659 modules: mark __inittest/__exittest as __maybe_unused
> 
> :::::: TO: Arnd Bergmann <arnd@arndb.de>
> :::::: CC: Jessica Yu <jeyu@redhat.com>

Thank you for finding yet another problem!  The problem is reproducible if
`CONFIG_DAMON=m` but `CONFIG_DAMON_KUNIT_TEST=y`.  Will fix this problem by
simply adjusting the dependency of the tests as below.  It will avoid the build
of the test code when DAMON is configured to be built as a module::

    diff --git a/mm/Kconfig b/mm/Kconfig
    index b279ab9c78d0..1a745ce0cbcb 100644
    --- a/mm/Kconfig
    +++ b/mm/Kconfig
    @@ -753,7 +753,7 @@ config DAMON
    
     config DAMON_KUNIT_TEST
            bool "Test for damon"
    -       depends on DAMON && KUNIT
    +       depends on DAMON=y && KUNIT
            help
              This builds the DAMON Kunit test suite.

I think this is fair enough as KUNIT is not exporting its main functions to
modules and thus cannot be used by modules anyway.


Thanks,
SeongJae Park

> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> 
> [-- Attachment #2: .config.gz --]
> [-- Type: application/gzip, Size: 71807 bytes --]


  reply index

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 14:48 [PATCH v4 00/11] Introduce Data Access MONitor (DAMON) sjpark
2020-02-10 14:48 ` [PATCH v4 01/11] mm: " sjpark
2020-02-10 14:48 ` [PATCH v4 02/11] mm/damon: Implement region based sampling sjpark
2020-02-10 14:48 ` [PATCH v4 03/11] mm/damon: Adaptively adjust regions sjpark
2020-02-10 14:48 ` [PATCH v4 04/11] mm/damon: Apply dynamic memory mapping changes sjpark
2020-02-10 14:50 ` [PATCH v4 05/11] mm/damon: Implement kernel space API sjpark
2020-02-12 23:21   ` kbuild test robot
2020-02-13  9:09     ` SeongJae Park
2020-02-10 14:51 ` [PATCH v4 06/11] mm/damon: Add debugfs interface sjpark
2020-02-10 14:52 ` [PATCH v4 07/11] mm/damon: Add a tracepoint for result writing sjpark
2020-02-10 14:52 ` [PATCH v4 08/11] tools: Add a minimal user-space tool for DAMON sjpark
2020-02-10 14:53 ` [PATCH v4 09/11] Documentation/admin-guide/mm: Add a document " sjpark
2020-02-10 14:53 ` [PATCH v4 10/11] mm/damon: Add kunit tests sjpark
2020-02-11 22:21   ` Brendan Higgins
2020-02-13 16:56   ` kbuild test robot
2020-02-14 11:19     ` SeongJae Park [this message]
2020-02-15  4:07   ` Randy Dunlap
2020-02-15  6:52     ` SeongJae Park
2020-02-10 14:54 ` [PATCH v4 11/11] MAINTAINERS: Update for DAMON sjpark

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=20200214111907.7017-1-sjpark@amazon.com \
    --to=sjpark@amazon.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=sj38.park@gmail.com \
    --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

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git