* Enable SCTERC in the kernel? @ 2013-10-25 8:51 Dag Nygren 2013-10-25 10:42 ` NeilBrown 2013-10-25 10:47 ` Martin K. Petersen 0 siblings, 2 replies; 8+ messages in thread From: Dag Nygren @ 2013-10-25 8:51 UTC (permalink / raw) To: linux-raid Hi all! Just run into the standard problem by not having SCTERC enabled for my drives due to a spelling mistake in my rc.local script setting the parameters and started wondering: - What if the md module automatically set this during assembly of the RAID? - In the kernel module itself. It could always set it, if the set failed we could spit out a kernel warning that the used drive might not be the best as a RAID device. Would there be any ill effects from this? - And ditto for the device time-out. This would definitely make md work a lot better for people. I have a strange feeling that most don't know the parameter needs setting... Best Dag ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enable SCTERC in the kernel? 2013-10-25 8:51 Enable SCTERC in the kernel? Dag Nygren @ 2013-10-25 10:42 ` NeilBrown 2013-10-25 12:29 ` Phil Turmel 2013-10-25 16:29 ` Piergiorgio Sartor 2013-10-25 10:47 ` Martin K. Petersen 1 sibling, 2 replies; 8+ messages in thread From: NeilBrown @ 2013-10-25 10:42 UTC (permalink / raw) To: dag; +Cc: linux-raid [-- Attachment #1: Type: text/plain, Size: 1005 bytes --] On Fri, 25 Oct 2013 11:51 +0300 Dag Nygren <dag@newtech.fi> wrote: > > Hi all! > > Just run into the standard problem by not having SCTERC enabled > for my drives due to a spelling mistake in my rc.local script > setting the parameters and started wondering: > > - What if the md module automatically set this during assembly > of the RAID? - In the kernel module itself. It could always set it, > if the set failed we could spit out a kernel warning that the used > drive might not be the best as a RAID device. Would there be any ill > effects from this? > - And ditto for the device time-out. > > This would definitely make md work a lot better for people. I have a > strange feeling that most don't know the parameter needs setting... I don't think it is appropriate for the kernel to automatically set such things. However it might be appropriate for mdadm to do it when assembling or creating the array. I'm happy to review and possibly accept patches. NeilBrown [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 828 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enable SCTERC in the kernel? 2013-10-25 10:42 ` NeilBrown @ 2013-10-25 12:29 ` Phil Turmel 2013-10-25 16:29 ` Piergiorgio Sartor 1 sibling, 0 replies; 8+ messages in thread From: Phil Turmel @ 2013-10-25 12:29 UTC (permalink / raw) To: NeilBrown, dag; +Cc: linux-raid On 10/25/2013 06:42 AM, NeilBrown wrote: > On Fri, 25 Oct 2013 11:51 +0300 Dag Nygren <dag@newtech.fi> wrote: > >> >> Hi all! >> >> Just run into the standard problem by not having SCTERC enabled >> for my drives due to a spelling mistake in my rc.local script >> setting the parameters and started wondering: >> >> - What if the md module automatically set this during assembly >> of the RAID? - In the kernel module itself. It could always set it, >> if the set failed we could spit out a kernel warning that the used >> drive might not be the best as a RAID device. Would there be any ill >> effects from this? >> - And ditto for the device time-out. >> >> This would definitely make md work a lot better for people. I have a >> strange feeling that most don't know the parameter needs setting... No strange feeling at all. Most of my posts to this list are helping people bitten by it. > I don't think it is appropriate for the kernel to automatically set such > things. However it might be appropriate for mdadm to do it when assembling > or creating the array. > > I'm happy to review and possibly accept patches. This is a wonderful idea, as it could possibly help people stuck on older kernels. I'll take a look at doing this myself. Phil ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enable SCTERC in the kernel? 2013-10-25 10:42 ` NeilBrown 2013-10-25 12:29 ` Phil Turmel @ 2013-10-25 16:29 ` Piergiorgio Sartor 1 sibling, 0 replies; 8+ messages in thread From: Piergiorgio Sartor @ 2013-10-25 16:29 UTC (permalink / raw) To: NeilBrown; +Cc: dag, linux-raid On Fri, Oct 25, 2013 at 09:42:52PM +1100, NeilBrown wrote: > On Fri, 25 Oct 2013 11:51 +0300 Dag Nygren <dag@newtech.fi> wrote: > > > > > Hi all! > > > > Just run into the standard problem by not having SCTERC enabled > > for my drives due to a spelling mistake in my rc.local script > > setting the parameters and started wondering: > > > > - What if the md module automatically set this during assembly > > of the RAID? - In the kernel module itself. It could always set it, > > if the set failed we could spit out a kernel warning that the used > > drive might not be the best as a RAID device. Would there be any ill > > effects from this? > > - And ditto for the device time-out. > > > > This would definitely make md work a lot better for people. I have a > > strange feeling that most don't know the parameter needs setting... > > I don't think it is appropriate for the kernel to automatically set such > things. However it might be appropriate for mdadm to do it when assembling > or creating the array. Actually, IMHO, "mdadm" should trigger an exernal event, which, consequently, runs a script. This is already in place, somehow, using "udev". From a post, on this mailing list, of Sam Bingner: I have written a simple udev rule calling a bash script to set the timeouts on all connected devices. I would like to a) provide this to anybody who feels they may need it and b) know if anybody sees any potential issues with this. It seems to work fine for me over a couple reboots... contents of udev rule: ACTION=="add", SUBSYSTEM=="block", KERNEL=="[sh]d[a-z]", RUN+="/usr/local/bin/settimeout" contents of /usr/local/bin/settimeout: #!/bin/bash [ "${ACTION}" == "add" ] && { /usr/sbin/smartctl -l scterc,70,70 ${DEVNAME} || echo 180 > /sys/${DEVPATH}/device/timeout } I guess, what is missing, is to connect the HDDs with a specific "mdadm" event, instead of running for each HDD. I'm not sure if this is already possible, since some "udev" rules for "md" are already existing. bye, pg > I'm happy to review and possibly accept patches. > > NeilBrown -- piergiorgio ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enable SCTERC in the kernel? 2013-10-25 8:51 Enable SCTERC in the kernel? Dag Nygren 2013-10-25 10:42 ` NeilBrown @ 2013-10-25 10:47 ` Martin K. Petersen 2013-10-25 11:10 ` Dag Nygren 1 sibling, 1 reply; 8+ messages in thread From: Martin K. Petersen @ 2013-10-25 10:47 UTC (permalink / raw) To: dag; +Cc: linux-raid >>>>> "Dag" == Dag Nygren <dag@newtech.fi> writes: Dag> - What if the md module automatically set this during assembly Dag> of the RAID? There are a couple of challenges here. libata lives under SCSI and there is no official translation between SCTERC for ATA to the SCSI Read Write Error Recovery mode page. But I can work around that. A harder issue is to ensure that we don't cause regressions by requesting the SRWER mode from devices that blow up when they receive an unexpected SCSI command (yes, USB device vendors, I'm looking at you). Anyway. I agree that this might be worthwhile. I'll put it on my list... -- Martin K. Petersen Oracle Linux Engineering ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enable SCTERC in the kernel? 2013-10-25 10:47 ` Martin K. Petersen @ 2013-10-25 11:10 ` Dag Nygren 2013-10-25 11:27 ` Martin K. Petersen 0 siblings, 1 reply; 8+ messages in thread From: Dag Nygren @ 2013-10-25 11:10 UTC (permalink / raw) To: Martin K. Petersen; +Cc: linux-raid On Friday 25 October 2013 06:47:31 Martin K. Petersen wrote: > >>>>> "Dag" == Dag Nygren <dag@newtech.fi> writes: > > Dag> - What if the md module automatically set this during assembly > Dag> of the RAID? > > There are a couple of challenges here. libata lives under SCSI and there > is no official translation between SCTERC for ATA to the SCSI Read Write > Error Recovery mode page. But I can work around that. > > A harder issue is to ensure that we don't cause regressions by > requesting the SRWER mode from devices that blow up when they receive an > unexpected SCSI command (yes, USB device vendors, I'm looking at you). > > Anyway. I agree that this might be worthwhile. I'll put it on my list... Appreciate that! Would have saved me a lot of work - And I thought I knew what to do ;-) Anyway Neil had the opinion that mdadm could do it outside the kernel and he might be right there. As long as there is no other way to assemble tha raid but use mdadm. I do have smoe programming experience myself and could take a look at mdadm but would probably need some guidance. For example would is be OK to use an exec(smartctl...) which would make it a very easy programming exercise or do we then create an unwanted dependency on smartctl. Best Dag ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enable SCTERC in the kernel? 2013-10-25 11:10 ` Dag Nygren @ 2013-10-25 11:27 ` Martin K. Petersen 2013-10-25 11:35 ` Dag Nygren 0 siblings, 1 reply; 8+ messages in thread From: Martin K. Petersen @ 2013-10-25 11:27 UTC (permalink / raw) To: dag; +Cc: Martin K. Petersen, linux-raid >>>>> "Dag" == Dag Nygren <dag@newtech.fi> writes: Dag> Anyway Neil had the opinion that mdadm could do it outside the Dag> kernel My concern is wrt. making sure that there are no unfortunate discrepancies between our block device read/write request timeouts and any error recovery timeouts values set in device firmware. MD kicking disks is just a symptom that there's a generic issue in this area. -- Martin K. Petersen Oracle Linux Engineering ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enable SCTERC in the kernel? 2013-10-25 11:27 ` Martin K. Petersen @ 2013-10-25 11:35 ` Dag Nygren 0 siblings, 0 replies; 8+ messages in thread From: Dag Nygren @ 2013-10-25 11:35 UTC (permalink / raw) To: Martin K. Petersen; +Cc: linux-raid On Friday 25 October 2013 07:27:19 Martin K. Petersen wrote: > >>>>> "Dag" == Dag Nygren <dag@newtech.fi> writes: > > Dag> Anyway Neil had the opinion that mdadm could do it outside the > Dag> kernel > > My concern is wrt. making sure that there are no unfortunate > discrepancies between our block device read/write request timeouts and > any error recovery timeouts values set in device firmware. > > MD kicking disks is just a symptom that there's a generic issue in this > area. Yep. That is why this "feature" also should set the timeout to an appropriate value at the same time. "Just another line of code" ;-) Best Dag ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-10-25 16:29 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-10-25 8:51 Enable SCTERC in the kernel? Dag Nygren 2013-10-25 10:42 ` NeilBrown 2013-10-25 12:29 ` Phil Turmel 2013-10-25 16:29 ` Piergiorgio Sartor 2013-10-25 10:47 ` Martin K. Petersen 2013-10-25 11:10 ` Dag Nygren 2013-10-25 11:27 ` Martin K. Petersen 2013-10-25 11:35 ` Dag Nygren
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).