mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>
Cc: kbuild-all@01.org, peterz@infradead.org,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] locking/ww_mutex: add ww_mutex_is_owned_by function v4
Date: Wed, 21 Feb 2018 02:33:47 +0800	[thread overview]
Message-ID: <201802210231.IRtd7Bkg%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180220144946.2510-1-christian.koenig@amd.com>

[-- Attachment #1: Type: text/plain, Size: 14701 bytes --]

Hi Christian,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.16-rc2 next-20180220]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Christian-K-nig/locking-ww_mutex-add-ww_mutex_is_owned_by-function-v4/20180221-021317
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   In file included from kernel/locking/mutex.c:21:0:
   include/linux/ww_mutex.h: In function 'ww_mutex_is_owned_by':
>> include/linux/ww_mutex.h:380:0: error: unterminated argument list invoking macro "likely"
    #endif
    
>> include/linux/ww_mutex.h:377:3: error: 'likely' undeclared (first use in this function)
      likely(READ_ONCE(lock->ctx) == NULL;
      ^~~~~~
   include/linux/ww_mutex.h:377:3: note: each undeclared identifier is reported only once for each function it appears in
   In file included from include/linux/thread_info.h:13:0,
                    from arch/x86/include/asm/preempt.h:7,
                    from include/linux/preempt.h:81,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:11,
                    from include/linux/sched/signal.h:5,
                    from kernel/locking/mutex.c:22:
>> include/linux/restart_block.h:11:1: error: expected ';' before 'struct'
    struct timespec;
    ^~~~~~
>> include/linux/restart_block.h:12:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    struct compat_timespec;
    ^~~~~~
   In file included from include/linux/thread_info.h:38:0,
                    from arch/x86/include/asm/preempt.h:7,
                    from include/linux/preempt.h:81,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:11,
                    from include/linux/sched/signal.h:5,
                    from kernel/locking/mutex.c:22:
>> arch/x86/include/asm/thread_info.h:170:19: error: invalid storage class for function 'arch_within_stack_frames'
    static inline int arch_within_stack_frames(const void * const stack,
                      ^~~~~~~~~~~~~~~~~~~~~~~~
   In file included from arch/x86/include/asm/preempt.h:7:0,
                    from include/linux/preempt.h:81,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:11,
                    from include/linux/sched/signal.h:5,
                    from kernel/locking/mutex.c:22:
>> include/linux/thread_info.h:57:20: error: invalid storage class for function 'set_ti_thread_flag'
    static inline void set_ti_thread_flag(struct thread_info *ti, int flag)
                       ^~~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:62:20: error: invalid storage class for function 'clear_ti_thread_flag'
    static inline void clear_ti_thread_flag(struct thread_info *ti, int flag)
                       ^~~~~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:67:19: error: invalid storage class for function 'test_and_set_ti_thread_flag'
    static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:72:19: error: invalid storage class for function 'test_and_clear_ti_thread_flag'
    static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:77:19: error: invalid storage class for function 'test_ti_thread_flag'
    static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
                      ^~~~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:115:20: error: invalid storage class for function 'check_object_size'
    static inline void check_object_size(const void *ptr, unsigned long n,
                       ^~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:125:20: error: invalid storage class for function 'copy_overflow'
    static inline void copy_overflow(int size, unsigned long count)
                       ^~~~~~~~~~~~~
>> include/linux/thread_info.h:131:1: error: invalid storage class for function 'check_copy_size'
    check_copy_size(const void *addr, size_t bytes, bool is_source)
    ^~~~~~~~~~~~~~~
   In file included from include/asm-generic/percpu.h:7:0,
                    from arch/x86/include/asm/percpu.h:543,
                    from arch/x86/include/asm/current.h:6,
                    from include/linux/mutex.h:14,
                    from kernel/locking/mutex.c:20:
>> arch/x86/include/asm/preempt.h:9:22: error: section attribute cannot be specified for local variables
    DECLARE_PER_CPU(int, __preempt_count);
                         ^
   include/linux/percpu-defs.h:101:44: note: in definition of macro 'DECLARE_PER_CPU_SECTION'
     extern __PCPU_ATTRS(sec) __typeof__(type) name
                                               ^~~~
>> arch/x86/include/asm/preempt.h:9:1: note: in expansion of macro 'DECLARE_PER_CPU'
    DECLARE_PER_CPU(int, __preempt_count);
    ^~~~~~~~~~~~~~~
   In file included from include/linux/preempt.h:81:0,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:11,
                    from include/linux/sched/signal.h:5,
                    from kernel/locking/mutex.c:22:
>> arch/x86/include/asm/preempt.h:21:28: error: invalid storage class for function 'preempt_count'
    static __always_inline int preempt_count(void)
                               ^~~~~~~~~~~~~
>> arch/x86/include/asm/preempt.h:26:29: error: invalid storage class for function 'preempt_count_set'
    static __always_inline void preempt_count_set(int pc)
                                ^~~~~~~~~~~~~~~~~
>> arch/x86/include/asm/preempt.h:55:29: error: invalid storage class for function 'set_preempt_need_resched'
    static __always_inline void set_preempt_need_resched(void)
                                ^~~~~~~~~~~~~~~~~~~~~~~~
>> arch/x86/include/asm/preempt.h:60:29: error: invalid storage class for function 'clear_preempt_need_resched'
    static __always_inline void clear_preempt_need_resched(void)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> arch/x86/include/asm/preempt.h:65:29: error: invalid storage class for function 'test_preempt_need_resched'
    static __always_inline bool test_preempt_need_resched(void)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~
--
   In file included from kernel//locking/mutex.c:21:0:
   include/linux/ww_mutex.h: In function 'ww_mutex_is_owned_by':
>> include/linux/ww_mutex.h:380:0: error: unterminated argument list invoking macro "likely"
    #endif
    
>> include/linux/ww_mutex.h:377:3: error: 'likely' undeclared (first use in this function)
      likely(READ_ONCE(lock->ctx) == NULL;
      ^~~~~~
   include/linux/ww_mutex.h:377:3: note: each undeclared identifier is reported only once for each function it appears in
   In file included from include/linux/thread_info.h:13:0,
                    from arch/x86/include/asm/preempt.h:7,
                    from include/linux/preempt.h:81,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:11,
                    from include/linux/sched/signal.h:5,
                    from kernel//locking/mutex.c:22:
>> include/linux/restart_block.h:11:1: error: expected ';' before 'struct'
    struct timespec;
    ^~~~~~
>> include/linux/restart_block.h:12:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    struct compat_timespec;
    ^~~~~~
   In file included from include/linux/thread_info.h:38:0,
                    from arch/x86/include/asm/preempt.h:7,
                    from include/linux/preempt.h:81,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:11,
                    from include/linux/sched/signal.h:5,
                    from kernel//locking/mutex.c:22:
>> arch/x86/include/asm/thread_info.h:170:19: error: invalid storage class for function 'arch_within_stack_frames'
    static inline int arch_within_stack_frames(const void * const stack,
                      ^~~~~~~~~~~~~~~~~~~~~~~~
   In file included from arch/x86/include/asm/preempt.h:7:0,
                    from include/linux/preempt.h:81,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:11,
                    from include/linux/sched/signal.h:5,
                    from kernel//locking/mutex.c:22:
>> include/linux/thread_info.h:57:20: error: invalid storage class for function 'set_ti_thread_flag'
    static inline void set_ti_thread_flag(struct thread_info *ti, int flag)
                       ^~~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:62:20: error: invalid storage class for function 'clear_ti_thread_flag'
    static inline void clear_ti_thread_flag(struct thread_info *ti, int flag)
                       ^~~~~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:67:19: error: invalid storage class for function 'test_and_set_ti_thread_flag'
    static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:72:19: error: invalid storage class for function 'test_and_clear_ti_thread_flag'
    static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:77:19: error: invalid storage class for function 'test_ti_thread_flag'
    static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
                      ^~~~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:115:20: error: invalid storage class for function 'check_object_size'
    static inline void check_object_size(const void *ptr, unsigned long n,
                       ^~~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:125:20: error: invalid storage class for function 'copy_overflow'
    static inline void copy_overflow(int size, unsigned long count)
                       ^~~~~~~~~~~~~
>> include/linux/thread_info.h:131:1: error: invalid storage class for function 'check_copy_size'
    check_copy_size(const void *addr, size_t bytes, bool is_source)
    ^~~~~~~~~~~~~~~
   In file included from include/asm-generic/percpu.h:7:0,
                    from arch/x86/include/asm/percpu.h:543,
                    from arch/x86/include/asm/current.h:6,
                    from include/linux/mutex.h:14,
                    from kernel//locking/mutex.c:20:
>> arch/x86/include/asm/preempt.h:9:22: error: section attribute cannot be specified for local variables
    DECLARE_PER_CPU(int, __preempt_count);
                         ^
   include/linux/percpu-defs.h:101:44: note: in definition of macro 'DECLARE_PER_CPU_SECTION'
     extern __PCPU_ATTRS(sec) __typeof__(type) name
                                               ^~~~
>> arch/x86/include/asm/preempt.h:9:1: note: in expansion of macro 'DECLARE_PER_CPU'
    DECLARE_PER_CPU(int, __preempt_count);
    ^~~~~~~~~~~~~~~
   In file included from include/linux/preempt.h:81:0,
                    from include/linux/rcupdate.h:40,
                    from include/linux/rculist.h:11,
                    from include/linux/sched/signal.h:5,
                    from kernel//locking/mutex.c:22:
>> arch/x86/include/asm/preempt.h:21:28: error: invalid storage class for function 'preempt_count'
    static __always_inline int preempt_count(void)
                               ^~~~~~~~~~~~~
>> arch/x86/include/asm/preempt.h:26:29: error: invalid storage class for function 'preempt_count_set'
    static __always_inline void preempt_count_set(int pc)
                                ^~~~~~~~~~~~~~~~~
>> arch/x86/include/asm/preempt.h:55:29: error: invalid storage class for function 'set_preempt_need_resched'
    static __always_inline void set_preempt_need_resched(void)
                                ^~~~~~~~~~~~~~~~~~~~~~~~
>> arch/x86/include/asm/preempt.h:60:29: error: invalid storage class for function 'clear_preempt_need_resched'
    static __always_inline void clear_preempt_need_resched(void)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> arch/x86/include/asm/preempt.h:65:29: error: invalid storage class for function 'test_preempt_need_resched'
    static __always_inline bool test_preempt_need_resched(void)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~

vim +/likely +380 include/linux/ww_mutex.h

1b375dc3 Maarten Lankhorst 2013-07-05  360  
6cb2b111 Christian König   2018-02-20  361  /**
6cb2b111 Christian König   2018-02-20  362   * ww_mutex_is_owned_by - is the w/w mutex locked by this task in that context
6cb2b111 Christian König   2018-02-20  363   * @lock: the mutex to be queried
6cb2b111 Christian König   2018-02-20  364   * @ctx: the w/w acquire context to test
6cb2b111 Christian König   2018-02-20  365   *
6cb2b111 Christian König   2018-02-20  366   * If @ctx is not NULL test if the mutex is owned by this context.
6cb2b111 Christian König   2018-02-20  367   * If @ctx is NULL test if the mutex is owned by the current thread and not
6cb2b111 Christian König   2018-02-20  368   * locked in any context.
6cb2b111 Christian König   2018-02-20  369   */
6cb2b111 Christian König   2018-02-20  370  static inline bool ww_mutex_is_owned_by(struct ww_mutex *lock,
6cb2b111 Christian König   2018-02-20  371  					struct ww_acquire_ctx *ctx)
6cb2b111 Christian König   2018-02-20  372  {
6cb2b111 Christian König   2018-02-20  373  	if (ctx)
6cb2b111 Christian König   2018-02-20  374  		return likely(READ_ONCE(lock->ctx) == ctx);
6cb2b111 Christian König   2018-02-20  375  
6cb2b111 Christian König   2018-02-20  376  	return likely(__mutex_owner(&lock->base) == current) &&
6cb2b111 Christian König   2018-02-20 @377  		likely(READ_ONCE(lock->ctx) == NULL;
6cb2b111 Christian König   2018-02-20  378  }
6cb2b111 Christian König   2018-02-20  379  
1b375dc3 Maarten Lankhorst 2013-07-05 @380  #endif

:::::: The code at line 380 was first introduced by commit
:::::: 1b375dc30710180c4b88cc59caba6e3481ec5c8b mutex: Move ww_mutex definitions to ww_mutex.h

:::::: TO: Maarten Lankhorst <maarten.lankhorst@canonical.com>
:::::: CC: Ingo Molnar <mingo@kernel.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 6763 bytes --]

  parent reply	other threads:[~2018-02-20 18:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 14:49 Christian König
2018-02-20 15:10 ` Eric Engestrom
2018-02-20 16:30 ` Daniel Vetter
2018-02-20 18:33 ` kbuild test robot [this message]
2018-02-20 19:15 ` kbuild test robot

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=201802210231.IRtd7Bkg%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®