public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Bongkyu Kim <bongkyu7.kim@samsung.com>,
	peterz@infradead.org, mingo@redhat.com, will@kernel.org,
	longman@redhat.com, boqun.feng@gmail.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org, jwook1.kim@samsung.com,
	lakkyung.jung@samsung.com, Bongkyu Kim <bongkyu7.kim@samsung.com>
Subject: Re: [PATCH] locking/rwsem: Optionally re-enable reader optimistic spinning
Date: Thu, 1 Jun 2023 15:10:13 +0800	[thread overview]
Message-ID: <202306011420.8opqhG4p-lkp@intel.com> (raw)
In-Reply-To: <20230531003436.7082-1-bongkyu7.kim@samsung.com>

Hi Bongkyu,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/locking/core]
[also build test WARNING on linus/master v6.4-rc4 next-20230601]
[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/Bongkyu-Kim/locking-rwsem-Optionally-re-enable-reader-optimistic-spinning/20230531-083658
base:   tip/locking/core
patch link:    https://lore.kernel.org/r/20230531003436.7082-1-bongkyu7.kim%40samsung.com
patch subject: [PATCH] locking/rwsem: Optionally re-enable reader optimistic spinning
config: x86_64-randconfig-x063-20230531 (https://download.01.org/0day-ci/archive/20230601/202306011420.8opqhG4p-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/8c4098eb89be5b82aded3d17b22f78013454d058
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Bongkyu-Kim/locking-rwsem-Optionally-re-enable-reader-optimistic-spinning/20230531-083658
        git checkout 8c4098eb89be5b82aded3d17b22f78013454d058
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/events/ arch/x86/kernel/fpu/ drivers/of/ drivers/usb/host/ kernel/locking/ kernel/sched/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306011420.8opqhG4p-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/locking/rwsem.c:1163:24: warning: incompatible pointer to integer conversion passing 'struct rw_semaphore *' to parameter of type 'int' [-Wint-conversion]
               rwsem_no_spinners(sem)) {
                                 ^~~
   kernel/locking/rwsem.c:332:1: warning: unused function 'rwsem_owner_flags' [-Wunused-function]
   rwsem_owner_flags(struct rw_semaphore *sem, unsigned long *pflags)
   ^
   2 warnings generated.


vim +1163 kernel/locking/rwsem.c

  1133	
  1134	/*
  1135	 * Wait for the read lock to be granted
  1136	 */
  1137	static struct rw_semaphore __sched *
  1138	rwsem_down_read_slowpath(struct rw_semaphore *sem, long count, unsigned int state)
  1139	{
  1140		long owner, adjustment = -RWSEM_READER_BIAS;
  1141		long rcnt = (count >> RWSEM_READER_SHIFT);
  1142		struct rwsem_waiter waiter;
  1143		DEFINE_WAKE_Q(wake_q);
  1144	
  1145		/*
  1146		 * To prevent a constant stream of readers from starving a sleeping
  1147		 * waiter, don't attempt optimistic spinning if the lock is currently
  1148		 * owned by readers.
  1149		 */
  1150		owner = atomic_long_read(&sem->owner);
  1151		if ((owner & RWSEM_READER_OWNED) && (rcnt > 1) &&
  1152		   !(count & RWSEM_WRITER_LOCKED))
  1153			goto queue;
  1154	
  1155		/*
  1156		 * Reader optimistic lock stealing
  1157		 *
  1158		 * We can take the read lock directly without doing
  1159		 * rwsem_optimistic_spin() if the conditions are right.
  1160		 * Also wake up other readers if it is the first reader.
  1161		 */
  1162		if (!(count & (RWSEM_WRITER_LOCKED | RWSEM_FLAG_HANDOFF)) &&
> 1163		    rwsem_no_spinners(sem)) {
  1164			rwsem_set_reader_owned(sem);
  1165			lockevent_inc(rwsem_rlock_steal);
  1166			if (rcnt == 1)
  1167				goto wake_readers;
  1168			return sem;
  1169		}
  1170	

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

  parent reply	other threads:[~2023-06-01  7:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230531003446epcas2p1fc55e0439a9c667685d495cd5f5b2e93@epcas2p1.samsung.com>
2023-05-31  0:34 ` [PATCH] locking/rwsem: Optionally re-enable reader optimistic spinning Bongkyu Kim
2023-05-31 16:45   ` kernel test robot
2023-06-01  7:10   ` kernel test robot [this message]
     [not found]   ` <d5b65c4b-7232-e5a7-27ae-b8efab037396@redhat.com>
     [not found]     ` <20230601012246.GA8364@KORCO045595.samsungds.net>
     [not found]       ` <8e11066a-017f-a190-39de-17f92128e42f@redhat.com>
2023-06-02  0:46         ` Bongkyu Kim
2023-06-13  4:36         ` Bongkyu Kim

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=202306011420.8opqhG4p-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bongkyu7.kim@samsung.com \
    --cc=boqun.feng@gmail.com \
    --cc=jwook1.kim@samsung.com \
    --cc=lakkyung.jung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=will@kernel.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