Changeset View
Standalone View
sys/vm/vm_domainset.h
| Show All 27 Lines | |||||
| #ifndef __VM_DOMAINSET_H__ | #ifndef __VM_DOMAINSET_H__ | ||||
| #define __VM_DOMAINSET_H__ | #define __VM_DOMAINSET_H__ | ||||
| struct pctrie_iter; | struct pctrie_iter; | ||||
| struct vm_domainset_iter { | struct vm_domainset_iter { | ||||
| struct domainset *di_domain; | struct domainset *di_domain; | ||||
| unsigned int *di_iter; | unsigned int *di_iter; | ||||
| /* Initialized from 'di_domain', initial value after reset. */ | |||||
| domainset_t di_valid_mask; | domainset_t di_valid_mask; | ||||
| /* Domains to browse in the current phase. */ | |||||
| domainset_t di_remain_mask; | |||||
| /* Domains skipped in phase 1 because under 'v_free_min'. */ | |||||
| domainset_t di_min_mask; | |||||
kib: Why do we need this second (third ?) mask at all.
When iterating over domains with not… | |||||
Done Inline ActionsIteration with this API can be stopped and resumed (or not) at will. With your proposal, when you start over, you just don't know which domains have already been determined to be under-provisioned and skipped in the first phase, and you're going to have to parse over them again. I precisely want to get rid of any occurence of that here, although those in your proposal wouldn't be as critical as the existing ones are. The current bitset API does not allow to save the current iteration point, and even if it did, that's more context to save than a simple domain bitmask, given that MAXMEMDOM is always below 64. Also, all struct vm_domainset_iter objects are allocated on the stack, so I don't see how an additional 64-bit field could make any significant difference. olce: Iteration with this API can be stopped and resumed (or not) at will. With your proposal, when… | |||||
Done Inline Actionsdi_valid_mask has been serving to remember that some specific allocation cannot be fulfilled from a domain (see vm_domainset_iter_ignore()), so is different than di_domain->ds_mask. olce: `di_valid_mask` has been serving to remember that some specific allocation cannot be fulfilled… | |||||
| vm_pindex_t di_offset; | vm_pindex_t di_offset; | ||||
| int di_flags; | int di_flags; | ||||
| uint16_t di_policy; | uint16_t di_policy; | ||||
| domainid_t di_n; | |||||
| bool di_minskip; | bool di_minskip; | ||||
| }; | }; | ||||
| int vm_domainset_iter_page(struct vm_domainset_iter *, struct vm_object *, | int vm_domainset_iter_page(struct vm_domainset_iter *, struct vm_object *, | ||||
| int *, struct pctrie_iter *); | int *, struct pctrie_iter *); | ||||
| void vm_domainset_iter_page_init(struct vm_domainset_iter *, | void vm_domainset_iter_page_init(struct vm_domainset_iter *, | ||||
| struct vm_object *, vm_pindex_t, int *, int *, | struct vm_object *, vm_pindex_t, int *, int *, | ||||
| struct pctrie_iter *); | struct pctrie_iter *); | ||||
| Show All 10 Lines | |||||
Why do we need this second (third ?) mask at all.
When iterating over domains with not count_min(), clear their bit, and skip !count_min() domains. Then iterate over all remaining bits in remain_mask.