Pre-populating anonymous pages

By: Jeff S. (fake.delete@this.fake.com), June 6, 2019 8:19 am
Room: Moderated Discussions
Travis Downs (travis.downs.delete@this.gmail.com) on June 6, 2019 8:59 am wrote:

> Thanks for looking into brk(), but not even my primary concern. My primary concern is that
> the original allocator mapped the area with some flags (just check out the number of MAP_
> flags to mmap) that I am not aware of, and mmam(MAP_FIXED) will replace those flags and I
> don't know what the impact of that is. Now going through the flags, it doesn't seem like there
> are too many that are likely to be set and cause a problem if overwritten, but...

I have high confidence that any mmap() flag for an anonymous page that matters will be replicatable from the proc map, but if you intend to take this much beyond a thought experiment, remember that some madvise() flags are more than performance hints, and I don't if they can be extracted before clobbering them.

> Yeah maybe. The existing behavior doesn't strike me as that odd though - it seems like
> all that stuff was totally oriented towards file-backed pages. I don't think it does
> a synchronous read either, it just kicks off the async readahead or something?

The exact meaning of MADV_WILLNEED has changed multiple times over the years, but I think the most recent behavior is doing an initial capacity check for total prefault size, then kicking off the readahead if it can get the reservation.
< 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? ūüćä