lkml.org 
[lkml]   [2014]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH V3] mm readahead: Fix the readahead fail in case of empty numa node
On 01/08/2014 04:08 PM, Jan Kara wrote:
> On Wed 08-01-14 14:07:03, Raghavendra K T wrote:
>> On 01/06/2014 04:26 PM, Jan Kara wrote:
>>> On Mon 06-01-14 15:51:55, Raghavendra K T wrote:
>> ---
>> test file looked something like this:
>>
>> char buf[4096];
>>
>> int main()
>> {
>> int fd = open("testfile", O_RDONLY);
>> unsigned long read_bytes = 0;
>> int sz;
>> posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
> Hum, but this call should have rather been:
> struct stat st;
>
> fstat(fd, &st);
> posix_fadvise(fd, 0, st.st_size, POSIX_FADV_WILLNEED);
>
> The posix_fadvise() call you had doesn't do anything...
>
> Honza

I reran the test with that change, no change the outcome though.
(I had earlier tested with hardcoded size etc.. but fstat was the
correct thing to do.. thanks). will include the result in V4

>
>> do {
>> sz = read(fd, buf, 4096);
>> read_bytes += sz;
>> } while (sz > 0);
>>
>> close(fd);
>> printf (" Total bytes read = %lu \n", read_bytes);
>> return 0;
>> }



\
 
 \ /
  Last update: 2014-01-08 13:21    [W:0.053 / U:1.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site