History

mm: constify oom_control, scan_control, and alloc_context nodemask

The nodemasks in these structures may come from a variety of sources, including tasks and cpusets - and should never be modified by any code when being passed around inside another context.

Gregory Price committed 5 months ago

Commit baff6d21 parent 567c26a11 files · +26 −22Browse files

Showing the changes to kernel (1 of 11 files). Show all

Unified · Split

kernel/cgroup/cpuset.c+1−1
@@ -4162,7 +4162,7 @@ nodemask_t cpuset_mems_allowed(struct task_struct *tsk) · 4161 unmodified lines
4162 *4162 *
4163 * Are any of the nodes in the nodemask allowed in current->mems_allowed?4163 * Are any of the nodes in the nodemask allowed in current->mems_allowed?
4164 */4164 */
4165int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask)4165int cpuset_nodemask_valid_mems_allowed(const nodemask_t *nodemask)
4166{4166{
4167 return nodes_intersects(*nodemask, current->mems_allowed);4167 return nodes_intersects(*nodemask, current->mems_allowed);
4168}4168}