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] [day] [month] [year] [list]
Message-ID: <CAA9v8mF+D=bdn9QSNcMv81BSog1okkK=wCLHKGi6NBWoQzyC-w@mail.gmail.com>
Date:	Fri, 26 Oct 2012 16:13:32 +0800
From:	YingHang Zhu <casualfisher@...il.com>
To:	Fengguang Wu <fengguang.wu@...el.com>
Cc:	akpm@...ux-foundation.org, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, Dave Chinner <david@...morbit.com>,
	linux-mm@...ck.org, Ni zhan Chen <nizhan.chen@...il.com>
Subject: Re: [PATCH] mm: readahead: remove redundant ra_pages in file_ra_state

Hi Fengguang,

On Fri, Oct 26, 2012 at 4:02 PM, Fengguang Wu <fengguang.wu@...el.com> wrote:
> On Fri, Oct 26, 2012 at 03:47:19PM +0800, Ni zhan Chen wrote:
>> On 10/26/2012 03:36 PM, Fengguang Wu wrote:
>> >On Fri, Oct 26, 2012 at 03:19:57PM +0800, Ni zhan Chen wrote:
>> >>On 10/26/2012 03:09 PM, Fengguang Wu wrote:
>> >>>On Fri, Oct 26, 2012 at 03:03:12PM +0800, Ni zhan Chen wrote:
>> >>>>On 10/26/2012 02:58 PM, Fengguang Wu wrote:
>> >>>>>>  static void shrink_readahead_size_eio(struct file *filp,
>> >>>>>>                                         struct file_ra_state *ra)
>> >>>>>>  {
>> >>>>>>-       ra->ra_pages /= 4;
>> >>>>>>+       spin_lock(&filp->f_lock);
>> >>>>>>+       filp->f_mode |= FMODE_RANDOM;
>> >>>>>>+       spin_unlock(&filp->f_lock);
>> >>>>>>
>> >>>>>>As the example in comment above this function, the read maybe still
>> >>>>>>sequential, and it will waste IO bandwith if modify to FMODE_RANDOM
>> >>>>>>directly.
>> >>>>>Yes immediately disabling readahead may hurt IO performance, the
>> >>>>>original '/ 4' may perform better when there are only 1-3 IO errors
>> >>>>>encountered.
>> >>>>Hi Fengguang,
>> >>>>
>> >>>>Why the number should be 1-3?
>> >>>The original behavior is '/= 4' on each error.
>> >>>
>> >>>After 1 errors, readahead size will be shrinked by 1/4
>> >>>After 2 errors, readahead size will be shrinked by 1/16
>> >>>After 3 errors, readahead size will be shrinked by 1/64
>> >>>After 4 errors, readahead size will be effectively 0 (disabled)
>> >>But from function shrink_readahead_size_eio and its caller
>> >>filemap_fault I can't find the behavior you mentioned. How you
>> >>figure out it?
>> >It's this line in shrink_readahead_size_eio():
>> >
>> >         ra->ra_pages /= 4;
>>
>> Yeah, I mean why the 4th readahead size will be 0(disabled)? What's
>> the original value of ra->ra_pages? How can guarantee the 4th shrink
>> readahead size can be 0?
>
> Ah OK, I'm talking about the typical case. The default readahead size
> is 128k, which will become 0 after / 256. The reasonable good ra size
> for hard disks is 1MB=256pages, which also becomes 1page after 4 errors.

How do you feel about my previous mail of error statistics, in fact I
prefer treating these files independently,  so do some check for FMODE_RANDOM
before we change the readahead window to avoid trashing the read ahead window,
If the user applications call fadvise but the media turn out to be
error-prone, after one
read we know the situation and set the file in FMODE_RANDOM, this should solve
the issue Dave raised.
Do I miss something? Thanks in advance.

>
> Thanks,
> Fengguang



-- 
Thanks,
     Ying Zhu
--
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