By: Jeff S. (fake.delete@this.fake.com), June 6, 2019 9: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.
> 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.
Topic | Posted By | Date |
---|---|---|
Pre-populating anonymous pages | Travis Downs | 2019/06/05 04:48 PM |
Pre-populating anonymous pages | Jeff S. | 2019/06/05 08:03 PM |
Pre-populating anonymous pages | Travis Downs | 2019/06/06 07:11 AM |
Pre-populating anonymous pages | Jeff S. | 2019/06/06 08:40 AM |
Pre-populating anonymous pages | Travis Downs | 2019/06/06 08:59 AM |
Pre-populating anonymous pages | Jeff S. | 2019/06/06 09:19 AM |
Pre-populating anonymous pages | Foo_ | 2019/06/06 12:30 AM |
Pre-populating anonymous pages | Travis Downs | 2019/06/06 06:59 AM |
Pre-populating anonymous pages | Foo_ | 2019/06/06 07:56 AM |
Pre-populating anonymous pages | Travis Downs | 2019/06/06 09:02 AM |
Pre-populating anonymous pages | Linus Torvalds | 2019/06/06 11:01 AM |
Pre-populating anonymous pages | Travis Downs | 2019/06/07 02:16 PM |
Pre-populating anonymous pages | Brendan | 2019/06/08 02:55 AM |
Pre-populating anonymous pages | Travis Downs | 2019/06/08 08:18 AM |
Pre-populating anonymous pages | Linus Torvalds | 2019/06/08 11:43 AM |
Pre-populating anonymous pages | Brendan | 2019/06/09 03:29 AM |
Pre-populating anonymous pages | Linus Torvalds | 2019/06/10 11:20 AM |
Pre-populating anonymous pages | Travis Downs | 2019/06/17 09:18 AM |
Pre-populating anonymous pages | Linus Torvalds | 2019/06/18 04:28 PM |