Re: Notebook disk spindown
Hi! > >Thanks for this patch. But why hasn't it been included into > >the kernel earlier? Wouldn't be a combination of yours and my > > It's basically included into 2.4.x. > > >patch be the proper way? As far as I understand you switch > > Your patch is sure fine. BTW, 2.4.x have an high limit of 10 minutes (as > opposed to 2.2.x that have an high limit of 1 minute). I'd suggest to > clean the patch to only increase the high limit value (one liner). Thanks. 10minutes still seems little low for me. What is high limit good for, anyway? Pavel -- Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt, details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Hi! > o developpers, > > this is a short description of a particular wish of notebook > users. Since kernel 2.2.11 the buffer flushing deamon is no longer > a user space program but part of the kernel (in fs/buffer.c). > > Before this kernel release it was the bdflush-program which > could be called with certain command line parameters in order > to control flushing of file system buffers. In particular in > combination with the hdparm-program it could be used to > spin down the hard disk (e.g. of laptops) if it was not accessed. > > I know that by writing to /proc/sys/vm/bdflush relevant kernel > paramters may be modified. But there are certain limits compiled > into every kernel, which have the consequence that > > *a silent hard disk hard disk is no longer feasible since kernel > 2.2.11*. Well, with noflushd daemon, it works for me. > I have modified the constants used in fs/buffer.c to allow for > bigger time intervals between forced buffer flushings. The "patch" > may be found at http://www.hmi.de/people/brunne/Spindown . Can you mail me the patch? [I do not have way to access web easily.] > Shouldn't Linux support hard disk spindown during periods of > inactivity? Is the tiny patch worth of being included into standard > kernels? Noflushd is little hacky. If your patch is really tiny, post actual patch to l-k for discussion. [Can you gracefully handle case of few active and few inactive disks?] Pavel -- Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt, details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Tue, 12 Sep 2000, Jamie Lokier wrote: > Dave Zarzycki wrote: > > Personally speaking, I always thought it would be nice if the kernel > > flushed dirty buffers right before a disk spins down. It seems silly to me > > that a disk can spin down with writes pending. > > Absolutely. That allows more time spun down too. Pavel Machek sent me a patch for noflushd to do exactly this. Need not be a kernel issue either. Regards, Daniel. -- GNU/Linux Audio Mechanics - http://www.glame.de Cutting Edge Office - http://www.c10a02.de GPG Key ID 89BF7E2B - http://www.keyserver.net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Hi! > > On Sat, 9 Sep 2000 [EMAIL PROTECTED] wrote: > > > Would it be possible to detect when the disk spins up, and do the flush then? > > Yes if you had a continuious polling of power status wrt standby. > > I think the following flushing policy would work almost as well, while > remaining generic: > > - if there's a read that is not handled from the buffer cache, flush >(write) all dirty buffers > - if we need to flush (write) one dirty buffers, flush all others too > > This wouldn't catch cases like an explicit spin-up without data I/O, > but I don't think this is much of a problem in real life. noflushd works for me. It monitors "read/write" counters in /proc/stat, and if it detects activity, it syncs(). If it detect idle period, it syncs() then spins disk down. Pavel -- I'm [EMAIL PROTECTED] "In my country we have almost anarchy and I don't care." Panos Katsaloulis describing me w.r.t. patents at [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Dave Zarzycki wrote: > Personally speaking, I always thought it would be nice if the kernel > flushed dirty buffers right before a disk spins down. It seems silly to me > that a disk can spin down with writes pending. Absolutely. That allows more time spun down too. -- Jamie - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Sat, 9 Sep 2000 [EMAIL PROTECTED] wrote: > Would it be possible to detect when the disk spins up, and do the flush then? Personally speaking, I always thought it would be nice if the kernel flushed dirty buffers right before a disk spins down. It seems silly to me that a disk can spin down with writes pending. davez -- Dave Zarzycki KF6ZSS http://thor.sbay.org/~dave/ http://www.sbay.net/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Andre Hedrick wrote: > On Sat, 9 Sep 2000 [EMAIL PROTECTED] wrote: > > Would it be possible to detect when the disk spins up, and do the flush then? > Yes if you had a continuious polling of power status wrt standby. I think the following flushing policy would work almost as well, while remaining generic: - if there's a read that is not handled from the buffer cache, flush (write) all dirty buffers - if we need to flush (write) one dirty buffers, flush all others too This wouldn't catch cases like an explicit spin-up without data I/O, but I don't think this is much of a problem in real life. - Werner -- _ / Werner Almesberger, ICA, EPFL, CH [EMAIL PROTECTED] / /_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Sat, 9 Sep 2000, Richard Gooch wrote: >at least a day, IMO. There's probably no reason it can't effectively >be infinite. The kernel shouldn't be enforcing policy in this area. Right. An embedded usage where there are no writeable blockdevices can just set the interval to zero and avoid a schedule every 5 seconds. Andrea - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Sat, 9 Sep 2000, Tim Brunne wrote: >Thanks for this patch. But why hasn't it been included into >the kernel earlier? Wouldn't be a combination of yours and my It's basically included into 2.4.x. >patch be the proper way? As far as I understand you switch Your patch is sure fine. BTW, 2.4.x have an high limit of 10 minutes (as opposed to 2.2.x that have an high limit of 1 minute). I'd suggest to clean the patch to only increase the high limit value (one liner). Thanks. Andrea - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Sat, 9 Sep 2000, Alan Cox wrote: Alan you assume that you only have one disk (this is okay). How does this wakeup a spindown? If you call a 'SETMULTI" and the drive is not ready it may/will hang the system. This is why I think that the issue of a reset and then a polling loop of checkpower until you get a response that it is ready is the only safe thing to attempt. Note that I am waiting on my laptop to arrive and then I can comment better. Cheers, > > I have and offered it to the folks at linuxcare the apmd guys. > > The ideas were to create an ioctl pair that would/could knock-out a drive > > and preserve the settings, because the reset command to wake it up flushes > > the settings. Thus after the wakeup reset, and a checkpower-loop for > > ready-status in a passive drive query, the completion of the command would > > set the drive and host back to pre- suspend/hibernate mode. > > Something like > > CASIO FIVA でハイバーネーションを可能にする patch > Ver. 1.01, for Linux kernel-2.2.13 > > Copyright (C) 1999 INOUE, Yoshinari e-mail: [EMAIL PROTECTED] > > (This is an excerpt for the IDE bits) > > --- linux/arch/i386/kernel/apm.c.org Wed Nov 24 17:43:08 1999 > +++ linux/arch/i386/kernel/apm.c Wed Nov 24 17:43:18 1999 > @@ -779,6 +779,12 @@ > unsigned long flags; > int err; > > + if (ide_disk_suspend()) { > + printk(KERN_NOTICE "apm: suspend: reset disk failed\n"); > + apm_set_power_state(APM_STATE_REJECT); > + return; > + } > + > #ifndef CONFIG_APM_RTC_IS_GMT > /* >* Estimate time zone so that set_time can update the clock > @@ -807,6 +813,7 @@ > restore_flags(flags); > #endif > set_time(); > + ide_disk_resume(); > } > > static void standby(void) > --- linux/drivers/block/ide-disk.c.orgWed Nov 24 17:42:23 1999 > +++ linux/drivers/block/ide-disk.cThu Nov 25 12:43:10 1999 > @@ -52,6 +52,13 @@ > > #include "ide.h" > > +#ifdef CONFIG_APM > +#include > + > +static ide_drive_t *hda = 0; > +static int mult_count = -1; > +#endif > + > static void idedisk_bswap_data (void *buffer, int wcount) > { > u16 *p = buffer; > @@ -814,6 +821,10 @@ > continue; > } > idedisk_setup(drive); > +#ifdef CONFIG_APM > + if (!hda) > + hda = drive; > +#endif > if ((!drive->head || drive->head > 16) && !drive->select.b.lba) { > printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n", >drive->name, drive->head); > (void) idedisk_cleanup(drive); > @@ -825,6 +836,39 @@ > MOD_DEC_USE_COUNT; > return 0; > } > +#ifdef CONFIG_APM > + > +int ide_disk_suspend(void) > +{ > + int error, retry = 5; > + > + if (!hda) > + return (0); > + mult_count = hda->mult_count; > + if (mult_count == hda->id->max_multsect) { > + mult_count = -1; > + return (0); > + } > + while (retry-- > 0) { > + error = set_multcount(hda, hda->id->max_multsect); > + if (!error) > + return (0); > + } > + return (error); > +} > + > +void ide_disk_resume(void) > +{ > + int retry = 5; > + > + if (mult_count >= 0) > + while (retry-- > 0) > + if (set_multcount(hda, mult_count) == 0) > + break; > + mult_count = -1; > + return; > +} > +#endif > > #ifdef MODULE > int init_module (void) > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > Please read the FAQ at http://www.tux.org/lkml/ > Andre Hedrick The Linux ATA/IDE guy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Sat, 9 Sep 2000 [EMAIL PROTECTED] wrote: > On Sat, Sep 09, 2000 at 03:25:35PM +0200, Tim Brunne wrote: > > Thanks for this patch. But why hasn't it been included into > > the kernel earlier? Wouldn't be a combination of yours and my > > patch be the proper way? As far as I understand you switch > > off automatic buffer flushing completely, but it should be done > > every interval of time the administrator want's it. Why do > > you think that raising the upper limits of the kernel variables > > is not suitable? > > > Would it be possible to detect when the disk spins up, and do the flush then? Yes if you had a continuious polling of power status wrt standby. Andre Hedrick The Linux ATA/IDE guy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Sat, 9 Sep 2000, Russell King wrote: > Also, please note that I was talking about the whole machine, NOT just > the hard drive. Okay, but I was responding based upon the subject line. Cheers Andre Hedrick The Linux ATA/IDE guy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Christoph Rohland writes: > Russell King <[EMAIL PROTECTED]> writes: > > (and I've seen my Thinkpad 380XD with RH's 2.2.14-5.0 kernel and > > RH's apmd run itself dead. Kill apmd and it'll do the right thing > > and suspend, then hibernate. And no, I haven't even attempted to > > debugg it yet). > > Enable the 'Ignore multiple suspend' kernel option... Sorry, should've been more specific - I have recompiled the RH kernel with the following APM options: CONFIG_APM=y # CONFIG_APM_IGNORE_USER_SUSPEND is not set # CONFIG_APM_DO_ENABLE is not set CONFIG_APM_CPU_IDLE=y CONFIG_APM_DISPLAY_BLANK=y CONFIG_APM_POWER_OFF=y CONFIG_APM_IGNORE_MULTIPLE_SUSPEND=y # CONFIG_APM_IGNORE_SUSPEND_BOUNCE is not set CONFIG_APM_RTC_IS_GMT=y CONFIG_APM_ALLOW_INTS=y _ |_| - ---+---+- | | Russell King[EMAIL PROTECTED] --- --- | | | | http://www.arm.linux.org.uk/personal/aboutme.html / / | | +-+-+ --- -+- / | THE developer of ARM Linux |+| /|\ / | | | --- | +-+-+ - /\\\ | - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Russell King <[EMAIL PROTECTED]> writes: > Jamie Lokier writes: > > With laptops, people are willing > > to assume the RAM is reliable -- accidentally pulling the plug out won't > > lose the data. > > But a buggy apm implementation and the battery running down can. > > (and I've seen my Thinkpad 380XD with RH's 2.2.14-5.0 kernel and > RH's apmd run itself dead. Kill apmd and it'll do the right thing > and suspend, then hibernate. And no, I haven't even attempted to > debugg it yet). Enable the 'Ignore multiple suspend' kernel option... Greetings Christoph - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Sat, 9 Sep 2000, Tim Brunne wrote: > I think Jamie is right. The nice feature of the old > bdflushd deamon was, that disk writes were possible > without spin up of the disk, because of RAM > buffering. This is achived again by patching the > kernel later than 2.2.10. It is still possible with current kernels. As Jamie pointed out, just use noflushd, available from every debian mirror in the woody tree, or from http://www.tuebingen.linux.de/~s-kod1/noflushd/. This will provide you with the same functionality as the mobile bdflush or update versions on earlier kernels. Still the other proposals regarding noatime or upping the limits on bdflush params make sense and can be used orthogonal to or without noflushd. But note that there's an entirely user-level solution without the need to hack the kernel. Daniel. -- GNU/Linux Audio Mechanics - http://www.glame.de Cutting Edge Office - http://www.c10a02.de GPG Key ID 89BF7E2B - http://www.keyserver.net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Tim Brunne writes: > Richard Gooch wrote: > > > Jamie Lokier writes: > > > Russell King wrote: > > > > > With laptops, people are willing > > > > > to assume the RAM is reliable -- accidentally pulling the plug out won't > > > > > lose the data. > > > > > > > > But a buggy apm implementation and the battery running down can. > > > > > > Well, perhaps the risk is worth it. > > > At the least, people should be able to choose whether they are willing > > to take the risk or not. So a CONFIG_ option would do. > > Has such a patch been submitted? > > I think Jamie is right. The nice feature of the old > bdflushd deamon was, that disk writes were possible > without spin up of the disk, because of RAM > buffering. This is achived again by patching the > kernel later than 2.2.10. > > In my opinion a CONFIG_ option is not necessary: > In fs/buffer.c there are already *default values* and > *upper limits* for relevant kernel paramters present. > I just increased the upper limits *to be able* to modify > kernel parameters to suit my needs. Changing the upper > limits does *not* modify the default behaviour of the > kernel. OK, good. > So I think my tiny patch or some similar one should > become part of future kernels. There may be a more > reasonable choice for the upper limits. --- Unfortunately > I do not know how to "officially submit" a patch, if that > is what Richard means. Ask people like Rik and Andrea about reasonable upper limits. Make it at least a day, IMO. There's probably no reason it can't effectively be infinite. The kernel shouldn't be enforcing policy in this area. Memory pressure would force disc writes eventually anyway. Hack 2.4.0-test8 and test it. Then submit a to Linus and Cc: the kernel list. Regards, Richard Permanent: [EMAIL PROTECTED] Current: [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
> I have and offered it to the folks at linuxcare the apmd guys. > The ideas were to create an ioctl pair that would/could knock-out a drive > and preserve the settings, because the reset command to wake it up flushes > the settings. Thus after the wakeup reset, and a checkpower-loop for > ready-status in a passive drive query, the completion of the command would > set the drive and host back to pre- suspend/hibernate mode. Something like CASIO FIVA でハイバーネーションを可能にする patch Ver. 1.01, for Linux kernel-2.2.13 Copyright (C) 1999 INOUE, Yoshinari e-mail: [EMAIL PROTECTED] (This is an excerpt for the IDE bits) --- linux/arch/i386/kernel/apm.c.orgWed Nov 24 17:43:08 1999 +++ linux/arch/i386/kernel/apm.cWed Nov 24 17:43:18 1999 @@ -779,6 +779,12 @@ unsigned long flags; int err; + if (ide_disk_suspend()) { + printk(KERN_NOTICE "apm: suspend: reset disk failed\n"); + apm_set_power_state(APM_STATE_REJECT); + return; + } + #ifndef CONFIG_APM_RTC_IS_GMT /* * Estimate time zone so that set_time can update the clock @@ -807,6 +813,7 @@ restore_flags(flags); #endif set_time(); + ide_disk_resume(); } static void standby(void) --- linux/drivers/block/ide-disk.c.org Wed Nov 24 17:42:23 1999 +++ linux/drivers/block/ide-disk.c Thu Nov 25 12:43:10 1999 @@ -52,6 +52,13 @@ #include "ide.h" +#ifdef CONFIG_APM +#include + +static ide_drive_t *hda = 0; +static int mult_count = -1; +#endif + static void idedisk_bswap_data (void *buffer, int wcount) { u16 *p = buffer; @@ -814,6 +821,10 @@ continue; } idedisk_setup(drive); +#ifdef CONFIG_APM + if (!hda) + hda = drive; +#endif if ((!drive->head || drive->head > 16) && !drive->select.b.lba) { printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n", drive->name, drive->head); (void) idedisk_cleanup(drive); @@ -825,6 +836,39 @@ MOD_DEC_USE_COUNT; return 0; } +#ifdef CONFIG_APM + +int ide_disk_suspend(void) +{ + int error, retry = 5; + + if (!hda) + return (0); + mult_count = hda->mult_count; + if (mult_count == hda->id->max_multsect) { + mult_count = -1; + return (0); + } + while (retry-- > 0) { + error = set_multcount(hda, hda->id->max_multsect); + if (!error) + return (0); + } + return (error); +} + +void ide_disk_resume(void) +{ + int retry = 5; + + if (mult_count >= 0) + while (retry-- > 0) + if (set_multcount(hda, mult_count) == 0) + break; + mult_count = -1; + return; +} +#endif #ifdef MODULE int init_module (void) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Sat, Sep 09, 2000 at 03:25:35PM +0200, Tim Brunne wrote: > Thanks for this patch. But why hasn't it been included into > the kernel earlier? Wouldn't be a combination of yours and my > patch be the proper way? As far as I understand you switch > off automatic buffer flushing completely, but it should be done > every interval of time the administrator want's it. Why do > you think that raising the upper limits of the kernel variables > is not suitable? > Would it be possible to detect when the disk spins up, and do the flush then? Regards Rob > > Regards, > Tim > > -- > Tim Brunne | web: http://www.hmi.de/people/brunne > Hahn-Meitner-Institut | email: [EMAIL PROTECTED] > Glienicker Strasse 100 | office phone:+49-30-8062 2317 > D-14109 Berlin | office fax: +49-30-8062 2098 > Europe (Germany)| private phone & fax: +49-30-691 9265 > > > > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > Please read the FAQ at http://www.tux.org/lkml/ -- Rob Murray - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Andrea Arcangeli wrote: > On Fri, 8 Sep 2000, Tim Brunne wrote: > > >*a silent hard disk hard disk is no longer feasible since kernel > >2.2.11*. > > Try: > > echo 40 500 64 256 0 >/proc/sys/vm/bdflush > > once you want to return to the old behaviour: > > echo 40 500 64 256 500 >/proc/sys/vm/bdflush > killall -CONT kupdate > > With this below additional patch you can avoid having to modify the > bdflush sysctl and you can simply killall -STOP or killall -CONT kupdate > to wake/stop it (as you can just do in 2.4.x). Thanks for this patch. But why hasn't it been included into the kernel earlier? Wouldn't be a combination of yours and my patch be the proper way? As far as I understand you switch off automatic buffer flushing completely, but it should be done every interval of time the administrator want's it. Why do you think that raising the upper limits of the kernel variables is not suitable? > >ftp://ftp.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.2/2.2.18pre2aa2/00_kupdate-sigstop-2.2.11-1.gz > > Andrea Regards, Tim -- Tim Brunne | web: http://www.hmi.de/people/brunne Hahn-Meitner-Institut | email: [EMAIL PROTECTED] Glienicker Strasse 100 | office phone:+49-30-8062 2317 D-14109 Berlin | office fax: +49-30-8062 2098 Europe (Germany)| private phone & fax: +49-30-691 9265 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Fri, 8 Sep 2000, Tim Brunne wrote: >*a silent hard disk hard disk is no longer feasible since kernel >2.2.11*. Try: echo 40 500 64 256 0 >/proc/sys/vm/bdflush once you want to return to the old behaviour: echo 40 500 64 256 500 >/proc/sys/vm/bdflush killall -CONT kupdate With this below additional patch you can avoid having to modify the bdflush sysctl and you can simply killall -STOP or killall -CONT kupdate to wake/stop it (as you can just do in 2.4.x). ftp://ftp.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.2/2.2.18pre2aa2/00_kupdate-sigstop-2.2.11-1.gz Andrea - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Richard Gooch wrote: > Jamie Lokier writes: > > Russell King wrote: > > > > With laptops, people are willing > > > > to assume the RAM is reliable -- accidentally pulling the plug out won't > > > > lose the data. > > > > > > But a buggy apm implementation and the battery running down can. > > > > Well, perhaps the risk is worth it. > At the least, people should be able to choose whether they are willing > to take the risk or not. So a CONFIG_ option would do. > Has such a patch been submitted? I think Jamie is right. The nice feature of the old bdflushd deamon was, that disk writes were possible without spin up of the disk, because of RAM buffering. This is achived again by patching the kernel later than 2.2.10. In my opinion a CONFIG_ option is not necessary: In fs/buffer.c there are already *default values* and *upper limits* for relevant kernel paramters present. I just increased the upper limits *to be able* to modify kernel parameters to suit my needs. Changing the upper limits does *not* modify the default behaviour of the kernel. So I think my tiny patch or some similar one should become part of future kernels. There may be a more reasonable choice for the upper limits. --- Unfortunately I do not know how to "officially submit" a patch, if that is what Richard means. Regarding the proposals of Russel. It's true what you say, but also what Jamie said: I like to do some work on files in some subdirectory "xyz", doing a "cat //xyz/* > /dev/null" I can read, modify and write files without any hard disk running. The system doesn't crash, so everything is nice. I use the notebook a lot as a simple X-terminal without accessing the local disk, so again in principle hours of work are possible without a spinning hard disk. And I don't have to tailor a lot of deamons, etc. . A simple write to /proc/sys/vm/bdflush and calling hdparm once, both in some startup script is sufficient. Thanks to all of you for your replies and interest! Regards, Tim -- patch: http://www.hmi.de/people/brunne/Spindown - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Andre Hedrick writes: > If apmd could issue a WIN_STANDBY value and execute WIN_STANDBYNOW1 then > the drive would know the thresholds to attempt a "suspend". Where as an > issue of WIN_SLEEPNOW1 would "hibernate" the drive. Ok, so that deals with the hard drive, so the series of events on hibernate is: 1. User hits hibernate key combination 2. Message gets sent from the APM bios to the kernel, and then to apmd 3. apmd tells the hard drive to hibernate 4. apmd tells the kernel that its all done 5. kernel acknowledges the request to the APM bios 6. APM bios then accesses the hard drive to write the memory contents out to disk, spinning it up. Therefore, making apmd send the "hibernate" command to the disk is wrong. Also, please note that I was talking about the whole machine, NOT just the hard drive. _ |_| - ---+---+- | | Russell King[EMAIL PROTECTED] --- --- | | | | http://www.arm.linux.org.uk/personal/aboutme.html / / | | +-+-+ --- -+- / | THE developer of ARM Linux |+| /|\ / | | | --- | +-+-+ - /\\\ | - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Sat, 9 Sep 2000, Russell King wrote: > Andre Hedrick writes: > > You know that it would take me 25 minutes or less to fix the code if I had > > a full native taskfile. This would allow a (void *)(void) to be set in > > kernel apmd and have all the drive data and callouts. > > Andre, > > I totally fail to see how taskfile will fix the problem of apmd not > allowing my laptop to automatically suspend or hibernate. I did to until I asked somebody, then thought about it, read some more, and requestioned the notion, and then it seemed reasonable. If apmd could issue a WIN_STANDBY value and execute WIN_STANDBYNOW1 then the drive would know the thresholds to attempt a "suspend". Where as an issue of WIN_SLEEPNOW1 would "hibernate" the drive. > Please explain how the ability to suspend/hibernate, which seems to > be dependent on apmd has to do with whether or not the kernel > provides taskfile, which apmd would not use. If there were callable ioctl's or callout functions, apmd could actively control suspend/hibernate and apm-drive power thresholds to increase battery runtime. At least this was the intent of the additions set forward by the drive guys, as explained to me. > Please, for your own sake, think about the problem being discussed > before posting "taskfile would fix that" comments. I have and offered it to the folks at linuxcare the apmd guys. The ideas were to create an ioctl pair that would/could knock-out a drive and preserve the settings, because the reset command to wake it up flushes the settings. Thus after the wakeup reset, and a checkpower-loop for ready-status in a passive drive query, the completion of the command would set the drive and host back to pre- suspend/hibernate mode. This in combination of the bios telling apmd to do something, apmd now can parallel the bios if there is a problem and correct if possible. Once I get my laptop, I will verify this and send you the results. Now if I missed the initial point, I apologize. Cheers, Andre Hedrick The Linux ATA/IDE guy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Andre Hedrick writes: > You know that it would take me 25 minutes or less to fix the code if I had > a full native taskfile. This would allow a (void *)(void) to be set in > kernel apmd and have all the drive data and callouts. Andre, I totally fail to see how taskfile will fix the problem of apmd not allowing my laptop to automatically suspend or hibernate. Please explain how the ability to suspend/hibernate, which seems to be dependent on apmd has to do with whether or not the kernel provides taskfile, which apmd would not use. Please, for your own sake, think about the problem being discussed before posting "taskfile would fix that" comments. _ |_| - ---+---+- | | Russell King[EMAIL PROTECTED] --- --- | | | | http://www.arm.linux.org.uk/personal/aboutme.html / / | | +-+-+ --- -+- / | THE developer of ARM Linux |+| /|\ / | | | --- | +-+-+ - /\\\ | - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Fri, 8 Sep 2000, Russell King wrote: > Jamie Lokier writes: > > With laptops, people are willing > > to assume the RAM is reliable -- accidentally pulling the plug out won't > > lose the data. > > But a buggy apm implementation and the battery running down can. > > (and I've seen my Thinkpad 380XD with RH's 2.2.14-5.0 kernel and > RH's apmd run itself dead. Kill apmd and it'll do the right thing > and suspend, then hibernate. And no, I haven't even attempted to > debugg it yet). Russell, You know that it would take me 25 minutes or less to fix the code if I had a full native taskfile. This would allow a (void *)(void) to be set in kernel apmd and have all the drive data and callouts. But that is not doable until 2.5, sorry. Cheers, Andre Hedrick The Linux ATA/IDE guy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
On Sat, Sep 09, 2000 at 12:32:27AM +0200, Jamie Lokier wrote: > You're right, but what you're missing is that with "noflushd", it was > possible to keep the disk spun down _even with pending writes_. You may tweak /proc/sys/vm/bdflush to have it collect data for a long time before it is written to disk. This incurs some risk though: Your memory will get less and less, because more and more is occupied byt dirty buffers. At a certain percentage (first bdflush param), it will start to write to disk ... Regards, -- Kurt Garloff <[EMAIL PROTECTED]> Eindhoven, NL GPG key: See mail header, key servers Linux kernel development SuSE GmbH, Nuernberg, FRG SCSI, Security - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Jamie Lokier writes: > Russell King wrote: > > > With laptops, people are willing > > > to assume the RAM is reliable -- accidentally pulling the plug out won't > > > lose the data. > > > > But a buggy apm implementation and the battery running down can. > > Well, perhaps the risk is worth it. At the least, people should be able to choose whether they are willing to take the risk or not. So a CONFIG_ option would do. Has such a patch been submitted? Regards, Richard Permanent: [EMAIL PROTECTED] Current: [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Russell King wrote: > > With laptops, people are willing > > to assume the RAM is reliable -- accidentally pulling the plug out won't > > lose the data. > > But a buggy apm implementation and the battery running down can. Well, perhaps the risk is worth it. -- Jamie - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Jamie Lokier writes: > With laptops, people are willing > to assume the RAM is reliable -- accidentally pulling the plug out won't > lose the data. But a buggy apm implementation and the battery running down can. (and I've seen my Thinkpad 380XD with RH's 2.2.14-5.0 kernel and RH's apmd run itself dead. Kill apmd and it'll do the right thing and suspend, then hibernate. And no, I haven't even attempted to debugg it yet). _ |_| - ---+---+- | | Russell King[EMAIL PROTECTED] --- --- | | | | http://www.arm.linux.org.uk/personal/aboutme.html / / | | +-+-+ --- -+- / | THE developer of ARM Linux |+| /|\ / | | | --- | +-+-+ - /\\\ | - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Russell King wrote: > > *a silent hard disk hard disk is no longer feasible since kernel > > 2.2.11*. > > Yes it is. I have one of my machines (which NFS serves a NFS root > client, both of which are on 24 hours a day) capable of spinning > down for up to 4 hours at a time, with no kernel modifications > what so ever. You're right, but what you're missing is that with "noflushd", it was possible to keep the disk spun down _even with pending writes_. > It does. You really want to think about how you partition your disk > in conjunction with what the filesystems will contain, and what options > you want to mount with. The options that you're looking for are: > > nodiratime > noatime > > Use of these prevents the update of the "access times" for files. > > Oh, I also have /var/run and /var/lock as a ramdisk (they only > refer to current system state). > > Some user space programs will need to be modified - cron and ypbind > are the two that spring to mind. cron to prevent it writing to > /var/log/cron (not the security concerns with this mod), and to place > ypbind's temporary file that it polls once every 10 seconds into > /var/run. These suggestions are good for laptops because they reduce the amount of pending writeback, even with "noflushd". However, they still don't save you from spinning up the disk when you _do_ write something and you have enough RAM to hold the data for a few hours until you must spin up the disk. E.g. you might compile a program or send some mail. These things write to the "disk", but you don't have to really spin up your disk if there's enough RAM to hold the pending writes. With laptops, people are willing to assume the RAM is reliable -- accidentally pulling the plug out won't lose the data. -- Jamie - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
Re: Notebook disk spindown
Tim Brunne writes: > *a silent hard disk hard disk is no longer feasible since kernel > 2.2.11*. Yes it is. I have one of my machines (which NFS serves a NFS root client, both of which are on 24 hours a day) capable of spinning down for up to 4 hours at a time, with no kernel modifications what so ever. > Shouldn't Linux support hard disk spindown during periods of > inactivity? Is the tiny patch worth of being included into standard > kernels? It does. You really want to think about how you partition your disk in conjunction with what the filesystems will contain, and what options you want to mount with. The options that you're looking for are: nodiratime noatime Use of these prevents the update of the "access times" for files. Oh, I also have /var/run and /var/lock as a ramdisk (they only refer to current system state). Some user space programs will need to be modified - cron and ypbind are the two that spring to mind. cron to prevent it writing to /var/log/cron (not the security concerns with this mod), and to place ypbind's temporary file that it polls once every 10 seconds into /var/run. Hope this helps. _ |_| - ---+---+- | | Russell King[EMAIL PROTECTED] --- --- | | | | http://www.arm.linux.org.uk/personal/aboutme.html / / | | +-+-+ --- -+- / | THE developer of ARM Linux |+| /|\ / | | | --- | +-+-+ - /\\\ | - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/