fadvice/madvice is not clear regarding moment of calling.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Suppose I want to read some data from a file only once. Since I don't
need the memory, I need to call *advise() function with
POSIX_FADV_DONTNEED.

But when should I call ?

The man posix_fadvice page says:

> Programs can use posix_fadvise() to announce an intention to access file data in a specific pattern in the future, thus allowing the kernel to perform appropriate optimizations.

So, some intention in the future. I remember Intel's prefetch
instruction where I need to call it BEFORE actual data reading.
But on Linux, I have to call advice function corresponding AFTER IO
(after the pages filled). It's not obvious reading man page.

Please add something like "This syscall/function has influence only to
memory pages already in memory (RSS) and does not influence pages not
in memory (yet or already). The Linux kernel does not remember the
advice if it can not be satisfied immediately"  (
https://insights.oetiker.ch/linux/fadvise/ )

-- 
Segmentation fault



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux