[laptop-mode] Improving readahead behaviour

Ritesh Raj Sarraf rrs at researchut.com
Mon Nov 23 18:04:19 CET 2009


--nextPart20644198.KX5fukkhn5
Content-Type: Text/Plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable

The Linux kernel has Adaptive Read Ahead but I haven't really followed the=
=20
current behavior. Whatever it is, I am sure it tries to minimize disk spin=
=20
ups.

=46or your example, I think it makes more sense to just increase the value.=
 mp3s=20
usually would be around 3-5 mb. So if you keep a value for 5mb, you ensure=
=20
that one single read is good enough to store the entire file into buffer an=
d not=20
cause the disk to keep spinning.

I think adaptive readahead was more about making the kernel smart enough to=
=20
sense that the user is reading a big file. So it would read chunks of the s=
ame=20
big file in advance.


Ritesh


On Monday 23 Nov 2009 21:50:49 Matthijs Kooijman wrote:
> Hi all,
>=20
> I'm using laptopmode to (among other things) increase the readahead value.
> I've set it to 3MB currently:
>=20
>   LM_READAHEAD=3D3072
>=20
> However, every now and then I still have my music delay for a second or t=
wo
> while my harddisk is spinning up. This is probably when my mp3 files are
> larger than this 3MB. I could of course increase this value further, but
>  I'm afraid that will cause performance problems for other files.
>=20
> Also, it seems this is not the proper solution to this problem. Is there
>  any way to make the kernel smarter and make it start buffering when the
>  readahead buffer is getting empty (instead of when it _is_ empty). Perha=
ps
>  by setting some minimal readahead buffer value, or by letting the kernel
>  observe that an application is slowly consuming a file at a constant rat=
e?
>  Perhaps by letting the application itself tell the kernel that it wants a
>  constant stream?
>=20
> I've tried using mplayer for playback and setting all kinds of buffer or
>  cache options, but that didn't seem to work.
>=20
> Are other people seeing this problem? Does anyone have a solution?
>=20
> Gr.
>=20
> Matthijs
>=20

=2D-=20
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."

--nextPart20644198.KX5fukkhn5
Content-Description: This is a digitally signed message part.
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.samwel.tk/pipermail/laptop-mode/attachments/20091123/fb645f71/attachment.pgp>

--nextPart20644198.KX5fukkhn5--


More information about the laptop-mode mailing list