From mboxrd@z Thu Jan 1 00:00:00 1970 From: NeilBrown Subject: Re: dummy file read periodically for external USB Hard Disk Date: Tue, 8 Jul 2014 13:01:27 +1000 Message-ID: <20140708130127.0f29a46f@notabene.brown> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/Bn+deCPd90_4zGWI3AJLwrF"; protocol="application/pgp-signature" Cc: Linux-FSDevel To: loody Return-path: Received: from cantor2.suse.de ([195.135.220.15]:43438 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751566AbaGHDBd (ORCPT ); Mon, 7 Jul 2014 23:01:33 -0400 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --Sig_/Bn+deCPd90_4zGWI3AJLwrF Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 7 Jul 2014 22:42:29 +0800 loody wrote: > hi all: > we met a USB Hard Disk that will go to suspend if host stop > sending scsi read command over 5mins. > To save the IO, kernel will keep the file in page cache as much as > he can and under this circumstances, the read command may disappear > for a while longer enough to cause the device suspend. >=20 > is there any kernel config or module parameter can do the dummy > read periodically, even the sector 0 (MBR) is fine. > or is there any kernel api I can use to read sector 0(MBR) maybe > every 4mins? >=20 > appreciate your help in advance, > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" = in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Open the device with O_DIRECT and read a block every 4 minutes. That should keep it awake. NeilBrown --Sig_/Bn+deCPd90_4zGWI3AJLwrF Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIVAwUBU7tfBznsnt1WYoG5AQLZLxAAiaFYWSTYAZXDWNV7zsqUsxkaYf1pFPt2 yHNMZcYs7v4ifT+gUc+YuVNVqt8CrFJsZ/PAy/AsRqHHrZ3/f8xZQK2BOFWfjzRt j7lKKPd9cyLEXA22wod1gK2T8XEULcR4UAlnMvby5WWzH7j51KeC0YPC2ptD/+B4 3lXJt/5abyrk7iw9rlShCyZZrazPqyp847Vn+mGia4Otz4qYOU9DaQx2yta7cUU5 /Ad1M9f5eYDWtDzUU/nC6mlsjhOGaI9Oz+D/Dc1USzM/vsi0PvcOmM+EntVfXcZE 8BK78Asfj1l/dnjl+Q6mY5Cw5BeafgnVrQhRc/lbT3i5WfaQl9xL7BEtQlDh7Lbx GpYjPv3qMaOAM/TmAu2Nd8eBnvdxK5rg+PWP/C43YJdyu9/Z4NWVeb1SFfwpc72B YsB/thEJpmFdtHKO+UiVSPWiH+ySmtmTmO0qkrQHVbofz3WjNcb9f5YJGOcdlaUG pfquVTPnHF7IoGOjbUSsMVXeAbLeTpW8Z7ILJOgIP9gytkk8AOXa2ZsLKmJ2Pyut iuGPRZTv4cpERLQNWmKds+n71GpQGeNi8z1yGSitqo+aVuJuQvWFg3jMJIdY+a7M +NYYo8N1koN2fGy4BKtQdjjnXYY46fUn1LrdrQAwhxLg16oy0B8eKSPU1n8Hs2NA xWx5h0NqLkE= =FPO6 -----END PGP SIGNATURE----- --Sig_/Bn+deCPd90_4zGWI3AJLwrF--