Messages in this thread | | | Date | Fri, 24 Jul 2020 16:26:29 +0200 | From | Michal Hocko <> | Subject | Re: [Phishing Risk] [External] Re: [PATCH v2] mm/hugetlb: add mempolicy check in the reservation routine |
| |
On Fri 24-07-20 21:56:29, Muchun Song wrote: > On Fri, Jul 24, 2020 at 7:34 PM Michal Hocko <mhocko@kernel.org> wrote: [...] > > I believe you can simplify this and use a similar pattern as the page > > allocator. Something like > > > > for_each_node_mask(node, mpol_allowed) { > > if (node_isset(node, &cpuset_current_mems_allowed)) > > nr += array[node]; > > } > > > > There shouldn't be any need to allocate a potentially large nodemask on > > the stack. > > An unsigned long can satisfy 64 nodes. So I think that nodemask is using > little stack memory. Right?
CONFIG_NODES_SHIFT=10
is not something surprising. E.g. SLES is using that default for a long time because those kernels tend to run on very large machines.
-- Michal Hocko SUSE Labs
| |