Re: [RFC PATCH V3] mm readahead: Fix the readahead fail in case ofempty numa node

From: Raghavendra K T
Date: Wed Jan 08 2014 - 06:52:39 EST


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;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/