On Mon 07-11-22 16:05:37, Feng Tang wrote: > On Mon, Oct 31, 2022 at 03:32:34PM +0100, Michal Hocko wrote: > > > > OK, then let's stop any complicated solution right here then. Let's > > > > start simple with a per-mm flag to disable demotion of an address space. > > > > Should there ever be a real demand for a more fine grained solution > > > > let's go further but I do not think we want a half baked solution > > > > without real usecases. > > > > > > Yes, the concern about the high cost for mempolicy from you and Yang is > > > valid. > > > > > > How about the cpuset part? > > > > Cpusets fall into the same bucket as per task mempolicies wrt costs. Geting a > > cpuset requires knowing all tasks associated with a page. Or am I just > > missing any magic? And no memcg->cpuset association is not a proper > > solution at all. > > No, you are not missing anything. It's really difficult to find a > solution for all holes. And the patch is actually a best-efforts > approach, trying to cover cgroup v2 + memory controller enabled case, > which we think is a common user case for newer platforms with tiering > memory. Best effort is OK but it shouldn't create an unexpected behavior and this approach does that. I thought I have already explained that. But let me be more explicit this time. Please have a look at how controllers can be enabled/disabled at different levels of the hierarchy. Unless memcg grows a hard dependency on another controller (as it does with the blk io controller) then this approach can point to a wrong cpuset. See my point? Really, solution for this is not going to be cheap and also I am not sure all the hessles is really worth it until there is a clear usecase in sight. -- Michal Hocko SUSE Labs