Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Kernel (http://www.linux-archive.org/debian-kernel/)
-   -   Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices (http://www.linux-archive.org/debian-kernel/596858-bug-648367-device-mapper-devices-such-dm-crypt-always-have-rotational-1-should-inherit-rotational-setting-underlying-devices.html)

Josh Triplett 11-10-2011 06:59 PM

Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
 
Source: linux-2.6
Version: 3.1.0-1~experimental.1
Severity: normal

I use dm-crypt on my system, and I have an SSD. The underlying disk
device, sda, has rotational=0:

~$ cat /sys/block/sda/queue/rotational
0

However, the device-mapper devices have rotational=1:

~$ head /sys/block/dm-*/queue/rotational
==> /sys/block/dm-0/queue/rotational <==
1

==> /sys/block/dm-1/queue/rotational <==
1

==> /sys/block/dm-2/queue/rotational <==
1

The device-mapper devices should inherit the setting for "rotational"
from their underlying devices.

- Josh Triplett

-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111110195943.12083.93273.reportbug@leaf">http://lists.debian.org/20111110195943.12083.93273.reportbug@leaf

Ben Hutchings 11-14-2011 12:05 AM

Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
 
On Thu, 2011-11-10 at 11:59 -0800, Josh Triplett wrote:
> Source: linux-2.6
> Version: 3.1.0-1~experimental.1
> Severity: normal
>
> I use dm-crypt on my system, and I have an SSD. The underlying disk
> device, sda, has rotational=0:
>
> ~$ cat /sys/block/sda/queue/rotational
> 0
>
> However, the device-mapper devices have rotational=1:
>
> ~$ head /sys/block/dm-*/queue/rotational
> ==> /sys/block/dm-0/queue/rotational <==
> 1
>
> ==> /sys/block/dm-1/queue/rotational <==
> 1
>
> ==> /sys/block/dm-2/queue/rotational <==
> 1
>
> The device-mapper devices should inherit the setting for "rotational"
> from their underlying devices.

I'm not sure that's true. Since their queues should feed into the
queues for the underlying devices, it may be that they shouldn't
themselves be scheduled as if they are rotating media.

I do wonder whether rotational should still be the default - almost all
real disks are handled by a small number of drivers like sd, while there
is a wide variety of networked, stacked and virtual disk drivers in use.

Ben.

--
Ben Hutchings
The world is coming to an end. Please log off.

Ben Hutchings 11-14-2011 12:05 AM

Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
 
On Thu, 2011-11-10 at 11:59 -0800, Josh Triplett wrote:
> Source: linux-2.6
> Version: 3.1.0-1~experimental.1
> Severity: normal
>
> I use dm-crypt on my system, and I have an SSD. The underlying disk
> device, sda, has rotational=0:
>
> ~$ cat /sys/block/sda/queue/rotational
> 0
>
> However, the device-mapper devices have rotational=1:
>
> ~$ head /sys/block/dm-*/queue/rotational
> ==> /sys/block/dm-0/queue/rotational <==
> 1
>
> ==> /sys/block/dm-1/queue/rotational <==
> 1
>
> ==> /sys/block/dm-2/queue/rotational <==
> 1
>
> The device-mapper devices should inherit the setting for "rotational"
> from their underlying devices.

I'm not sure that's true. Since their queues should feed into the
queues for the underlying devices, it may be that they shouldn't
themselves be scheduled as if they are rotating media.

I do wonder whether rotational should still be the default - almost all
real disks are handled by a small number of drivers like sd, while there
is a wide variety of networked, stacked and virtual disk drivers in use.

Ben.

--
Ben Hutchings
The world is coming to an end. Please log off.
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

"Stefan Lippers-Hollmann" 11-14-2011 12:18 AM

Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
 
Hi

On Monday 14 November 2011, Josh Triplett wrote:
> Source: linux-2.6
> Version: 3.1.0-1~experimental.1
> Severity: normal
>
> I use dm-crypt on my system, and I have an SSD. The underlying disk
> device, sda, has rotational=0:
>
> ~$ cat /sys/block/sda/queue/rotational
> 0
>
> However, the device-mapper devices have rotational=1:
>
> ~$ head /sys/block/dm-*/queue/rotational
> ==> /sys/block/dm-0/queue/rotational <==
> 1
[...]
> The device-mapper devices should inherit the setting for "rotational"
> from their underlying devices.
>
> - Josh Triplett

While I don't know about dm-crypt specifically, that issue should be
fixed in 3.2~rc1:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=4693c9668fdcec229825b3763 876b4744f9e6d5e
(it is for plain lvm2, at least)

Regards
Stefan Lippers-Hollmann


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201111140218.55716.s.L-H@gmx.de">http://lists.debian.org/201111140218.55716.s.L-H@gmx.de

Josh Triplett 11-14-2011 01:24 AM

Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
 
On Mon, Nov 14, 2011 at 02:18:53AM +0100, Stefan Lippers-Hollmann wrote:
> Hi
>
> On Monday 14 November 2011, Josh Triplett wrote:
> > Source: linux-2.6
> > Version: 3.1.0-1~experimental.1
> > Severity: normal
> >
> > I use dm-crypt on my system, and I have an SSD. The underlying disk
> > device, sda, has rotational=0:
> >
> > ~$ cat /sys/block/sda/queue/rotational
> > 0
> >
> > However, the device-mapper devices have rotational=1:
> >
> > ~$ head /sys/block/dm-*/queue/rotational
> > ==> /sys/block/dm-0/queue/rotational <==
> > 1
> [...]
> > The device-mapper devices should inherit the setting for "rotational"
> > from their underlying devices.
> >
> > - Josh Triplett
>
> While I don't know about dm-crypt specifically, that issue should be
> fixed in 3.2~rc1:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=4693c9668fdcec229825b3763 876b4744f9e6d5e
> (it is for plain lvm2, at least)

Ah, great, thanks!

- Josh Triplett



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111114022446.GA30421@leaf">http://lists.debian.org/20111114022446.GA30421@leaf

Josh Triplett 11-14-2011 01:26 AM

Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
 
On Mon, Nov 14, 2011 at 01:05:29AM +0000, Ben Hutchings wrote:
> On Thu, 2011-11-10 at 11:59 -0800, Josh Triplett wrote:
> > Source: linux-2.6
> > Version: 3.1.0-1~experimental.1
> > Severity: normal
> >
> > I use dm-crypt on my system, and I have an SSD. The underlying disk
> > device, sda, has rotational=0:
> >
> > ~$ cat /sys/block/sda/queue/rotational
> > 0
> >
> > However, the device-mapper devices have rotational=1:
> >
> > ~$ head /sys/block/dm-*/queue/rotational
> > ==> /sys/block/dm-0/queue/rotational <==
> > 1
> >
> > ==> /sys/block/dm-1/queue/rotational <==
> > 1
> >
> > ==> /sys/block/dm-2/queue/rotational <==
> > 1
> >
> > The device-mapper devices should inherit the setting for "rotational"
> > from their underlying devices.
>
> I'm not sure that's true. Since their queues should feed into the
> queues for the underlying devices, it may be that they shouldn't
> themselves be scheduled as if they are rotating media.

OK, I suppose I don't actually care what rotational shows for a
device-mapper device backed by rotating media. The case I care about:
when the underlying media has rotational=0, the dm device definitely
shouldn't have rotational=1.

- Josh Triplett



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111114022644.GB30421@leaf">http://lists.debian.org/20111114022644.GB30421@leaf

Josh Triplett 11-14-2011 01:26 AM

Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
 
On Mon, Nov 14, 2011 at 01:05:29AM +0000, Ben Hutchings wrote:
> On Thu, 2011-11-10 at 11:59 -0800, Josh Triplett wrote:
> > Source: linux-2.6
> > Version: 3.1.0-1~experimental.1
> > Severity: normal
> >
> > I use dm-crypt on my system, and I have an SSD. The underlying disk
> > device, sda, has rotational=0:
> >
> > ~$ cat /sys/block/sda/queue/rotational
> > 0
> >
> > However, the device-mapper devices have rotational=1:
> >
> > ~$ head /sys/block/dm-*/queue/rotational
> > ==> /sys/block/dm-0/queue/rotational <==
> > 1
> >
> > ==> /sys/block/dm-1/queue/rotational <==
> > 1
> >
> > ==> /sys/block/dm-2/queue/rotational <==
> > 1
> >
> > The device-mapper devices should inherit the setting for "rotational"
> > from their underlying devices.
>
> I'm not sure that's true. Since their queues should feed into the
> queues for the underlying devices, it may be that they shouldn't
> themselves be scheduled as if they are rotating media.

OK, I suppose I don't actually care what rotational shows for a
device-mapper device backed by rotating media. The case I care about:
when the underlying media has rotational=0, the dm device definitely
shouldn't have rotational=1.

- Josh Triplett

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Milan Broz 11-15-2011 06:34 AM

Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
 
On 11/14/2011 03:26 AM, Josh Triplett wrote:
> OK, I suppose I don't actually care what rotational shows for a
> device-mapper device backed by rotating media. The case I care about:
> when the underlying media has rotational=0, the dm device definitely
> shouldn't have rotational=1.

Rotational flag is inherited in DM core, nothing dm-crypt specific.
And it works (for several kernel releases already):


create test scsi disk (also with discards)
# modprobe scsi_debug dev_size_mb=16 sector_size=512 num_tgts=1 lbpu=1
# grep scsi_debug /sys/block/*/device/model
/sys/block/sdj/device/model:scsi_debug

Map some crypt device over it
# echo "password" | cryptsetup create sdj_crypt /dev/sdj

And now see inherited ROTA flag (it is /sys rotational)

# lsblk -t /dev/sdj
NAME ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE
sdj 0 512 32768 512 512 0 cfq 128
`-sdj_crypt (dm-0) 0 512 32768 512 512 0 128


Please paste lsblk -t output tree if you think there is a bug, do not blindly
check all dm-X devices queues.

Milan

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Josh Triplett 11-15-2011 03:41 PM

Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
 
On Tue, Nov 15, 2011 at 08:34:18AM +0100, Milan Broz wrote:
> On 11/14/2011 03:26 AM, Josh Triplett wrote:
> > OK, I suppose I don't actually care what rotational shows for a
> > device-mapper device backed by rotating media. The case I care about:
> > when the underlying media has rotational=0, the dm device definitely
> > shouldn't have rotational=1.
>
> Rotational flag is inherited in DM core, nothing dm-crypt specific.
> And it works (for several kernel releases already):
>
>
> create test scsi disk (also with discards)
> # modprobe scsi_debug dev_size_mb=16 sector_size=512 num_tgts=1 lbpu=1
> # grep scsi_debug /sys/block/*/device/model
> /sys/block/sdj/device/model:scsi_debug
>
> Map some crypt device over it
> # echo "password" | cryptsetup create sdj_crypt /dev/sdj
>
> And now see inherited ROTA flag (it is /sys rotational)
>
> # lsblk -t /dev/sdj
> NAME ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE
> sdj 0 512 32768 512 512 0 cfq 128
> `-sdj_crypt (dm-0) 0 512 32768 512 512 0 128
>
>
> Please paste lsblk -t output tree if you think there is a bug, do not blindly
> check all dm-X devices queues.

I didn't know about that command; very nice, thanks! lsblk confirms
that on my system, the physical disk has rotational=0 but the dm-crypt
and LVM devices have rotational=1:

NAME ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED
sda 0 512 0 512 512 0 cfq
├─sda1 0 512 0 512 512 0 cfq
└─sda2 0 512 0 512 512 0 cfq
└─sda2_crypt (dm-0) 0 512 0 512 512 1
├─leaf-swap (dm-1) 0 512 0 512 512 1
└─leaf-root (dm-2) 0 512 0 512 512 1

Does that help?

- Josh Triplett

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Milan Broz 11-15-2011 04:05 PM

Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
 
On 11/15/2011 05:41 PM, Josh Triplett wrote:
> I didn't know about that command; very nice, thanks! lsblk confirms
> that on my system, the physical disk has rotational=0 but the dm-crypt
> and LVM devices have rotational=1:
>
> NAME ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED
> sda 0 512 0 512 512 0 cfq
> ├─sda1 0 512 0 512 512 0 cfq
> └─sda2 0 512 0 512 512 0 cfq
> └─sda2_crypt (dm-0) 0 512 0 512 512 1
> ├─leaf-swap (dm-1) 0 512 0 512 512 1
> └─leaf-root (dm-2) 0 512 0 512 512 1
>
> Does that help?

Thanks.

As noted on that bug earlier, it is already fixed in 3.2-rc1
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=4693c9668fdcec229825b3763 876b4744f9e6d5e

(I thought it is fixed long time ago!)

There is no problem in DM layer with this (dmcrypt does not have own io scheduler)
but perhaps FS can use this flag for some optimization tuning, dunno.

Milan

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


All times are GMT. The time now is 01:30 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.