Skip to contentSkip to conversation

can I freeze I/O for some time to a given disk / md / dm device?

DISCUSSION Tomasz Chmielewski 3 participants 5 messages Dec 16, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Is it possible to "freeze I/O" for some time to a given disk / md / dm device?

Say, "freeze I/O" so that userspace waits for any response for 30, 60 seconds or more?

If not, is it possible to reset a link repeatedly, like ATA does when it hits certain disk problems? I.e., can I do the below manually?

ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen ata4.00: cmd 25/00:08:b8:c2:78/00:00:21:00:00/e0 tag 0 dma 4096 in

         res 40/00:00:bb:c2:78/40:00:21:00:00/e0 Emask 0x4 (timeout)

ata4.00: status: { DRDY }
ata4: hard resetting link

I need this to trace a problem with a userspace application which segfaults when ATA resets the link repeatedly (i.e. one broken drive in a RAID array).

Signature · 8 lines
Tomasz Chmielewski
http://wpkg.org

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Tomasz Chmielewski

Is it possible to "freeze I/O" for some time to a given disk / md / dm device?

Say, "freeze I/O" so that userspace waits for any response for 30, 60 seconds or more?

You can suspend/resume dm devices via the dmsetup command.

Quoted 8 lines

If not, is it possible to reset a link repeatedly, like ATA does when it hits certain disk problems? I.e., can I do the below manually?

ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen ata4.00: cmd 25/00:08:b8:c2:78/00:00:21:00:00/e0 tag 0 dma 4096 in

         res 40/00:00:bb:c2:78/40:00:21:00:00/e0 Emask 0x4 (timeout)

ata4.00: status: { DRDY }
ata4: hard resetting link

This (or something close to it) should be possible using the SCSI fault injection framework, a project that uses systemtap for injecting faults under controlled conditions:

http://sourceforge.net/projects/scsifaultinjtst/
http://lwn.net/Articles/265187/
http://lwn.net/Articles/289932/

Regards,
Bryn.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAklHoJgACgkQ6YSQoMYUY94xEwCeOJ/epr+4QipelzzeH22M52az 53MAoLOZTNPlwq6t1PyLgNA/Ous64++z
=apWm
-----END PGP SIGNATURE-----

#2 lore raw
Quoted 11 lines · Bryn M. Reeves

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Tomasz Chmielewski

Is it possible to "freeze I/O" for some time to a given disk / md / dm device?

Say, "freeze I/O" so that userspace waits for any response for 30, 60 seconds or more?

You can suspend/resume dm devices via the dmsetup command.

Exactly what I was looking for - thanks!

Signature · 2 lines
Tomasz Chmielewski
http://wpkg.org
#3 lore raw
In reply to Tomasz Chmielewski
Quoted 5 lines · Tomasz Chmielewski

Is it possible to "freeze I/O" for some time to a given disk / md / dm device?

Say, "freeze I/O" so that userspace waits for any response for 30, 60 seconds or more?

For real disks you can use /sys/block/sdX/device/unload_heads to achieve something similar (see Documentation/laptops/disk-shock-protection.txt in the kernel source about how to use it). That won't work for md/dm devices though.

Gabor

Signature · 4 lines
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------
#4 lore raw
Quoted 10 lines · Gabor Gombas
Quoted 3 lines · Tomasz Chmielewski

Is it possible to "freeze I/O" for some time to a given disk / md / dm device?

Say, "freeze I/O" so that userspace waits for any response for 30, 60 seconds or more?

For real disks you can use /sys/block/sdX/device/unload_heads to achieve something similar (see Documentation/laptops/disk-shock-protection.txt in the kernel source about how to use it). That won't work for md/dm devices though.

Thanks, I think I have enough hints now.

Bryn M. Reeves on linux-lvm list suggested using dmsetup's suspend/resume, which seems to be the easiest way for this purpose (requires device mapper / LVM).

Signature · 2 lines
Tomasz Chmielewski
http://wpkg.org