From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [RESEND PATCH v2] drm/gem: Mark pinned pages as unevictable Date: Thu, 17 Jan 2019 15:25:53 -0800 Message-ID: <87fttqsw72.fsf@anholt.net> References: <20190108074517.209860-1-vovoy@chromium.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0200615522==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id D90336F5BA for ; Thu, 17 Jan 2019 23:25:55 +0000 (UTC) In-Reply-To: <20190108074517.209860-1-vovoy@chromium.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org Cc: Kuo-Hsin Yang List-Id: dri-devel@lists.freedesktop.org --===============0200615522== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Kuo-Hsin Yang writes: > The gem drivers use shmemfs to allocate backing storage for gem objects. > On Samsung Chromebook Plus, the drm/rockchip driver may call > rockchip_gem_get_pages -> drm_gem_get_pages -> shmem_read_mapping_page > to pin a lot of pages, breaking the page reclaim mechanism and causing > oom-killer invocation. > > E.g. when the size of a zone is 3.9 GiB, the inactive_ratio is 5. If > active_anon / inactive_anon < 5 and all pages in the inactive_anon lru > are pinned, page reclaim would keep scanning inactive_anon lru without > reclaiming memory. It breaks page reclaim when the rockchip driver only > pins about 1/6 of the anon lru pages. > > Mark these pinned pages as unevictable to avoid the premature oom-killer > invocation. See also similar patch on i915 driver [1]. > > [1]: https://patchwork.freedesktop.org/patch/msgid/20181106132324.17390-1-chris@chris-wilson.co.uk > > Signed-off-by: Kuo-Hsin Yang > Cc: Daniel Vetter > Cc: Chris Wilson > Reviewed-by: Chris Wilson This patch helped me valgrind a CTS case with ~130MB of BOs on a system with ~600MB of RAM available to Linux without getting oomkilled. Thanks! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlxBDwEACgkQtdYpNtH8 nujwgg//cyecdxD0nhjSHpqLPbom2kGcW3LlQJCmKC6OtTP8plMadhs1S+wxTEz8 61jipDQDxcs/oPNY2n+HF9zhCWYY6sdlH27agVTeS7gRX2SS50iIdKbw4hTsp+AR Dk1BBuaN2ckuS6PQHGNdQ0GhXKXnWpPWBYFXaU9to5358XmR1gnyoKh6Y/rrowG0 n5GSYjtXU0fmoZ3CRhUIHhjfyzaze2iit/3B797qBQIpsFfMeCfPQ08TAcdjKqQo 9mjZlMzpDLSRICg03VM8rS2ysIpcm4lDtQqDvqHXHwYd/IDWcpRjEl3cUie7xeT6 QZ8L1YwIpgb5XxwKIyshPUzKwJUxNLKbNpCJmkhHi23qznsUFjACyltSBgL5XkBU qbGwSK05xfqr/lNjkmOXmXgM7qV1GuTgFftLq17++M2zFptaURS+Wle0JNpHYsG2 F+bKTGeb3kQocQlq+gSLeSCf0pAfG3gdBd4OU/kPbJPP6kmGrLKJCAQ+AEiA5Cyw xqsg3Hia0rYct0Z2OqwfKLd/2nen1U71PCiWYL0XJtaVIYO9y45cA2oxoIafVmZx PnxfA/GHu758pyVeB4wdcH4+M5yGaSycrdaVJ5OFIgmX7wN92OlH6Jgmsag9GsLi hUy4VvDXafPp9uP2vS41QhXHk04EFkbKoWSFisAZR/vzMuZKe4k= =Am6T -----END PGP SIGNATURE----- --=-=-=-- --===============0200615522== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0200615522==--