Re: first gap in the map
enami tsugutomo <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.performance |
|---|---|
| Message-ID | <[email protected]> |
> > > > I mean > > > > there is the code to handle the first gap specially only for > > non-topdown case but > > where? in the patch i posted? > it isn't my intention. maybe a bug. With current implemention, the only real entries are managed in rbtree, and thus the gap after those entries can be searched by rbtree walk, right? So, the gap between map start and the first entry needs to be check specially. The code after /* Check slot before any entry */ is the special check (it is necceary for kernel or its sub map). But for topdown case, the entry there isn't the first entry usually. And since it should be the last resort in topdown case, the test should be done after tree walk failed to find space. But currently `tree walk failed' doesn't mean there was really no space in the tree (since the walk doesn't test all candidates). So, fixing this would be a bit hard (possibilly, we want to put the first gap in the tree also). > no. thanks for pointing. Also, uvm_rb_space() doesn't need to handle the entry->next == &map->header case specially. return (entry->next->strart - entry->end); is enough. enami.