* [dm-crypt] Elevator / dm-crypt
@ 2012-09-02 16:35 Heinz Diehl
2012-09-02 17:06 ` Milan Broz
0 siblings, 1 reply; 4+ messages in thread
From: Heinz Diehl @ 2012-09-02 16:35 UTC (permalink / raw)
To: dm-crypt
Hi,
assuming /dev/sda1 is an LUKS/dmcrypt encrypted partition. The default
elevator is "noop" (given in kernel command-line), but "cfq" is set
for /dev/sda in /sys/block/sda/queue/scheduler.
What elevator is used for the underlying /dev/mapper/dm-0 (sda1)?
sys/block/dm-0/queue/scheduler contains "none", btw.
Thanks,
Heinz.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dm-crypt] Elevator / dm-crypt
2012-09-02 16:35 [dm-crypt] Elevator / dm-crypt Heinz Diehl
@ 2012-09-02 17:06 ` Milan Broz
2012-09-02 17:45 ` Heinz Diehl
0 siblings, 1 reply; 4+ messages in thread
From: Milan Broz @ 2012-09-02 17:06 UTC (permalink / raw)
To: dm-crypt
On 09/02/2012 06:35 PM, Heinz Diehl wrote:
> assuming /dev/sda1 is an LUKS/dmcrypt encrypted partition. The default
> elevator is "noop" (given in kernel command-line), but "cfq" is set
> for /dev/sda in /sys/block/sda/queue/scheduler.
>
> What elevator is used for the underlying /dev/mapper/dm-0 (sda1)?
Partitions just use whole device elevator.
And it should be default from your kernel parameter configuration
if not set by some script later... is that param correct?
Anyway, you can just switch it later using
echo "noop">/sys/block/sda/queue/scheduler
Device-mapper devices (except request based - which is currently multipath only)
do not use own elevator at all. So only elevator for underlying device is important.
BTW you can easily check it with lsblk -t.
Or explicitly name fields - here is example of my nb with SSD
(default sched. is noop for me):
# lsblk -o NAME,TYPE,SCHED /dev/sdb
NAME TYPE SCHED
sdb disk noop
├─sdb1 part noop
├─sdb2 part noop
│ └─sdb2_crypt (dm-0) crypt
│ ├─mnbook-data (dm-1) lvm
│ ├─nbook-swap (dm-2) lvm
│ └─nbook-root64 (dm-3) lvm
└─sdb3 part noop
> sys/block/dm-0/queue/scheduler contains "none", btw.
Yes, it is irrelevant for dm-crypt, there is no elevator.
(If you ask why there is <dev>/queue dir then, the because someone
decided to put some important attributes there which applies even
when elevator is not set. No idea why...)
Milan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dm-crypt] Elevator / dm-crypt
2012-09-02 17:06 ` Milan Broz
@ 2012-09-02 17:45 ` Heinz Diehl
2012-09-02 19:17 ` Milan Broz
0 siblings, 1 reply; 4+ messages in thread
From: Heinz Diehl @ 2012-09-02 17:45 UTC (permalink / raw)
To: dm-crypt
On 02.09.2012, Milan Broz wrote:
[....]
Thanks a lot, Milan! Now it's all clear to me.
My main intention is to set "noop" as the default elevator, and switch
to cfq for the harddisk via rc.local when booting (it's a conventional
rotating drive, no SSD). This has the effect that all USB drives
plugged in later will get "noop" as their active scheduler, since it's
the default, while all partitions on the harddisk have "cfq".
This way, I avoid hair-pulling work with udev/systemd to have "noop"
for all non-rotational drives plugged in :-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dm-crypt] Elevator / dm-crypt
2012-09-02 17:45 ` Heinz Diehl
@ 2012-09-02 19:17 ` Milan Broz
0 siblings, 0 replies; 4+ messages in thread
From: Milan Broz @ 2012-09-02 19:17 UTC (permalink / raw)
To: dm-crypt
On 09/02/2012 07:45 PM, Heinz Diehl wrote:
> On 02.09.2012, Milan Broz wrote:
>
> [....]
>
> Thanks a lot, Milan! Now it's all clear to me.
>
> My main intention is to set "noop" as the default elevator, and switch
> to cfq for the harddisk via rc.local when booting (it's a conventional
> rotating drive, no SSD). This has the effect that all USB drives
> plugged in later will get "noop" as their active scheduler, since it's
> the default, while all partitions on the harddisk have "cfq".
>
> This way, I avoid hair-pulling work with udev/systemd to have "noop"
> for all non-rotational drives plugged in :-)
You can also use udev rules to do this
(not tested but something like):
Add /etc/udev/rules.d/20-elevator.rules
# set cfq for all rotational devices
SUBSYSTEM=="block", ACTION=="add", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"
(or perhaps reverse is better:)
SUBSYSTEM=="block", ACTION=="add", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="noop"
.. or/and for USB
# set noop for usb disks
SUBSYSTEMS=="usb", ACTION=="add", KERNEL=="sd*[!0-9]|sr*", ATTR{queue/scheduler}="noop"
(Btw I think "deadline" could be better for USB.)
Milan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-02 19:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-02 16:35 [dm-crypt] Elevator / dm-crypt Heinz Diehl
2012-09-02 17:06 ` Milan Broz
2012-09-02 17:45 ` Heinz Diehl
2012-09-02 19:17 ` Milan Broz
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).