[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: who is r/w-ing my hdd?



On Mon, 16 Jan 2006 23:26:00 -0600
Mike McCarty <mike.mccarty@sbcglobal.net> wrote:

> Ron Johnson wrote:
> > On Fri, 2006-01-13 at 12:00 -0600, Mike McCarty wrote:
> > 
> >>Matthias Pfeifer wrote:
> >>
> >>>Jochen Schulz <ml@well-adjusted.de> wrote in news:5unNS-8tn-23@gated-
> >>>at.bofh.it:
> >>>
> >>>
> >>>
> >>>>Matthias:
> >>>>
> >>>>
> >>>>>I am searching the source of some every 2/3 seconds
> >>>>>happening harddisk read/write operation.
> >>>>
> >>>>If you are using a journalling file system like ext3, this is normal and
> >>>>shouldn't stress your hard disk.
> >>>>
> >>>>J.
> >>>
> >>>
> >>>How is that? And how does that correspond to my
> >>>observation that it must be the x-window-system
> >>>that is taking a role in this situation? Can
> >>>you explain, please?
> >>
> >>I find the answer confusing as well. No matter what FS
> >>one is using, it shouldn't be writing the disc unless
> >>someone requests it. The write may be delayed, but it
> >>shouldn't be created out of thin air. Same thing for
> >>reads. Somewhere there is a process doing disc I/O.
> > 
> > 
> > You're thinking like this is a single-tasking OS.  Even on a 
> > relatively quiet system, when you have a journaling FS, the kernel
> > will be doing more background disk activity than you'd expect.
> > 
> 

The kernel doesn't initiate disk writes out of thin air. There are several reasons to do it:

1. The buffer gets flushed about every 40 seconds or so IIRC, but that depends
    on things actually being present in the buffer.

2. A journaling file system writes a journal transaction record every 20 or so
   seconds, depending on the file system. I can dig up some old mails concerning
   laptop mode if you want which talk about these two.

3. Access to swap or disk reads is a more logical reason since disk reads are
   immidiate but disk writes go through the buffer to bunch several writes
   together, mostly for speed reasons.

4. The kernel logger is writing data to the log (klogd, syslogd). There may be
   a lot of log activity going on. You can try either monitoring /var/log/
   possibly messages or syslog are getting written to if its the kernel, or
   XFree86.0.log or Xorg.0.log if its X or possibly .Xsession-errors if its user
   side problems with X.

What used to be possible is to use laptop mode to see processes accessing the
disk. You can try from a console (I don't think you will see the messages from
an xterm, only the console)

echo 1 > /proc/sys/vm/laptop_mode
echo 1 > /proc/sys/vm/block_dump

It should display all disk accesses (IIRC you do need also the laptop mode line)


> This response almost makes me angry. I said specifically
> A PROCESS. I didn't say what kind of process. The file system
> should not generate writes out of nothing. Somewhere there
> is A PROCESS (an instance of a running program, maybe a daemon,
> maybe the kernel, who cares, some process) which is generating reads
> or writes.
> 
> I WROTE a multitasking embedded O/S in 1984, and have participated
> in writing another, and in supporting two others. So don't lecture
> me about thinking single-threaded.
> 
> Mike
> -- 
> p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
> This message made from 100% recycled bits.
> You have found the bank of Larn.
> I can explain it for you, but I can't understand it for you.
> I speak only for myself, and I am unanimous in that!
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 
>  
>  +++++++++++++++++++++++++++++++++++++++++++
>  This Mail Was Scanned By Mail-seCure System
>  at the Tel-Aviv University CC.
> 

 
 +++++++++++++++++++++++++++++++++++++++++++
 This Mail Was Scanned By Mail-seCure System
 at the Tel-Aviv University CC.



Reply to: