lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 1 Jan 2009 11:49:40 -0500
From:	Dave Johnson <dave-lkml-01@...terclick.org>
To:	Bart Samwel <bart@...wel.tk>
Cc:	linux-kernel@...r.kernel.org, linux-ext4@...r.kernel.org
Subject: Re: [ext3] kjournald writing after each read despite noatime,commit=nnn

Bart Samwel writes:
> This is the defined behaviour for laptop_mode. Whenever a *physical*
> READ takes place, this is taken to indicate that the disk is spun up at
> that time. The laptop_mode functionality then takes that opportunity to
> sync any dirty data to disk, two seconds (or whatever value you put in
> /proc/sys/vm/laptop_mode) after the physical disk activity has ceased.
> The rationale behind this is that you want to sync your stuff when the
> disk is spun up, and then you want to hold back writing back stuff for a
> very long while. And the only way it can detect that the disk is spun up
> is when there is physical disk activity.
> 
> This is exactly what happens in your case. The READ activity reported by
> block_dump is *physical* read activity: some data was needed that was
> not cached in memory. block_dump does not show you what data was
> retrieved from the ext3 fs *without* having to access the disk, it only
> shows actual physical disk I/O.

Yep sounds good, but this happens even if there is no dirty data
needing a sync back to disk.

$ grep 'Dirty\|Write' /proc/meminfo 
Dirty:               0 kB
Writeback:           0 kB
WritebackTmp:        0 kB
$ cat /some/uncached/file >/dev/null 

Jan  1 11:43:49 gw kernel: cat(6615): READ block 864408 on hda1 
Jan  1 11:43:51 gw kernel: kjournald(760): WRITE block 2376 on hda1 


Note, the reason I ask is this is a SSD so just because a physical
read has taken place recently unneeded writes should be avoided.

Turning laptop_mode to 0, but leaving other settings the same
resolves the uneeded write:

$ echo 0 > /proc/sys/vm/laptop_mode 
$ grep 'Dirty\|Write' /proc/meminfo 
Dirty:               0 kB
Writeback:           0 kB
WritebackTmp:        0 kB
$ cat /some/other/uncached/file >/dev/null

Jan  1 11:47:15 gw kernel: cat(6653): READ block 864258 on hda1 


-- 
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ