From patchwork Fri Jun 24 08:04:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894088 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87978CCA473 for ; Fri, 24 Jun 2022 08:05:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EF1A98E01F3; Fri, 24 Jun 2022 04:04:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DFEB88E01F8; Fri, 24 Jun 2022 04:04:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA58B8E01F3; Fri, 24 Jun 2022 04:04:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8D8458E01F7 for ; Fri, 24 Jun 2022 04:04:58 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 643D380A27 for ; Fri, 24 Jun 2022 08:04:58 +0000 (UTC) X-FDA: 79612393476.27.F00AD9D Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by imf28.hostedemail.com (Postfix) with ESMTP id 07A5DC0026 for ; Fri, 24 Jun 2022 08:04:57 +0000 (UTC) Received: by mail-ed1-f50.google.com with SMTP id c13so2291784eds.10 for ; Fri, 24 Jun 2022 01:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CVQLS1Q8p0L2oqy2feCuipYYw0Dn51iYeixzeYC0qk0=; b=diumkHDMGen9Vt3PpkuAbvqzWKQd+Xdn973nNKdfdCDDC0zTX2C6hvIxsHe2V7Hoc4 IOhBR2vnm8dxvhsKFIBXPaolCk/OFXCBQ1WZCwL71kg8/Qq8WUQziQwUP00AOcwUcOGP rXTcnuW7puIRMcesyziDQyu7bT1G2aJvnhdPeFeaq+EwQpiHIGMo14FD4eE8URrxEDxV 0m2ZDeucEfDeKkG17Nd8V6yPSz995Flq0dRdec0ubvhe6xb2D8xZHUXfzD0udY0tRU0C HcnFjUnQwXhFVgFVmkiIUcsMCluaFxgfHNgP1bHGOZQJ0mTg8yzEf2GVutNriYht8F60 tNsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CVQLS1Q8p0L2oqy2feCuipYYw0Dn51iYeixzeYC0qk0=; b=F5F+AypeVgFzPjxrPN5mIAHro0lNTwpVTS37t7FeDtqiWiVDh1r5ZWu7Jbrqvlc/fQ 3y9sHVu374MlY7XUibZbBNpxCG++CJBH0git2ODqCJQB2Zp/X7jsbtNidL+UzB9AcUBc oMQVfNCLtmpD8R4Yp7HjrMqehkRkJnvJaD6RdXgY9JPNDqe4ravF04XAkl3EnKQ1xay6 bZYpzMqK5cdpw6VIUFVBTXbxqE6YPPw7ja59sx19C02KSjrZWtOQXEwWvn6OpZpPRfRA OCyFvG6JimXK7jyvJMxQ1k9Vo+u0OLFDZPHGSU7Pea3o2LDtnCZ5dJGT3HWnxIocdeAg OjuQ== X-Gm-Message-State: AJIora+LHZV65nw7FyvzeWhnbeCkh5DmB7grg4u8hpJT55NlrUFFZPft EydsGBkjGWGxOhGZtgo8xc8Jg3s1+Ro= X-Google-Smtp-Source: AGRyM1usD8rMmmeAdvKoxrU4g0pKdJN3rPJZdiIs4qY40gFmdzYVGQwJIExPFW+J17A2KjUq7SPWiA== X-Received: by 2002:a05:6402:4408:b0:435:9ed2:9be with SMTP id y8-20020a056402440800b004359ed209bemr15656191eda.81.1656057897642; Fri, 24 Jun 2022 01:04:57 -0700 (PDT) Received: from able.fritz.box (p57b0bd9f.dip0.t-ipconnect.de. [87.176.189.159]) by smtp.gmail.com with ESMTPSA id c19-20020a170906155300b006fea43db5c1sm697779ejd.21.2022.06.24.01.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:57 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dri-devel@lists.freedesktop.org Cc: mhocko@suse.com, Andrey Grodzovsky Subject: [PATCH 08/14] drm/amdgpu: use drm_file_rss Date: Fri, 24 Jun 2022 10:04:38 +0200 Message-Id: <20220624080444.7619-9-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220624080444.7619-1-christian.koenig@amd.com> References: <20220624080444.7619-1-christian.koenig@amd.com> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057898; a=rsa-sha256; cv=none; b=g9CM9AjzdquJr1W8xy3Bb2uK7ojQcUcOYN5JaIHgj5ehARlqjtQpGMka2GFQbsOnrMHoby R7OSSYLO1FvQA99Ctd9Pt0tvT10cqMebqLNyFT9a2wFqxvwkmroYwPq3YR3SLTlr6Jhip4 6BMTRvxaJgqtesE2w5S68GcD9SkuUTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057898; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CVQLS1Q8p0L2oqy2feCuipYYw0Dn51iYeixzeYC0qk0=; b=zYFUirZwpmnksTmRewP6PjvIWsR2kb2NdeWxLOuRgPEDJ2rXPl9Qdd1Hd5ss6ofZwmpVIb 87c4cM3vKP8nJgsgMWkQZ4LVdbj+jFyq9wVtE71OW7jEDiLqA6LOFSHQR7uxZ8a1DQrPJp PgYjyz0jFSpeQvrad/hMJ1sFnkZtzwM= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=diumkHDM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Stat-Signature: dmwzyaxp63zbxx5ksf78e59bri9tzwgr X-Rspamd-Queue-Id: 07A5DC0026 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=diumkHDM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1656057897-457219 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Andrey Grodzovsky This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 8890300766a5..4508791fe80c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2635,8 +2635,9 @@ static const struct file_operations amdgpu_driver_kms_fops = { .compat_ioctl = amdgpu_kms_compat_ioctl, #endif #ifdef CONFIG_PROC_FS - .show_fdinfo = amdgpu_show_fdinfo + .show_fdinfo = amdgpu_show_fdinfo, #endif + .file_rss = drm_file_rss, }; int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv)