From: Alan Jenkins <alan.christopher.jenkins@gmail.com>
To: dm-devel@redhat.com
Subject: [RFC] disk doesn't spin down with thin pool + dmeventd
Date: Thu, 7 Jan 2016 19:31:20 +0000 [thread overview]
Message-ID: <568EBD08.70800@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]
Hi
I tried using Docker on my Fedora NAS box. It created a thin pool LV,
which caused hard drive activity every ~10 seconds.
dmeventd queries the thin pool every 10 seconds, and it causes a
transaction commit in order to make sure the statistics are up to date.
But transactions are already supposed to be committed after 1 second.
(See Documentation/device-mapper/thin-provisioning.txt, "Updating
on-disk metadata").
It seems like a simple case of "don't do that". The kernel already lets
us avoid the commit. How about it (patch below)? If it seems
reasonable, I can whip up a commit message for it.
Thanks
Alan
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index c093d91..5948f15 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -412,6 +412,15 @@ static struct thread_status *_alloc_thread_status(const struct message_data *dat
if (!(thread->device.name = dm_strdup(data->device_uuid)))
goto_out;
+ /*
+ * Avoid repeatedly forcing a flush.
+ * Allow the disks to sleep, and accept "out-of-date" statistics.
+ * E.g. affects thin pools. Commits will occur every second already,
+ * if the pool state is changing.
+ */
+ if (!dm_task_no_flush(thread->wait_task))
+ goto_out;
+
/* runs ioctl and may register lvm2 pluging */
thread->processing = 1;
thread->status = DM_THREAD_REGISTERING;
[-- Attachment #2: dmevent-noflush.patch --]
[-- Type: text/x-patch, Size: 749 bytes --]
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index c093d91..5948f15 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -412,6 +412,15 @@ static struct thread_status *_alloc_thread_status(const struct message_data *dat
if (!(thread->device.name = dm_strdup(data->device_uuid)))
goto_out;
+ /*
+ * Avoid repeatedly forcing a flush.
+ * Allow the disks to sleep, and accept "out-of-date" statistics.
+ * E.g. affects thin pools. Commits will occur every second already,
+ * if the pool state is changing.
+ */
+ if (!dm_task_no_flush(thread->wait_task))
+ goto_out;
+
/* runs ioctl and may register lvm2 pluging */
thread->processing = 1;
thread->status = DM_THREAD_REGISTERING;
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
next reply other threads:[~2016-01-07 19:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-07 19:31 Alan Jenkins [this message]
2016-01-08 8:17 ` [RFC] disk doesn't spin down with thin pool + dmeventd Zdenek Kabelac
2016-01-09 10:07 ` Alan Jenkins
2016-01-09 11:51 ` Alan Jenkins
2016-01-11 9:21 ` Zdenek Kabelac
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=568EBD08.70800@gmail.com \
--to=alan.christopher.jenkins@gmail.com \
--cc=dm-devel@redhat.com \
/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