[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <qd3ioegpvmrrrwdy2qntxznyrnwq3bhe74lmuxio7sy4sjggtt@tm6nqds3pyvj>
Date: Tue, 26 Aug 2025 16:20:58 +0200
From: Michal Koutný <mkoutny@...e.com>
To: Maarten Lankhorst <dev@...khorst.se>
Cc: Lucas De Marchi <lucas.demarchi@...el.com>,
'Thomas Hellström' <thomas.hellstrom@...ux.intel.com>, Rodrigo Vivi <rodrigo.vivi@...el.com>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Maxime Ripard <mripard@...nel.org>, Natalie Vock <natalie.vock@....de>, Tejun Heo <tj@...nel.org>,
Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>, Shakeel Butt <shakeel.butt@...ux.dev>,
Muchun Song <muchun.song@...ux.dev>, Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"'Liam R . Howlett'" <Liam.Howlett@...cle.com>, Vlastimil Babka <vbabka@...e.cz>,
Mike Rapoport <rppt@...nel.org>, Suren Baghdasaryan <surenb@...gle.com>,
Thomas Zimmermann <tzimmermann@...e.de>, Michal Hocko <mhocko@...e.com>, intel-xe@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [RFC 0/3] cgroups: Add support for pinned device memory
Hello Maarten.
On Tue, Aug 19, 2025 at 01:49:33PM +0200, Maarten Lankhorst <dev@...khorst.se> wrote:
> Implementation details:
>
> For each cgroup up until the root cgroup, the 'min' limit is checked
> against currently effectively pinned value. If the value will go above
> 'min', the pinning attempt is rejected.
How is pinning different from setting a 'min' limit (from a user
perspective)?
>
> Pinned memory is handled slightly different and affects calculating
> effective min/low values. Pinned memory is subtracted from both,
> and needs to be added afterwards when calculating.
>
> This is because increasing the amount of pinned memory, the amount of
> free min/low memory decreases for all cgroups that are part of the
> hierarchy.
What is supposed to happen with pinned memory after cgroup removal?
I find the page_counter changes little bit complex without understanding
of the difference between min and pinned. Should this be conceptually
similar to memory.stat:unevictable? Or rather mlock(2)? So far neither
of those needed interaction with min/low values (in memcg).
Thanks,
Michal
Download attachment "signature.asc" of type "application/pgp-signature" (266 bytes)
Powered by blists - more mailing lists