All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [block:for-5.5/io_uring-wq 11/11] fs/io-wq.c:291:2-11: second lock on line 291 (fwd)
       [not found] <24160b11-5bcf-0b52-4db1-471527f58e37@kernel.dk>
@ 2019-10-24 13:03 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2019-10-24 13:03 UTC (permalink / raw)
  To: kbuild-all

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



On Thu, 24 Oct 2019, Jens Axboe wrote:

> On 10/24/19 2:12 AM, Julia Lawall wrote:
> > Hello,
> >
> > This is actually complaining about the continues on lines 295 and 298.  I
> > guess the calls to io_wq_run_queue and __io_worker_idle release the lock
> > in the case of success?
>
> Right, and I haven't found a good way to annotate that. Any suggestions?

Coccinelle doesn't pick up on annotations at the moment, so the only thing
I can suggest is a comment.

julia

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [block:for-5.5/io_uring-wq 11/11] fs/io-wq.c:291:2-11: second lock on line 291 (fwd)
@ 2019-10-24  8:12 Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2019-10-24  8:12 UTC (permalink / raw)
  To: kbuild-all

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

Hello,

This is actually complaining about the continues on lines 295 and 298.  I
guess the calls to io_wq_run_queue and __io_worker_idle release the lock
in the case of success?

julia

---------- Forwarded message ----------
Date: Thu, 24 Oct 2019 16:03:20 +0800
From: kbuild test robot <lkp@intel.com>
To: kbuild(a)lists.01.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Subject: [block:for-5.5/io_uring-wq 11/11] fs/io-wq.c:291:2-11: second lock on
    line 291

CC: kbuild-all(a)lists.01.org
TO: Jens Axboe <axboe@kernel.dk>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-5.5/io_uring-wq
head:   f27f11bf017ca5918ab91b63aa146fbb053c7558
commit: f27f11bf017ca5918ab91b63aa146fbb053c7558 [11/11] io_uring: replace workqueue with io-wq
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>

>> fs/io-wq.c:291:2-11: second lock on line 291
   fs/io-wq.c:291:2-11: second lock on line 313

# https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?id=f27f11bf017ca5918ab91b63aa146fbb053c7558
git remote add block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
git remote update block
git checkout f27f11bf017ca5918ab91b63aa146fbb053c7558
vim +291 fs/io-wq.c

f27f11bf017ca5 Jens Axboe 2019-10-22  279
f27f11bf017ca5 Jens Axboe 2019-10-22  280  static int io_wq_worker(void *data)
f27f11bf017ca5 Jens Axboe 2019-10-22  281  {
f27f11bf017ca5 Jens Axboe 2019-10-22  282  	struct io_worker *worker = data;
f27f11bf017ca5 Jens Axboe 2019-10-22  283  	struct io_wq *wq = worker->wq;
f27f11bf017ca5 Jens Axboe 2019-10-22  284  	DEFINE_WAIT(wait);
f27f11bf017ca5 Jens Axboe 2019-10-22  285
f27f11bf017ca5 Jens Axboe 2019-10-22  286  	io_worker_start(wq, worker);
f27f11bf017ca5 Jens Axboe 2019-10-22  287
f27f11bf017ca5 Jens Axboe 2019-10-22  288  	while (!test_bit(IO_WQ_BIT_EXIT, &wq->state)) {
f27f11bf017ca5 Jens Axboe 2019-10-22  289  		prepare_to_wait(&worker->wait, &wait, TASK_INTERRUPTIBLE);
f27f11bf017ca5 Jens Axboe 2019-10-22  290
f27f11bf017ca5 Jens Axboe 2019-10-22 @291  		spin_lock(&wq->lock);
f27f11bf017ca5 Jens Axboe 2019-10-22  292  		if (io_wq_run_queue(wq)) {
f27f11bf017ca5 Jens Axboe 2019-10-22  293  			__set_current_state(TASK_RUNNING);
f27f11bf017ca5 Jens Axboe 2019-10-22  294  			io_worker_handle_work(worker);
f27f11bf017ca5 Jens Axboe 2019-10-22  295  			continue;
f27f11bf017ca5 Jens Axboe 2019-10-22  296  		}
f27f11bf017ca5 Jens Axboe 2019-10-22  297  		if (__io_worker_idle(wq, worker))
f27f11bf017ca5 Jens Axboe 2019-10-22  298  			continue;
f27f11bf017ca5 Jens Axboe 2019-10-22  299  		spin_unlock(&wq->lock);
f27f11bf017ca5 Jens Axboe 2019-10-22  300  		if (signal_pending(current))
f27f11bf017ca5 Jens Axboe 2019-10-22  301  			flush_signals(current);
f27f11bf017ca5 Jens Axboe 2019-10-22  302  		if (schedule_timeout(WORKER_IDLE_TIMEOUT))
f27f11bf017ca5 Jens Axboe 2019-10-22  303  			continue;
f27f11bf017ca5 Jens Axboe 2019-10-22  304  		/* timed out, exit unless we're the fixed worker */
f27f11bf017ca5 Jens Axboe 2019-10-22  305  		if (test_bit(IO_WQ_BIT_EXIT, &wq->state) ||
f27f11bf017ca5 Jens Axboe 2019-10-22  306  		    !(worker->flags & IO_WORKER_F_FIXED))
f27f11bf017ca5 Jens Axboe 2019-10-22  307  			break;
f27f11bf017ca5 Jens Axboe 2019-10-22  308  	}
f27f11bf017ca5 Jens Axboe 2019-10-22  309
f27f11bf017ca5 Jens Axboe 2019-10-22  310  	finish_wait(&worker->wait, &wait);
f27f11bf017ca5 Jens Axboe 2019-10-22  311
f27f11bf017ca5 Jens Axboe 2019-10-22  312  	if (test_bit(IO_WQ_BIT_EXIT, &wq->state)) {
f27f11bf017ca5 Jens Axboe 2019-10-22  313  		spin_lock(&wq->lock);
f27f11bf017ca5 Jens Axboe 2019-10-22  314  		if (!list_empty(&wq->work_list))
f27f11bf017ca5 Jens Axboe 2019-10-22  315  			io_worker_handle_work(worker);
f27f11bf017ca5 Jens Axboe 2019-10-22  316  		else
f27f11bf017ca5 Jens Axboe 2019-10-22  317  			spin_unlock(&wq->lock);
f27f11bf017ca5 Jens Axboe 2019-10-22  318  	}
f27f11bf017ca5 Jens Axboe 2019-10-22  319
f27f11bf017ca5 Jens Axboe 2019-10-22  320  	io_worker_exit(worker);
f27f11bf017ca5 Jens Axboe 2019-10-22  321  	return 0;
f27f11bf017ca5 Jens Axboe 2019-10-22  322  }
f27f11bf017ca5 Jens Axboe 2019-10-22  323

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-24 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <24160b11-5bcf-0b52-4db1-471527f58e37@kernel.dk>
2019-10-24 13:03 ` [block:for-5.5/io_uring-wq 11/11] fs/io-wq.c:291:2-11: second lock on line 291 (fwd) Julia Lawall
2019-10-24  8:12 Julia Lawall

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.