Pre-populating anonymous pages

By: Travis Downs (travis.downs.delete@this.gmail.com), June 6, 2019 5:59 am
Room: Moderated Discussions
Foo_ (foo.delete@this.nomail.com) on June 6, 2019 12:30 am wrote:
> Travis Downs (travis.downs.delete@this.gmail.com) on June 5, 2019 4:48 pm wrote:
> > Maybe it's a bit OT for this forum, but hey I figure it can't be worse than Ireland spam, right?
> >
> > On Linux, given a mapped-but-probably-not-populated anonymous region
> > of memory, is there any way to ask the kernel to populate it?
>
> How about madvise(..., MADV_WILLNEED)? Am I misunderstanding your intent?

I had already tried it, but it seems to do nothing for anonymous pages. If you read between the lines of the man page, this advice (and related ones like MADV_SEQUENTIAL) seem to be targeted to file-backed pages, and are there to tune the readahead behavior for such pages. For anonymous pages there is no readahead, so I guess that's why it does nothing.

I agree it would be nice if this mapped the pages though.
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Pre-populating anonymous pagesTravis Downs2019/06/05 03:48 PM
  Pre-populating anonymous pagesJeff S.2019/06/05 07:03 PM
    Pre-populating anonymous pagesTravis Downs2019/06/06 06:11 AM
      Pre-populating anonymous pagesJeff S.2019/06/06 07:40 AM
        Pre-populating anonymous pagesTravis Downs2019/06/06 07:59 AM
          Pre-populating anonymous pagesJeff S.2019/06/06 08:19 AM
  Pre-populating anonymous pagesFoo_2019/06/05 11:30 PM
    Pre-populating anonymous pagesTravis Downs2019/06/06 05:59 AM
      Pre-populating anonymous pagesFoo_2019/06/06 06:56 AM
        Pre-populating anonymous pagesTravis Downs2019/06/06 08:02 AM
  Pre-populating anonymous pagesLinus Torvalds2019/06/06 10:01 AM
    Pre-populating anonymous pagesTravis Downs2019/06/07 01:16 PM
      Pre-populating anonymous pagesBrendan2019/06/08 01:55 AM
        Pre-populating anonymous pagesTravis Downs2019/06/08 07:18 AM
        Pre-populating anonymous pagesLinus Torvalds2019/06/08 10:43 AM
          Pre-populating anonymous pagesBrendan2019/06/09 02:29 AM
            Pre-populating anonymous pagesLinus Torvalds2019/06/10 10:20 AM
          Pre-populating anonymous pagesTravis Downs2019/06/17 08:18 AM
            Pre-populating anonymous pagesLinus Torvalds2019/06/18 03:28 PM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell tangerine? ūüćä