dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
       [not found] <20111110195943.12083.93273.reportbug@leaf>
@ 2011-11-14  1:05 ` Ben Hutchings
  2011-11-14  2:26   ` Josh Triplett
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2011-11-14  1:05 UTC (permalink / raw)
  To: Josh Triplett, 648367; +Cc: dm-devel

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

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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
  2011-11-14  1:05 ` Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices Ben Hutchings
@ 2011-11-14  2:26   ` Josh Triplett
  2011-11-15  7:34     ` Milan Broz
  0 siblings, 1 reply; 5+ messages in thread
From: Josh Triplett @ 2011-11-14  2:26 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: 648367, dm-devel

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

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

* Re: Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
  2011-11-14  2:26   ` Josh Triplett
@ 2011-11-15  7:34     ` Milan Broz
  2011-11-15 16:41       ` Bug#648367: [dm-devel] " Josh Triplett
  0 siblings, 1 reply; 5+ messages in thread
From: Milan Broz @ 2011-11-15  7:34 UTC (permalink / raw)
  To: device-mapper development; +Cc: 648367, Ben Hutchings, Josh Triplett

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

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

* Bug#648367: [dm-devel] Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
  2011-11-15  7:34     ` Milan Broz
@ 2011-11-15 16:41       ` Josh Triplett
  2011-11-15 17:05         ` Milan Broz
  0 siblings, 1 reply; 5+ messages in thread
From: Josh Triplett @ 2011-11-15 16:41 UTC (permalink / raw)
  To: Milan Broz; +Cc: device-mapper development, Ben Hutchings, 648367

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

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

* Bug#648367: [dm-devel] Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices
  2011-11-15 16:41       ` Bug#648367: [dm-devel] " Josh Triplett
@ 2011-11-15 17:05         ` Milan Broz
  0 siblings, 0 replies; 5+ messages in thread
From: Milan Broz @ 2011-11-15 17:05 UTC (permalink / raw)
  To: Josh Triplett; +Cc: device-mapper development, Ben Hutchings, 648367

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=4693c9668fdcec229825b3763876b4744f9e6d5e

(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

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

end of thread, other threads:[~2011-11-15 17:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20111110195943.12083.93273.reportbug@leaf>
2011-11-14  1:05 ` Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices Ben Hutchings
2011-11-14  2:26   ` Josh Triplett
2011-11-15  7:34     ` Milan Broz
2011-11-15 16:41       ` Bug#648367: [dm-devel] " Josh Triplett
2011-11-15 17:05         ` 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).