Sure, but I meant more in the sense of asking about the current status of the page.
It’s the mincore which debugnik mentioned. And there’s madvise(MADV_WILLNEED) which triggers an asynchronous prefetch.
I was biten by not understanding madvise(MADV_WILLNEED) semantics fully. It will prefetch, but it will not pre-fault. You still gonna pay minor page fault on every new page access. There is MADV_POPULATE_READ, but it is synchronous.
You can ask about the status (mincore), but it's an inherently racy operation.
I think we are not realizing the paradigm shift here. A coding agent can implement this with a modest little day’s worth of tokens. This means that no one needs to read or know the APIs any more. We can just add them to the kernel as we need them. Then when we forget that we needed them we can just rediscover the API idea later and spend a day’s worth of tokens. (But let’s be real here. By then it will probably be just 1/3 worth of tokens with all the model improvements as well as the ample training material.)
We don't even need a kernel anymore. An agent can write the relevant parts of the OS on the fly, as we need them.