linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux kernel - and regular sync'ing?
@ 2001-03-08  4:21 Brian Dushaw
  2001-03-08 12:09 ` Alan Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Brian Dushaw @ 2001-03-08  4:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Brian Dushaw

Hey There Kernel-people!
   I have a disk accessing question you may be able to help me with,
if I may be so bold....
   I have a notebook computer, and in the interests of saving power
I am trying to get its disk to go into suspend mode (hdparm -S 6 /dev/hda,
say...)  However, something seems to be continuously accessing the disk
at irregular intervals of 10-30 seconds, most likely calls to sync, so
that the disk never gets to sleep for long.  I've followed advice in the
various HOWTO's, e.g. modifying the line "ud::once:/sbin/update" in
/etc/inittab to only sync once an hour, to no avail.  Watching "top", it
sure looks as if various kernel-based daemons are responsible...nothing
else is running!
   Can you offer me any advice?  Any tweeks I can make to tell the system
that sync'ing only once every 5 minutes is o.k.?
   I have the 2.4.2 kernel (older kernels behaved the same way) and
the RedHat 6.2 distribution.

Thx!
B.D.

-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Brian Dushaw
Applied Physics Laboratory
University of Washington
1013 N.E. 40th Street
Seattle, WA  98105-6698
(206) 685-4198   (206) 543-1300
(206) 543-6785 (fax)
dushaw@apl.washington.edu

Web Page:  http://staff.washington.edu/dushaw/index.html


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

* Re: Linux kernel - and regular sync'ing?
  2001-03-08  4:21 Linux kernel - and regular sync'ing? Brian Dushaw
@ 2001-03-08 12:09 ` Alan Cox
  2001-03-08 22:33   ` Russell King
  2001-03-09 11:46   ` Pavel Machek
  0 siblings, 2 replies; 7+ messages in thread
From: Alan Cox @ 2001-03-08 12:09 UTC (permalink / raw)
  To: Brian Dushaw; +Cc: linux-kernel, Brian Dushaw

> at irregular intervals of 10-30 seconds, most likely calls to sync, so
> that the disk never gets to sleep for long.  I've followed advice in the
> various HOWTO's, e.g. modifying the line "ud::once:/sbin/update" in
> /etc/inittab to only sync once an hour, to no avail.  Watching "top", it

Thats actually I think poor advice - it wont help and its asking to lose data

>    Can you offer me any advice?  Any tweeks I can make to tell the system
> that sync'ing only once every 5 minutes is o.k.?

You machine can sync continually - providing it isnt writing data. The real
question is not 'why is it syncing' but 'what is it syncing'.

The normal answer is file access times, and you can turn those off with the
noatime mount option.

To quote the linux on palmax page

   For startup my /etc/rc.d/rc.local contains the following lines.
mount -o remount,rw,noatime /
/sbin/hdparm -S 15 /dev/hda

   The  "noatime"  setting  turns off the writing back of 'last accessed'
   times  to  files. This means reading/opening files does not cause disk
   wakeups.  The  hdparm -S 15 command sets the disk to spin down after 1
   minute  15 seconds (you can play with the value).

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

* Re: Linux kernel - and regular sync'ing?
  2001-03-08 12:09 ` Alan Cox
@ 2001-03-08 22:33   ` Russell King
  2001-03-08 22:50     ` Brian Dushaw
  2001-03-09 11:46   ` Pavel Machek
  1 sibling, 1 reply; 7+ messages in thread
From: Russell King @ 2001-03-08 22:33 UTC (permalink / raw)
  To: Alan Cox; +Cc: Brian Dushaw, linux-kernel

On Thu, Mar 08, 2001 at 12:09:51PM +0000, Alan Cox wrote:
> To quote the linux on palmax page
> 
>    For startup my /etc/rc.d/rc.local contains the following lines.
> mount -o remount,rw,noatime /
> /sbin/hdparm -S 15 /dev/hda

Or else place "noatime" in /etc/fstab, which is probably the better
place for it.

--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

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

* Re: Linux kernel - and regular sync'ing?
  2001-03-08 22:33   ` Russell King
@ 2001-03-08 22:50     ` Brian Dushaw
  2001-03-12 19:27       ` Mark Shewmaker
  0 siblings, 1 reply; 7+ messages in thread
From: Brian Dushaw @ 2001-03-08 22:50 UTC (permalink / raw)
  To: linux-kernel

In the interests of finishing off this thread:
  Thanks to all who replied to my question on how to get a notebook
disk to spin down.  The clear consensus is:
- the problem was probably caused by the cron daemon (I have some doubts
    about this, but never mind)
- the problem is fixed by adding the "noatime" option when mounting the
    root filesystem (I use /etc/fstab to do this)
- there appears to be no harm in not updating the inode access times with
    this option.
- I am now using "hdparm -S 6 /dev/hda" to great effect; placed in my
    /etc/rc.d/rc.local file.
- Naturally as soon as I learned all this from this e-mail thread, I found
    the appropriate paragraph in an out-of-the-way spot on the "Linux on
    Notebooks" pages (this must be one of Murphy's Laws... :) )
- I've added this discussion to my notebook web page in the interest of
    spreading this gem of information.

B.D.


On Thu, 8 Mar 2001, Russell King wrote:

> On Thu, Mar 08, 2001 at 12:09:51PM +0000, Alan Cox wrote:
> > To quote the linux on palmax page
> >
> >    For startup my /etc/rc.d/rc.local contains the following lines.
> > mount -o remount,rw,noatime /
> > /sbin/hdparm -S 15 /dev/hda
>
> Or else place "noatime" in /etc/fstab, which is probably the better
> place for it.
>
> --
> Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
>              http://www.arm.linux.org.uk/personal/aboutme.html
>

-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Brian Dushaw
Applied Physics Laboratory
University of Washington
1013 N.E. 40th Street
Seattle, WA  98105-6698
(206) 685-4198   (206) 543-1300
(206) 543-6785 (fax)
dushaw@apl.washington.edu

Web Page:  http://staff.washington.edu/dushaw/index.html


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

* Re: Linux kernel - and regular sync'ing?
  2001-03-08 12:09 ` Alan Cox
  2001-03-08 22:33   ` Russell King
@ 2001-03-09 11:46   ` Pavel Machek
  1 sibling, 0 replies; 7+ messages in thread
From: Pavel Machek @ 2001-03-09 11:46 UTC (permalink / raw)
  To: Alan Cox, Brian Dushaw; +Cc: linux-kernel

Hi!

> > at irregular intervals of 10-30 seconds, most likely calls to sync, so
> > that the disk never gets to sleep for long.  I've followed advice in the
> > various HOWTO's, e.g. modifying the line "ud::once:/sbin/update" in
> > /etc/inittab to only sync once an hour, to no avail.  Watching "top", it
> 
> Thats actually I think poor advice - it wont help and its asking to
> lose data

Get noflushd. (It is _also_ asking for data loose, if you write and
disk is spinned down, it will *not* bother spinning it up; you can
leave atimes on.)
								Pavel
-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org

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

* Re: Linux kernel - and regular sync'ing?
  2001-03-08 22:50     ` Brian Dushaw
@ 2001-03-12 19:27       ` Mark Shewmaker
  2001-03-13 19:43         ` Russell King
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Shewmaker @ 2001-03-12 19:27 UTC (permalink / raw)
  To: Brian Dushaw; +Cc: linux-kernel

On Thu, Mar 08, 2001 at 02:50:46PM -0800, Brian Dushaw wrote:
> - the problem is fixed by adding the "noatime" option when mounting the
>     root filesystem (I use /etc/fstab to do this)
> - there appears to be no harm in not updating the inode access times with
>     this option.

As an aside, you may want to keep in mind the fact that you've edited
the /etc/fstab in this way, in case random oddities show up in the future.

Short story:

Once after a system upgrade, some of the user accounts developed a problem
in which the message "You have new mail" would be printed on the screen
at every login.  The message would be printed whether or not the user
actually had new mail.  The problem was independent of the login shell
used, but it would only happen for some users.

It turned out that the "problem" was a few lines in the login program
itself.  login was comparing the atime and mtime timestamps of $MAIL.
If mtime>atime, then it figured you had new mail and would print that
message.

That makes sense--if your mailbox had been written to (modified) since
it was last read (accessed), then that's as as good a definition as any
of having new mail.  But, I had put "noatime" in /etc/fstab during the
upgrade for the line for the filesystem that /var/spool/mail was in,
and no one's mail spool had had its atime updated since the upgrade, hence
"You have new mail" messages were printed during some users' logins.

(It turned out that the folks who were not getting the message at all
were sorting all their mail into separate folders, leaving $MAIL
empty all the time.)

We decided that the slight performance advantages of the noatime option
weren't worth it and quickly removed the option.  (-o remount is great!)

It's probably very much worth it for you to keep your /etc/fstab as you've
edited it, but I did want to warn you that the noatime option can
still unexpectedly break programs that make quite reasonable assumptions.

 -Mark Shewmaker
  mark@primefactor.com

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

* Re: Linux kernel - and regular sync'ing?
  2001-03-12 19:27       ` Mark Shewmaker
@ 2001-03-13 19:43         ` Russell King
  0 siblings, 0 replies; 7+ messages in thread
From: Russell King @ 2001-03-13 19:43 UTC (permalink / raw)
  To: Mark Shewmaker; +Cc: Brian Dushaw, linux-kernel

On Mon, Mar 12, 2001 at 02:27:02PM -0500, Mark Shewmaker wrote:
> It's probably very much worth it for you to keep your /etc/fstab as you've
> edited it, but I did want to warn you that the noatime option can
> still unexpectedly break programs that make quite reasonable assumptions.

Easy workaround - place your /home and /var trees on separate filesystems
and mount /home normally.  Make /var "nodiratime" so accessing directories
doesn't update their atime.  Make / "noatime".

This is basically what I've been running here for the past couple of years
and it seems fine for me.  Your milage may vary though (depending on what
software you run).

--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


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

end of thread, other threads:[~2001-03-13 21:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-08  4:21 Linux kernel - and regular sync'ing? Brian Dushaw
2001-03-08 12:09 ` Alan Cox
2001-03-08 22:33   ` Russell King
2001-03-08 22:50     ` Brian Dushaw
2001-03-12 19:27       ` Mark Shewmaker
2001-03-13 19:43         ` Russell King
2001-03-09 11:46   ` Pavel Machek

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).