Closed Bug 880435 Opened 11 years ago Closed 11 years ago

readahead is implemented suboptimally on linux

Categories

(Core :: General, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: taras.mozilla, Assigned: bugzilla)

References

Details

Attachments

(1 file)

if (flags & OS_READAHEAD) {
        readahead(PR_FileDesc2NativeHandle(*_retval), 0, 0);
    }

it should using fadvise(FADV_SEQUENTIAL)
OS: Windows 8 → Linux
Hardware: x86_64 → All
Attached patch Patch v1Splinter Review
Simple patch.
Attachment #763694 - Flags: review?(benjamin)
Attachment #763694 - Flags: review?(benjamin) → review?(mh+mozilla)
Comment on attachment 763694 [details] [diff] [review]
Patch v1

Review of attachment 763694 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/io/nsLocalFileUnix.cpp
@@ +401,5 @@
>  
>  #if defined(LINUX) && !defined(ANDROID)
>      if (flags & OS_READAHEAD) {
> +        posix_fadvise(PR_FileDesc2NativeHandle(*_retval), 0, 0,
> +                      POSIX_FADV_SEQUENTIAL);

For files that are read sequentially, that would work, but for libraries, it would make things worse.
Attachment #763694 - Flags: review?(mh+mozilla) → review-
Comment on attachment 763694 [details] [diff] [review]
Patch v1

Review of attachment 763694 [details] [diff] [review]:
-----------------------------------------------------------------

Oh wait, that's not the code shared with library loading.
Attachment #763694 - Flags: review- → review+
https://hg.mozilla.org/mozilla-central/rev/4eb19eba16ea
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Depends on: 975634
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: