From: Akira Hayakawa <ruby.wktk@gmail.com>
To: dm-devel@redhat.com
Cc: mpatocka@redhat.com, devel@driverdev.osuosl.org,
thornber@redhat.com, snitzer@redhat.com, cesarb@cesarb.net,
gregkh@linuxfoundation.org, david@fromorbit.com,
linux-kernel@vger.kernel.org, tj@kernel.org, agk@redhat.com,
joe@perches.com, akpm@linux-foundation.org, ejt@redhat.com,
dan.carpenter@oracle.com, m.chehab@samsung.com,
ruby.wktk@gmail.com
Subject: Re: [dm-devel] A review of dm-writeboost
Date: Tue, 08 Oct 2013 22:17:36 +0900 [thread overview]
Message-ID: <525405F0.8050407@gmail.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1310071327390.19115@file01.intranet.prod.int.rdu2.redhat.com>
Mikulas,
Let me ask you about this comment
of choosing the best API.
For the rest, I will reply later.
> BTW. You should use wait_event_interruptible_lock_irq instead of
> wait_event_interruptible and wait_event_interruptible_lock_irq_timeout
> instead of wait_event_interruptible_timeout. The functions with "lock_irq"
> automatically drop and re-acquire the spinlock, so that the condition is
> tested while the lock is held - so that there are no asynchronous accesses
> to !list_empty(&cache->flush_queue).
wait_event_interruptible_lock_irq_timeout is
added to the kernel since 3.12 by this patch.
https://lkml.org/lkml/2013/8/21/362
However, it is only used by zfcp itself.
I am afraid I want to refrain from this new API
and keep the code as it is now.
Later if this API is widely accepted
it is time to use it in writeboost
is my opinion.
The fact this API is not added for a long time
makes me feel it should not be used at least at this moment of time.
I want to use only those truly stable.
writeboost as a storage kernel module should be stable.
I believe depending only on the stable APIs is a
good way of making a software stable.
All said, I tried to fix this.
Is this change what you meant?
@@ -24,10 +24,10 @@ int flush_proc(void *data)
spin_lock_irqsave(&cache->flush_queue_lock, flags);
while (list_empty(&cache->flush_queue)) {
- spin_unlock_irqrestore(&cache->flush_queue_lock, flags);
- wait_event_interruptible_timeout(
+ wait_event_interruptible_lock_irq_timeout(
cache->flush_wait_queue,
- (!list_empty(&cache->flush_queue)),
+ !list_empty(&cache->flush_queue),
+ cache->flush_queue_lock,
msecs_to_jiffies(100));
/*
@@ -36,8 +36,6 @@ int flush_proc(void *data)
*/
if (kthread_should_stop())
return 0;
- else
- spin_lock_irqsave(&cache->flush_queue_lock, flags);
}
Akira
next prev parent reply other threads:[~2013-10-08 13:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-06 0:50 A review of dm-writeboost Mikulas Patocka
2013-10-06 12:47 ` Akira Hayakawa
2013-10-07 18:03 ` Mikulas Patocka
2013-10-08 13:17 ` Akira Hayakawa [this message]
2013-10-09 2:44 ` [dm-devel] " Akira Hayakawa
2013-10-09 7:39 ` Akira Hayakawa
2013-10-14 8:28 ` Akira Hayakawa
2013-10-16 0:01 ` Mikulas Patocka
2013-10-16 0:53 ` Akira Hayakawa
2013-10-16 6:07 ` Dave Chinner
2013-10-16 10:34 ` Akira Hayakawa
2013-10-16 11:01 ` Dave Chinner
2013-10-16 12:17 ` Akira Hayakawa
2013-10-16 21:42 ` Dave Chinner
2013-10-19 10:59 ` Akira Hayakawa
2013-10-21 1:31 ` Dave Chinner
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=525405F0.8050407@gmail.com \
--to=ruby.wktk@gmail.com \
--cc=agk@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=cesarb@cesarb.net \
--cc=dan.carpenter@oracle.com \
--cc=david@fromorbit.com \
--cc=devel@driverdev.osuosl.org \
--cc=dm-devel@redhat.com \
--cc=ejt@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=mpatocka@redhat.com \
--cc=snitzer@redhat.com \
--cc=thornber@redhat.com \
--cc=tj@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;
as well as URLs for NNTP newsgroup(s).