All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: lizhe.67@bytedance.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC 1/2] rwsem: introduce upgrade_read interface
Date: Sun, 20 Oct 2024 06:59:32 +0800	[thread overview]
Message-ID: <202410200646.zcyZ4KjG-lkp@intel.com> (raw)
In-Reply-To: <20241016043600.35139-2-lizhe.67@bytedance.com>

Hi,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on tip/locking/core]
[also build test ERROR on akpm-mm/mm-everything linus/master v6.12-rc3 next-20241018]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/lizhe-67-bytedance-com/rwsem-introduce-upgrade_read-interface/20241016-123810
base:   tip/locking/core
patch link:    https://lore.kernel.org/r/20241016043600.35139-2-lizhe.67%40bytedance.com
patch subject: [RFC 1/2] rwsem: introduce upgrade_read interface
config: i386-buildonly-randconfig-003-20241020 (https://download.01.org/0day-ci/archive/20241020/202410200646.zcyZ4KjG-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241020/202410200646.zcyZ4KjG-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410200646.zcyZ4KjG-lkp@intel.com/

All errors (new ones prefixed by >>):

>> kernel/locking/rwsem.c:1662:52: error: no member named 'count' in 'struct rw_semaphore'
    1662 |         atomic_long_andnot(RWSEM_FLAG_UPGRADE_READ, &sem->count);
         |                                                      ~~~  ^
>> kernel/locking/rwsem.c:1662:21: error: use of undeclared identifier 'RWSEM_FLAG_UPGRADE_READ'
    1662 |         atomic_long_andnot(RWSEM_FLAG_UPGRADE_READ, &sem->count);
         |                            ^
   kernel/locking/rwsem.c:1674:31: error: no member named 'count' in 'struct rw_semaphore'
    1674 |         tmp = atomic_long_read(&sem->count);
         |                                 ~~~  ^
>> kernel/locking/rwsem.c:1676:14: error: use of undeclared identifier 'RWSEM_WRITER_MASK'
    1676 |                 if (tmp & (RWSEM_WRITER_MASK | RWSEM_FLAG_UPGRADE_READ)) {
         |                            ^
   kernel/locking/rwsem.c:1676:34: error: use of undeclared identifier 'RWSEM_FLAG_UPGRADE_READ'
    1676 |                 if (tmp & (RWSEM_WRITER_MASK | RWSEM_FLAG_UPGRADE_READ)) {
         |                                                ^
   kernel/locking/rwsem.c:1680:42: error: no member named 'count' in 'struct rw_semaphore'
    1680 |         } while (!atomic_long_try_cmpxchg(&sem->count, &tmp,
         |                                            ~~~  ^
   kernel/locking/rwsem.c:1681:9: error: use of undeclared identifier 'RWSEM_FLAG_UPGRADE_READ'
    1681 |                 tmp + RWSEM_FLAG_UPGRADE_READ + RWSEM_WRITER_LOCKED - RWSEM_READER_BIAS));
         |                       ^
>> kernel/locking/rwsem.c:1681:35: error: use of undeclared identifier 'RWSEM_WRITER_LOCKED'
    1681 |                 tmp + RWSEM_FLAG_UPGRADE_READ + RWSEM_WRITER_LOCKED - RWSEM_READER_BIAS));
         |                                                 ^
>> kernel/locking/rwsem.c:1681:57: error: use of undeclared identifier 'RWSEM_READER_BIAS'
    1681 |                 tmp + RWSEM_FLAG_UPGRADE_READ + RWSEM_WRITER_LOCKED - RWSEM_READER_BIAS));
         |                                                                       ^
>> kernel/locking/rwsem.c:1683:13: error: use of undeclared identifier 'RWSEM_READER_MASK'
    1683 |         if ((tmp & RWSEM_READER_MASK) == RWSEM_READER_BIAS) {
         |                    ^
   kernel/locking/rwsem.c:1683:35: error: use of undeclared identifier 'RWSEM_READER_BIAS'
    1683 |         if ((tmp & RWSEM_READER_MASK) == RWSEM_READER_BIAS) {
         |                                          ^
>> kernel/locking/rwsem.c:1687:3: error: call to undeclared function 'rwsem_set_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1687 |                 rwsem_set_owner(sem);
         |                 ^
>> kernel/locking/rwsem.c:1692:26: error: no member named 'wait_lock' in 'struct rw_semaphore'
    1692 |         raw_spin_lock_irq(&sem->wait_lock);
         |                            ~~~  ^
   include/linux/spinlock.h:274:53: note: expanded from macro 'raw_spin_lock_irq'
     274 | #define raw_spin_lock_irq(lock)         _raw_spin_lock_irq(lock)
         |                                                            ^~~~
>> kernel/locking/rwsem.c:1693:2: error: call to undeclared function 'rwsem_set_owner_upgrade'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1693 |         rwsem_set_owner_upgrade(sem);
         |         ^
   kernel/locking/rwsem.c:1698:32: error: no member named 'count' in 'struct rw_semaphore'
    1698 |                 if (!(atomic_long_read(&sem->count) & RWSEM_READER_MASK))
         |                                         ~~~  ^
   kernel/locking/rwsem.c:1698:41: error: use of undeclared identifier 'RWSEM_READER_MASK'
    1698 |                 if (!(atomic_long_read(&sem->count) & RWSEM_READER_MASK))
         |                                                       ^
   kernel/locking/rwsem.c:1700:29: error: no member named 'wait_lock' in 'struct rw_semaphore'
    1700 |                 raw_spin_unlock_irq(&sem->wait_lock);
         |                                      ~~~  ^
   include/linux/spinlock.h:277:56: note: expanded from macro 'raw_spin_unlock_irq'
     277 | #define raw_spin_unlock_irq(lock)       _raw_spin_unlock_irq(lock)
         |                                                              ^~~~
   kernel/locking/rwsem.c:1703:27: error: no member named 'wait_lock' in 'struct rw_semaphore'
    1703 |                 raw_spin_lock_irq(&sem->wait_lock);
         |                                    ~~~  ^
   include/linux/spinlock.h:274:53: note: expanded from macro 'raw_spin_lock_irq'
     274 | #define raw_spin_lock_irq(lock)         _raw_spin_lock_irq(lock)
         |                                                            ^~~~
   kernel/locking/rwsem.c:1707:2: error: call to undeclared function 'rwsem_set_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1707 |         rwsem_set_owner(sem);
         |         ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.


vim +1662 kernel/locking/rwsem.c

  1659	
  1660	static inline void rwsem_clear_upgrade_flag(struct rw_semaphore *sem)
  1661	{
> 1662		atomic_long_andnot(RWSEM_FLAG_UPGRADE_READ, &sem->count);
  1663	}
  1664	
  1665	/*
  1666	 * upgrade read lock to write lock
  1667	 */
  1668	static inline int __upgrade_read(struct rw_semaphore *sem)
  1669	{
  1670		long tmp;
  1671	
  1672		preempt_disable();
  1673	
  1674		tmp = atomic_long_read(&sem->count);
  1675		do {
> 1676			if (tmp & (RWSEM_WRITER_MASK | RWSEM_FLAG_UPGRADE_READ)) {
  1677				preempt_enable();
  1678				return -EBUSY;
  1679			}
  1680		} while (!atomic_long_try_cmpxchg(&sem->count, &tmp,
> 1681			tmp + RWSEM_FLAG_UPGRADE_READ + RWSEM_WRITER_LOCKED - RWSEM_READER_BIAS));
  1682	
> 1683		if ((tmp & RWSEM_READER_MASK) == RWSEM_READER_BIAS) {
  1684			/* fast path */
  1685			DEBUG_RWSEMS_WARN_ON(sem->magic != sem, sem);
  1686			rwsem_clear_upgrade_flag(sem);
> 1687			rwsem_set_owner(sem);
  1688			preempt_enable();
  1689			return 0;
  1690		}
  1691		/* slow path */
> 1692		raw_spin_lock_irq(&sem->wait_lock);
> 1693		rwsem_set_owner_upgrade(sem);
  1694	
  1695		set_current_state(TASK_UNINTERRUPTIBLE);
  1696	
  1697		for (;;) {
  1698			if (!(atomic_long_read(&sem->count) & RWSEM_READER_MASK))
  1699				break;
  1700			raw_spin_unlock_irq(&sem->wait_lock);
  1701			schedule_preempt_disabled();
  1702			set_current_state(TASK_UNINTERRUPTIBLE);
  1703			raw_spin_lock_irq(&sem->wait_lock);
  1704		}
  1705	
  1706		rwsem_clear_upgrade_flag(sem);
  1707		rwsem_set_owner(sem);
  1708		__set_current_state(TASK_RUNNING);
  1709		raw_spin_unlock_irq(&sem->wait_lock);
  1710		preempt_enable();
  1711		return 0;
  1712	}
  1713	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2024-10-19 23:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16  4:35 [RFC 0/2] rwsem: introduce upgrade_read interface lizhe.67
2024-10-16  4:35 ` [RFC 1/2] " lizhe.67
2024-10-16  4:56   ` Christoph Hellwig
2024-10-16  7:33     ` lizhe.67
2024-10-16  7:36       ` Christoph Hellwig
2024-10-16  8:00         ` lizhe.67
2024-10-16  8:03           ` Christoph Hellwig
2024-10-16  8:13             ` lizhe.67
2024-10-16 11:51     ` Matthew Wilcox
2024-10-16 12:21       ` Christoph Hellwig
2024-10-16 11:49   ` Matthew Wilcox
2024-10-17  6:23     ` lizhe.67
2024-10-16 14:23   ` Waiman Long
2024-10-16 18:05     ` Matthew Wilcox
2024-10-16 18:39       ` Waiman Long
2024-10-17  6:46     ` lizhe.67
2024-10-17 15:05     ` Christoph Hellwig
2024-10-17 17:36       ` Waiman Long
2024-10-18  5:06         ` Christoph Hellwig
2024-10-19 22:59   ` kernel test robot [this message]
2024-10-16  4:36 ` [RFC 2/2] khugepaged: use upgrade_read() to optimize collapse_huge_page lizhe.67
2024-10-16 11:53   ` Matthew Wilcox
2024-10-17  6:18     ` lizhe.67
2024-10-17 13:20       ` Matthew Wilcox
2024-10-18  6:37         ` lizhe.67
2024-10-23  7:27   ` kernel test robot
2024-10-16  8:09 ` [RFC 0/2] rwsem: introduce upgrade_read interface Peter Zijlstra
2024-10-16  8:53   ` lizhe.67
2024-10-16 12:10     ` Peter Zijlstra

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=202410200646.zcyZ4KjG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=lizhe.67@bytedance.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.