lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ba0de31-b9b8-fb10-011e-b24e9dba5ccd@linux.dev>
Date:   Thu, 17 Aug 2023 16:40:46 +0800
From:   Gang Li <gang.li@...ux.dev>
To:     Michal Hocko <mhocko@...e.com>
Cc:     Waiman Long <longman@...hat.com>, cgroups@...r.kernel.org,
        linux-mm@...ck.org, rientjes@...gle.com,
        Zefan Li <lizefan.x@...edance.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] mm: oom: introduce cpuset oom

Apologize for the extremely delayed response. I was previously occupied
with work unrelated to the Linux kernel.

On 2023/4/11 22:36, Michal Hocko wrote:
> I believe it still wouldn't hurt to be more specific here.
> CONSTRAINT_CPUSET is rather obscure. Looking at this just makes my head
> spin.
>          /* Check this allocation failure is caused by cpuset's wall function */
>          for_each_zone_zonelist_nodemask(zone, z, oc->zonelist,
>                          highest_zoneidx, oc->nodemask)
>                  if (!cpuset_zone_allowed(zone, oc->gfp_mask))
>                          cpuset_limited = true;
> > Does this even work properly and why? prepare_alloc_pages sets
> oc->nodemask to current->mems_allowed but the above gives us
> cpuset_limited only if there is at least one zone/node that is not
> oc->nodemask compatible. So it seems like this wouldn't ever get set
> unless oc->nodemask got reset somewhere. This is a maze indeed.Is there

In __alloc_pages:
```
/*
  * Restore the original nodemask if it was potentially replaced with
  * &cpuset_current_mems_allowed to optimize the fast-path attempt.
  */
ac.nodemask = nodemask;
page = __alloc_pages_slowpath(alloc_gfp, order, &ac);

```

__alloc_pages set ac.nodemask back to mempolicy before call
__alloc_pages_slowpath.


> any reason why we cannot rely on __GFP_HARWALL here? Or should we

In prepare_alloc_pages:
```
if (cpusets_enabled()) {
	*alloc_gfp |= __GFP_HARDWALL;
	...
}
```

Since __GFP_HARDWALL is set as long as cpuset is enabled, I think we can
use it to determine if we are under the constraint of CPUSET.

But I have a question: Why we always set __GFP_HARDWALL when cpuset is
enabled, regardless of the value of cpuset.mem_hardwall?


Thanks,
Gang Li

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ