FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 11-15-2011, 06:34 AM
Milan Broz
 
Default Bug#648367: 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



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4EC215FA.1090303@redhat.com">http://lists.debian.org/4EC215FA.1090303@redhat.com
 
Old 11-15-2011, 03:41 PM
Josh Triplett
 
Default Bug#648367: 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



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111115164151.GA24015@leaf">http://lists.debian.org/20111115164151.GA24015@leaf
 
Old 11-15-2011, 04:05 PM
Milan Broz
 
Default Bug#648367: 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



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4EC29BDB.8090803@redhat.com">http://lists.debian.org/4EC29BDB.8090803@redhat.com
 

Thread Tools




All times are GMT. The time now is 11:41 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org