From patchwork Fri Jun 24 08:04:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894081 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 7BD6FCCA47F for ; Fri, 24 Jun 2022 08:04:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 131988E01F0; Fri, 24 Jun 2022 04:04:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B9FA8E01E7; Fri, 24 Jun 2022 04:04:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFFF08E01F0; Fri, 24 Jun 2022 04:04:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CF26F8E01E7 for ; Fri, 24 Jun 2022 04:04:50 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 944A3804DD for ; Fri, 24 Jun 2022 08:04:50 +0000 (UTC) X-FDA: 79612393140.21.B468A9F Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by imf28.hostedemail.com (Postfix) with ESMTP id 3FA8BC002A for ; Fri, 24 Jun 2022 08:04:50 +0000 (UTC) Received: by mail-ed1-f50.google.com with SMTP id c13so2291784eds.10 for ; Fri, 24 Jun 2022 01:04:50 -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=ltQpZ7oW1QsVH1f1jCapXhBdDu/pMzI69BR3W0aWJiY=; b=BCLBGzCDM3dicFZ1OGIFkOsdf2V521mMysBEJ9iinveVKjuPTsLrqFdJi734Z1uZvp BrIl/Z9vn8vFkyDOHWmnKxo21xK+tLMDYTST34w4v8TV5nWFn9JLHMcOYZM1aHPYbEeD 282A6fO+GqmoGy5VHzTzkXXC9jDOLaPtweOGDMSO0oqWtHIb7gpQJUaCuMu88rOwe2BD crWt+l2Vv9WpcgtJbnfxcqiFAzAJtXlpuRnoAfr2x/1dRrw8Nn1n/TUXtsDtfcmdgOF3 YGwme/GeeP+MA8N7frvR6cGiLzhNFciaj5ku28X9lFYuS1JLv1ymQIO3PkoxpTVbMdZb ASwA== 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=ltQpZ7oW1QsVH1f1jCapXhBdDu/pMzI69BR3W0aWJiY=; b=CZnRY/7kjkA3gWhQnLudr5EV3UnYfU9exNk1sav0zQPMnnVgOFq8XfluIt0Zwe7pDH qAq6/zSmY/JgkxR9ukSBVyOjeFCFixmMPBn/Rhd/9CuTrX1bsdFBiy70VKislsQrajxv vp98uxplQyss32QaTGQ+SACSEpWcAEaiDcAGN2DUsujuSfOGck7B2x29AgD78JLMDnS5 Nfra+46HUet4aT5Y6CPhSdK/r7KRWJd9Wox4QfxdDTL+3n1P/3clHLLSBU9/PGzFPjzz IFlU1N6/bXC0HgHERDDRrcnC4ztF4VBSQNlm/AjtgmBBsqLpd8ZojO29RpCggu0Bbdww gYXw== X-Gm-Message-State: AJIora+w4mJypp2hGK4KjTSL2pjmSaqHyKTF5CurTy5y6imOFyWhtzZ/ QWJDc90WakwMmGHyxtMpH6M= X-Google-Smtp-Source: AGRyM1vqTm2oWNscqLmlMW8s9dcXBhWIE7N6JaZpirobITGNlD2rMAul00q8pM0x95n+ay4p5Kh9SQ== X-Received: by 2002:a05:6402:358c:b0:435:9daf:e825 with SMTP id y12-20020a056402358c00b004359dafe825mr16018406edc.375.1656057889076; Fri, 24 Jun 2022 01:04:49 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:48 -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 , =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 01/14] fs: add per file RSS Date: Fri, 24 Jun 2022 10:04:31 +0200 Message-Id: <20220624080444.7619-2-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=1656057890; a=rsa-sha256; cv=none; b=ZR51RnCy0wXYXV2RQUqOkrieJsEuSty9sxxF1jBT9Cn40LE2rmOcl48wsn8X3i6rz0tsWG BbTs6XVjD0bRJm6p7OUSBVPVXXo8fjuFkNLSWFoEcd2e8dC3O2W0eBCWwDUqczwiLGX/sk kTtgVgtPJXKt5mm9h2EQkARLQvjJjV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057890; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ltQpZ7oW1QsVH1f1jCapXhBdDu/pMzI69BR3W0aWJiY=; b=eOBepxkGPEdBRFa5nzKoz1lSwz1ckTgS+KRO8QjAOgsozRYkrvTIKIEKYKzeuSCharsUVQ tLDTgfepWKV+25JneNEh6KNuONQwSTX1MalamoJOxSy8iqK6HJFhJSrEelnC8PTzzgvobT PizzL1vAQ17C0D6b5zvvE6BnC8p1M8k= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=BCLBGzCD; 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: 3z1mzifmfk9uucm63mx96xywyt6wzi54 X-Rspamd-Queue-Id: 3FA8BC002A Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=BCLBGzCD; 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: 1656057890-816897 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 Some files allocate large amounts of memory on behalf of userspace without any on disk backing store. This memory isn't necessarily mapped into the address space, but should still accounts towards the RSS of a process just like mapped shared pages do. That information can then be used by the OOM killer to make better decisions which process to reap. For easy debugging this also adds printing of the per file RSS to fdinfo. Signed-off-by: Andrey Grodzovsky Signed-off-by: Christian König --- fs/file.c | 23 +++++++++++++++++++++++ fs/proc/fd.c | 3 +++ include/linux/fdtable.h | 1 + include/linux/fs.h | 1 + 4 files changed, 28 insertions(+) diff --git a/fs/file.c b/fs/file.c index 3bcc1ecc314a..b58730a513be 100644 --- a/fs/file.c +++ b/fs/file.c @@ -1307,3 +1307,26 @@ int iterate_fd(struct files_struct *files, unsigned n, return res; } EXPORT_SYMBOL(iterate_fd); + +static int sumup_file_rss(const void *sum, struct file *file, unsigned n) +{ + if (!file->f_op->file_rss) + return 0; + + *((unsigned long *)sum) += file->f_op->file_rss(file); + return 0; +} + +/** + * files_rss- how much resources are bound by opened files + * @files: opened files + * + * Returns sum of all resources bound by files not accounted in file systems. + */ +unsigned long files_rss(struct files_struct *files) +{ + unsigned long sum = 0; + + iterate_fd(files, 0, sumup_file_rss, &sum); + return sum; +} diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 913bef0d2a36..9943bfca74f7 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c @@ -59,6 +59,9 @@ static int seq_show(struct seq_file *m, void *v) real_mount(file->f_path.mnt)->mnt_id, file_inode(file)->i_ino); + if (file->f_op->file_rss) + seq_printf(m, "rss:\t%lu\n", file->f_op->file_rss(file)); + /* show_fd_locks() never deferences files so a stale value is safe */ show_fd_locks(m, file, files); if (seq_has_overflowed(m)) diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index e066816f3519..101770266f38 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h @@ -122,6 +122,7 @@ void do_close_on_exec(struct files_struct *); int iterate_fd(struct files_struct *, unsigned, int (*)(const void *, struct file *, unsigned), const void *); +unsigned long files_rss(struct files_struct *files); extern int close_fd(unsigned int fd); extern int __close_range(unsigned int fd, unsigned int max_fd, unsigned int flags); diff --git a/include/linux/fs.h b/include/linux/fs.h index 9ad5e3520fae..edacbdce5e4c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2003,6 +2003,7 @@ struct file_operations { loff_t len, unsigned int remap_flags); int (*fadvise)(struct file *, loff_t, loff_t, int); int (*uring_cmd)(struct io_uring_cmd *ioucmd, unsigned int issue_flags); + long (*file_rss)(struct file *); } __randomize_layout; struct inode_operations { From patchwork Fri Jun 24 08:04:32 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: 12894082 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 00196CCA483 for ; Fri, 24 Jun 2022 08:04:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5A7478E01F1; Fri, 24 Jun 2022 04:04:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 527ED8E01E7; Fri, 24 Jun 2022 04:04:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C8388E01F1; Fri, 24 Jun 2022 04:04:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 228768E01E7 for ; Fri, 24 Jun 2022 04:04:52 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 031E533C08 for ; Fri, 24 Jun 2022 08:04:51 +0000 (UTC) X-FDA: 79612393224.09.4D65F45 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by imf04.hostedemail.com (Postfix) with ESMTP id 6B83340024 for ; Fri, 24 Jun 2022 08:04:51 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id e2so2335676edv.3 for ; Fri, 24 Jun 2022 01:04:51 -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=6j0Gpi54M48fI1NcNiQ2zQbh0cpYb0wFPGGgMk6DiNo=; b=fk1Q8DhcfpcNKxoNpWHiQSY9AE96A9aVxjRhZQQUWDZRdv7jEZGX6hMqBKr6rqq5fy 9t7SzX2Vl712znvGA8+d7SsV/SLjOuEz8EJqw7KMYQFjdKxhRvkPZZZiwuZ1Mbl3yEfV 0czXl+5DWtas1YhPkEGvL798aRjcHESclYc/C/XKzSoId3CQoIeGfVhaQ9gE8V4nAnvz yPNyik6e47/+4vPDqcfn3WUpjSuAR16t34HQILns5txBmvATmE4OpVbQiTQ3jTbxv/Ju QRq5NGdaccxi64UFpJMIIRqRVNhqRxqlSvbkbbvI6sIihwWIzkjAbvWZWMqIO6dN8QxY AsDg== 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=6j0Gpi54M48fI1NcNiQ2zQbh0cpYb0wFPGGgMk6DiNo=; b=Tc8lC3g8eopJzhC+pOk2VShDxcCTsCaALfivOV6EaEM/UqGdtXFXDosiU9hJfhoz4L 823EU8MjZzv9/dRGWT0dEkaulxkWtxT3ZNVjELQ8pg+vA/iW30lTMVVy1csrdDTBIzCU 4eKQcQFXd+O/69aISwL3yaQs03Mj6ZONbVHiyofgg/KtItQva0gt08Xcx5kgybmO4VYz n90UNaZjhuxQb0oxZ8zOmPknwlKyFeTI9gqpNMoRjgCDFBPPuB2vsC2mWIT7S14fR5RI PSmFnctSQgHsU/ykdJtQlHAaVXh/Cjjst+JE23UZlYMGgdvsD0iy0Zr4ks0SLIPAl/4j mNbw== X-Gm-Message-State: AJIora/ZiwV8ETx8Bb661zQbuPR8QCKC8DdcmooZB4dM8OzLdRLgtNsC Mcs5svbHkn2WitLHX1IVcEA= X-Google-Smtp-Source: AGRyM1srTDsD3lF1Nj8u/D/xjMuJOrSeuMWkaVaQOvHyyq+uUmVQu5uN8XQJNPLwVdaC1R98cp8x3A== X-Received: by 2002:a05:6402:350f:b0:42f:68f9:ae5 with SMTP id b15-20020a056402350f00b0042f68f90ae5mr16118492edd.36.1656057890308; Fri, 24 Jun 2022 01:04:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:49 -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 02/14] oom: take per file RSS into account Date: Fri, 24 Jun 2022 10:04:32 +0200 Message-Id: <20220624080444.7619-3-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-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fk1Q8Dhc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057891; 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=6j0Gpi54M48fI1NcNiQ2zQbh0cpYb0wFPGGgMk6DiNo=; b=ISA0bWVVHlms9i5S9Flz2p8AoaC9PnMCS+MKqnSwO64ZaZvuaGYl1pgxpubd0alLX3uTfM z2yOLC6fOYIyBjMRSI/Z3UKlFYh62OoAb3c8sBkt8pkjDr9YDM/eYh7DIBR7lR+Lqk69Kj et1F92UOPQEH6sZ7dUFhMxBcqc5E60A= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057891; a=rsa-sha256; cv=none; b=XXOHlNOou6FAAgDtD3ACi4GTSvOWSKoQbMjifW14B/15+gsLxbA7nw94WGaH43CnXd2SN5 UT4VOqIk+/ntQQGueyqe4YQRcPMHjMXNj2iDXcwrT6UVIcPaz+cEfXdq/LCPs6n6hdEGQh CrpsowynAajqiKgVaEDOj8p4KEUOH6o= X-Stat-Signature: fh36ndm45k1756ddpambxyr5xjgbezia X-Rspamd-Queue-Id: 6B83340024 X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fk1Q8Dhc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspamd-Server: rspam12 X-HE-Tag: 1656057891-540795 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 Try to make better decisions which process to kill based on per file RSS. Signed-off-by: Andrey Grodzovsky --- mm/oom_kill.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 3c6cf9e3cd66..76a5ea73eb6a 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -18,6 +18,7 @@ * kernel subsystems and hints as to where to find out what things do. */ +#include #include #include #include @@ -228,7 +229,8 @@ long oom_badness(struct task_struct *p, unsigned long totalpages) * task's rss, pagetable and swap space use. */ points = get_mm_rss(p->mm) + get_mm_counter(p->mm, MM_SWAPENTS) + - mm_pgtables_bytes(p->mm) / PAGE_SIZE; + files_rss(p->files) + mm_pgtables_bytes(p->mm) / PAGE_SIZE; + task_unlock(p); /* Normalize to oom_score_adj units */ @@ -401,8 +403,8 @@ static int dump_task(struct task_struct *p, void *arg) pr_info("[%7d] %5d %5d %8lu %8lu %8ld %8lu %5hd %s\n", task->pid, from_kuid(&init_user_ns, task_uid(task)), - task->tgid, task->mm->total_vm, get_mm_rss(task->mm), - mm_pgtables_bytes(task->mm), + task->tgid, task->mm->total_vm, get_mm_rss(task->mm) + + files_rss(task->files), mm_pgtables_bytes(task->mm), get_mm_counter(task->mm, MM_SWAPENTS), task->signal->oom_score_adj, task->comm); task_unlock(task); @@ -594,7 +596,8 @@ static bool oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm) pr_info("oom_reaper: reaped process %d (%s), now anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n", task_pid_nr(tsk), tsk->comm, K(get_mm_counter(mm, MM_ANONPAGES)), - K(get_mm_counter(mm, MM_FILEPAGES)), + K(get_mm_counter(mm, MM_FILEPAGES) + + files_rss(tsk->files)), K(get_mm_counter(mm, MM_SHMEMPAGES))); out_finish: trace_finish_task_reaping(tsk->pid); @@ -950,7 +953,7 @@ static void __oom_kill_process(struct task_struct *victim, const char *message) pr_err("%s: Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB, UID:%u pgtables:%lukB oom_score_adj:%hd\n", message, task_pid_nr(victim), victim->comm, K(mm->total_vm), K(get_mm_counter(mm, MM_ANONPAGES)), - K(get_mm_counter(mm, MM_FILEPAGES)), + K(get_mm_counter(mm, MM_FILEPAGES) + files_rss(victim->files)), K(get_mm_counter(mm, MM_SHMEMPAGES)), from_kuid(&init_user_ns, task_uid(victim)), mm_pgtables_bytes(mm) >> 10, victim->signal->oom_score_adj); From patchwork Fri Jun 24 08:04:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894083 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 A0488CCA485 for ; Fri, 24 Jun 2022 08:04:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 99D6B8E01F2; Fri, 24 Jun 2022 04:04:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A9C78E01E7; Fri, 24 Jun 2022 04:04:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FCB78E01F2; Fri, 24 Jun 2022 04:04:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4FEAB8E01E7 for ; Fri, 24 Jun 2022 04:04:53 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2780C33D90 for ; Fri, 24 Jun 2022 08:04:53 +0000 (UTC) X-FDA: 79612393266.27.B9A8AF5 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by imf08.hostedemail.com (Postfix) with ESMTP id AFD1116000E for ; Fri, 24 Jun 2022 08:04:52 +0000 (UTC) Received: by mail-ed1-f51.google.com with SMTP id eq6so2313649edb.6 for ; Fri, 24 Jun 2022 01:04:52 -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=L5yGqzzqrexdqI+R/PrE1Mdxo3qJEBrMBxvOId5dYac=; b=ZFpcJ7bvOxDeoKsD9BSu/DxMgNBu0hFRZLpPD7H8Fycd+7tSFvQFmizj3ywr0jzQq1 RkmWSN6e5/pg9bL1XB9hzGeR8093OZYGPUC1VX+qdANm04kbOdINANUaSr8NgFtMu/Hg S45PN9KwSxrjbZrDs/0J9vao+7RX5SaEiDjzAEM/leu8JhfBoxI41HP181Zf6KMSE/Fm okg8/IZK989tO7X6nINgpZg+gCf89iLArC3DLvGvtKCEh5a3lg9AQAQTzCwnNJJjsuVY Qbpff4o19u7sF6PEYo7AgFemk0vj1/sz2hNghcnALHaM/9bNwI7G4YVqTXOgFT/zKotW 1lGw== 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=L5yGqzzqrexdqI+R/PrE1Mdxo3qJEBrMBxvOId5dYac=; b=gIDdHWUaeTT2iTUFiyCR/C0twQ8d1i0Ciut3OQ5bPUOjGlnKiKj7chv603J1nEDHbd WlWXxiKeVOjdBIeRWkFZtPZM6fMIU8jHYZkRTJKWfZmhLKrUGWm1IiVvTeWYO8G/ZTiC lLYV2sBlQWZaCiUDym6MLHUBwmjxUon5ZTsDi7XjxU4Gq09cxRzCoMeARAX3GS6wPYI7 7XYfXsQBL23+5CrXWdK0nZkzJghxB1DQyIF8US+dZRJPEB6IT/9o6iHN8mJpLkQ38v3/ uRKTXHSE2n1TPSs8Hrl69TeYRI2L9VMVo3w/GpcEb5ybrOT9ynyhCQwqz3y18opFkhj1 90bg== X-Gm-Message-State: AJIora9f0DfoW71IocCQmsn+um88OyM/Y5lkntuIEaQ43THomieumpyD 06aooi1f9uaYg0dyqBrq0WA= X-Google-Smtp-Source: AGRyM1v9WvX+EG4ooIeBZBCJi3ju+tuSkjouIG1NrE30YmCwfmias9TA1ULdOZTofk7OgF27mN/vJA== X-Received: by 2002:a50:ef0d:0:b0:435:6829:e980 with SMTP id m13-20020a50ef0d000000b004356829e980mr15867707eds.192.1656057891610; Fri, 24 Jun 2022 01:04:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:51 -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, =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 03/14] proc: expose per file RSS Date: Fri, 24 Jun 2022 10:04:33 +0200 Message-Id: <20220624080444.7619-4-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-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZFpcJ7bv; spf=pass (imf08.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057892; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L5yGqzzqrexdqI+R/PrE1Mdxo3qJEBrMBxvOId5dYac=; b=MLMP0B0EE8GHQ9ngwULpnDFtBeuoL8nIL+yEbOeafVecCPwBRQVhEqOS4fC2sezNaD5/IH EbNA+XFdf7r6Yd27ciYdCNoF4i/yuTsJdq95h2okWOy/IGPhC4bdxoFCj83IIGkhCDtYxi Ij2g5l+J5ULEhiofe+rca1lonMZwPQs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057892; a=rsa-sha256; cv=none; b=uZAckKlgd5L33e8p+7RyqWxOPQ2eqS8vAKXN38y+VJ8Kg3Fvjwax91CS3yfJW1wq68soYF c+igyQsNH0Fh6Glf84PNYp7M0PlfsOthLvSYNuVTtfbs2NWHr9aAs5k11L+8XaUTYhX5Z4 dwRshcTyo1Uy1Tq3h9LJNJbB4Dh3UiI= X-Stat-Signature: 6epp69w8mejexriadejkpu7cmfymd8a5 X-Rspamd-Queue-Id: AFD1116000E X-Rspam-User: Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZFpcJ7bv; spf=pass (imf08.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-HE-Tag: 1656057892-257281 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: Add the per file RSS to the memory management accounting. This allows to see the per file RSS in tools like top as well. Signed-off-by: Christian König --- fs/proc/array.c | 7 +++++-- fs/proc/internal.h | 3 ++- fs/proc/task_mmu.c | 6 ++++-- fs/proc/task_nommu.c | 3 ++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/fs/proc/array.c b/fs/proc/array.c index eb815759842c..a3aabe4ac7c8 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -437,7 +437,7 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, task_state(m, ns, pid, task); if (mm) { - task_mem(m, mm); + task_mem(m, mm, task->files); task_core_dumping(m, task); task_thp_status(m, mm); mmput(mm); @@ -589,7 +589,8 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, seq_put_decimal_ull(m, " ", 0); seq_put_decimal_ull(m, " ", start_time); seq_put_decimal_ull(m, " ", vsize); - seq_put_decimal_ull(m, " ", mm ? get_mm_rss(mm) : 0); + seq_put_decimal_ull(m, " ", (mm ? get_mm_rss(mm) : 0) + + files_rss(task->files)); seq_put_decimal_ull(m, " ", rsslim); seq_put_decimal_ull(m, " ", mm ? (permitted ? mm->start_code : 1) : 0); seq_put_decimal_ull(m, " ", mm ? (permitted ? mm->end_code : 1) : 0); @@ -673,6 +674,8 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns, size = task_statm(mm, &shared, &text, &data, &resident); mmput(mm); + shared += files_rss(task->files); + /* * For quick read, open code by putting numbers directly * expected format is diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 06a80f78433d..1b123893f7ae 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h @@ -305,7 +305,8 @@ extern unsigned long task_vsize(struct mm_struct *); extern unsigned long task_statm(struct mm_struct *, unsigned long *, unsigned long *, unsigned long *, unsigned long *); -extern void task_mem(struct seq_file *, struct mm_struct *); +extern void task_mem(struct seq_file *, struct mm_struct *, + struct files_struct *); extern const struct dentry_operations proc_net_dentry_ops; static inline void pde_force_lookup(struct proc_dir_entry *pde) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 2d04e3470d4c..a4adc6fc13d3 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -28,13 +29,14 @@ #define SEQ_PUT_DEC(str, val) \ seq_put_decimal_ull_width(m, str, (val) << (PAGE_SHIFT-10), 8) -void task_mem(struct seq_file *m, struct mm_struct *mm) +void task_mem(struct seq_file *m, struct mm_struct *mm, + struct files_struct *files) { unsigned long text, lib, swap, anon, file, shmem; unsigned long hiwater_vm, total_vm, hiwater_rss, total_rss; anon = get_mm_counter(mm, MM_ANONPAGES); - file = get_mm_counter(mm, MM_FILEPAGES); + file = get_mm_counter(mm, MM_FILEPAGES) + files_rss(files); shmem = get_mm_counter(mm, MM_SHMEMPAGES); /* diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index a6d21fc0033c..5b6b9c5ed9ec 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -18,7 +18,8 @@ * each process that owns it. Non-shared memory is counted * accurately. */ -void task_mem(struct seq_file *m, struct mm_struct *mm) +void task_mem(struct seq_file *m, struct mm_struct *mm, + struct files_struct *files) { struct vm_area_struct *vma; struct vm_region *region; From patchwork Fri Jun 24 08:04:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894084 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 50F31CCA481 for ; Fri, 24 Jun 2022 08:04:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15E4D8E01E7; Fri, 24 Jun 2022 04:04:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 06C498E01F3; Fri, 24 Jun 2022 04:04:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDA748E01E7; Fri, 24 Jun 2022 04:04:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B3FC98E01F3 for ; Fri, 24 Jun 2022 04:04:53 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 888E020F06 for ; Fri, 24 Jun 2022 08:04:53 +0000 (UTC) X-FDA: 79612393266.09.A6F5FC6 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by imf29.hostedemail.com (Postfix) with ESMTP id 20AFA120024 for ; Fri, 24 Jun 2022 08:04:53 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id ej4so2305054edb.7 for ; Fri, 24 Jun 2022 01:04:52 -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=p1KsJJhvBthReekWVkDyI4HkkhGOTDE0uEXhDskma64=; b=KRem//CoENhA5H2UpmZZdJhIsNw+EqHDcRDSpekGpVdLUsKXbAGMuEpz4BJJr9Z87z IFYClc3R1wwPUygzstZ5aUNS6Wq5y0CfGSvfoDrVHkFbu0scIpPzWzMEq6eV8O7oB/AX FqDJRWt2Ipnk6y0r0VVTgjAU7cmOXdZEoJ0Qo2ZbG6rmkxKpX6vKZa5MuOPpSarFPIOI rvJt3BfdWDmWUzFnm2BJraq/RqKiudFoTZr0bvTI3SMqicR6ERRh4vwjGTYV2bCjY/8g Cs+cebdzqLUOjb0//Sl+P40ocJPd2A5kT/PXdXVI6tczXXpaQaD+aGMxYg5hyRLGbgEA pMnA== 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=p1KsJJhvBthReekWVkDyI4HkkhGOTDE0uEXhDskma64=; b=Q1nABGuoUsUcALt2e4iWLCAelW6p1vSyKC8r1XGkbyT6/qUSW04/i5UV3eW5o/c+vf 8cm1tTltBK3keLimUE+PmItWHw1RniCBLdrz4bDIMU4HiFVzrd7J+Pf4NiuqEd9AWo9a M6+FOm+/xDHYnxFsMEyYZlju9iVYjAKFlU0HsRWHAes9C3v6J7hoY/MzY0KdI+12lxGF nmvgJ67xnhq2o+GTjI5LSaVPY5+a8qiAiOQlO9SFS/Zidj9s2hDfdi5xABipjx4XNvKr xkJo0xrkNSoaJG7p3P/EdPGAlUK9vpyCtVnQLLMRmYYW/mecboijorhoU1Twlt3NWt5w FF8w== X-Gm-Message-State: AJIora+/5T/sngGBEyyup/86OFH/hJjWUCJwMepdwC4l07xQIUtv92Cx RIpxItjEOjYnDIuJVI7RMYA= X-Google-Smtp-Source: AGRyM1sHNTKfIbC1nDS/xDvZBcuQhpYMoeUWuMsHYIL5xwYmRCaeHIcH9pVKRTHXqSe2jlNLioeTeQ== X-Received: by 2002:a05:6402:3807:b0:435:20fb:318d with SMTP id es7-20020a056402380700b0043520fb318dmr15936277edb.272.1656057892772; Fri, 24 Jun 2022 01:04:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:52 -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, =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 04/14] mm: shmem: provide RSS for shmem files Date: Fri, 24 Jun 2022 10:04:34 +0200 Message-Id: <20220624080444.7619-5-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-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="KRem//Co"; spf=pass (imf29.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057893; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=p1KsJJhvBthReekWVkDyI4HkkhGOTDE0uEXhDskma64=; b=DmKUFfvztvKi4RjbVNh9KfNw0RWM6YFKoX6A6EIAV3144MvIgfPDKJ4LWjd4SasSyEx7bJ aa//RaEW8YVfaeFpN8H9RDBvFrou+EmJoTNJEU7GslB9jjh2rSHTRBGlbWF3Z2i+g7YXHe OInbJP54uflVMqokz3HlUsISUKYhw1c= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057893; a=rsa-sha256; cv=none; b=xzVE1xhyfrH5oKBxe4UwnBUwWR0hn6TSO+P4PzAVI5zUcgDe8jPuHQimiwVYjxPVpbV1S6 CfwhayfMVSKBJSBFQ4V04HJC6wnPQ6LVd3V5BdJo3EuJg7fDoTchQwD8Z9Q/6UkOArCJIS L8QYQGCN4Vq2sonb3zsrUzXhwyzUMRQ= X-Stat-Signature: mae4y11c1knq5bbi4dbexbb5t939615z X-Rspamd-Queue-Id: 20AFA120024 X-Rspam-User: Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="KRem//Co"; spf=pass (imf29.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-HE-Tag: 1656057893-332975 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: This gives the OOM killer an additional hint which processes are referencing shmem files with potentially no other accounting for them. Signed-off-by: Christian König --- mm/shmem.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mm/shmem.c b/mm/shmem.c index a6f565308133..b068ac5ba4bf 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2209,6 +2209,21 @@ unsigned long shmem_get_unmapped_area(struct file *file, return inflated_addr; } +static long shmem_file_rss(struct file *file) +{ + struct inode *inode = file_inode(file); + unsigned long nrpages; + + /* Only account shmem files which aren't part of any fs */ + if (atomic_read(&inode->i_count) > 1) + return 0; + + xa_lock(&file->f_mapping->i_pages); + nrpages = file->f_mapping->nrpages; + xa_unlock(&file->f_mapping->i_pages); + return nrpages; +} + #ifdef CONFIG_NUMA static int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *mpol) { @@ -3811,6 +3826,7 @@ EXPORT_SYMBOL(shmem_aops); static const struct file_operations shmem_file_operations = { .mmap = shmem_mmap, .get_unmapped_area = shmem_get_unmapped_area, + .file_rss = shmem_file_rss, #ifdef CONFIG_TMPFS .llseek = shmem_file_llseek, .read_iter = shmem_file_read_iter, From patchwork Fri Jun 24 08:04:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894085 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 E7768C43334 for ; Fri, 24 Jun 2022 08:04:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D8E7F8E01F4; Fri, 24 Jun 2022 04:04:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF1678E01F3; Fri, 24 Jun 2022 04:04:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B416E8E01F4; Fri, 24 Jun 2022 04:04:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9C4ED8E01F3 for ; Fri, 24 Jun 2022 04:04:55 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 73155342A8 for ; Fri, 24 Jun 2022 08:04:55 +0000 (UTC) X-FDA: 79612393350.13.497DEF9 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by imf26.hostedemail.com (Postfix) with ESMTP id 17FF0140012 for ; Fri, 24 Jun 2022 08:04:54 +0000 (UTC) Received: by mail-ed1-f50.google.com with SMTP id e40so2341785eda.2 for ; Fri, 24 Jun 2022 01:04:54 -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=SN2tXnkiXYHDkRcNluGEiWD+Zcie7EgTba4v+LS00Rw=; b=CjcSe9wc4EjfAkbjkiF8NJM6p2V4TBIzx/MVoQMmpgiPsjLyR+gRuRTFEYB3Ktsmj6 uDAJoHxOnz8/QuPN6vTSy5gLwbvZIrxGeq6qoPabZTcRU6gXi4B9UgKRuVNDxdOuXcL1 cxd/73iXXQR+fr9ZjFoDFmjR0cLQM1R0DIR2jGAJPqHq78r8H+21zwbEgz340DrDdfqf X5N2BIdOCyjdEdUdAOIQhfOYFDl6u7OALHxEmKZyWH8er7gOe7gpZJPRqEWHVjjT+Zda LFVWx/ojsAy6fLSK9XLReier7Yc/aQFSo1vJ6Ffb4pLtiw1aDQ3/hGk/ftltPnqcfrJN mArQ== 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=SN2tXnkiXYHDkRcNluGEiWD+Zcie7EgTba4v+LS00Rw=; b=OrkOpjWRsChzB49hZnZp2dshiMkgjUoMSvxsj83CPh78hJIUSNphAnSbRwG66ZVzzX mR32i9NYFTqR+YXtLGkljP7ct4BUjpNhnYmS32ZcycOBpgYJJtDjTVfs0VzvV5EuTMig JYUjx2sIMU/ZPl3lDP11O8yI0RaC64Vml7IjFGTiBOs62A1OESMksk6WoRd07a4lW0hg AEo14q43tOEy02diw7qKiW8te30CEcxLom2wd8LQ7nVDE2MsO9juAGKQWgFrL3ZlfxCP vNI9RLMPkVTnjAT1QJjSrzAFTYF9f2IucI9F/mYszOyUb81QJ12c/Kk5sRaryCSX/Orx r+ow== X-Gm-Message-State: AJIora97NLOnUEpH3/6LYc86frKKWyoEEmrN2UWgSKke9sXQpur7TZwN ab1itJuNE6xtLrLx/TTnvQY= X-Google-Smtp-Source: AGRyM1tBvj71cbsgZ5j4wXJcKfxDt7AmGXAvH0woqtRU4by1QVnuj6MIlbtq+6gf5TBsdwCsD9lmDQ== X-Received: by 2002:aa7:d296:0:b0:435:7f33:38bc with SMTP id w22-20020aa7d296000000b004357f3338bcmr15804834edq.399.1656057893977; Fri, 24 Jun 2022 01:04:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:53 -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, =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 05/14] dma-buf: provide file RSS for DMA-buf files Date: Fri, 24 Jun 2022 10:04:35 +0200 Message-Id: <20220624080444.7619-6-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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057895; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SN2tXnkiXYHDkRcNluGEiWD+Zcie7EgTba4v+LS00Rw=; b=M9ynHXTUBEJhfm6cjVyfXxM/MAgzFTBWPjJRYhpz4V5kiuy+v7NKTAqDQwZavtmYBWAjqg ZGYSQjY96A9O5RtwUtop/LUuNMSNYmksLR0PkoE91pGOl6nx4NprL2HR+2Viw8P7d9RTkQ cA+khwk3WG5rmTdUC+a/S+M+Dcq1wG8= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=CjcSe9wc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057895; a=rsa-sha256; cv=none; b=rRAxOVbCdi5cLalEJzEN2RpDqng69zmOLjs2jof5lQMunQY3heYz7KVrH5srmab3DaCOD2 SAMzB+C0+1ze0EHymDXLI28DT2QmTieAlUdOAD0CbAXuMxTZIV/8qKHJoE+vx4kGdGatws KJHxY3q0zAkTmaQfuBI56DEX43aoCck= X-Rspamd-Queue-Id: 17FF0140012 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=CjcSe9wc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.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: rspam11 X-Stat-Signature: wp9wd75p19tnatgfxciptpwgxrbxtewx X-HE-Tag: 1656057894-446982 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: Just return the size of the DMA-buf in pages since pages allocated or mapped through DMA-bufs are usually not accounted elsewhere. Signed-off-by: Christian König --- drivers/dma-buf/dma-buf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 630133284e2b..16162ec3538c 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -494,6 +494,11 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file) spin_unlock(&dmabuf->name_lock); } +static long dma_buf_file_rss(struct file *file) +{ + return i_size_read(file_inode(file)) >> PAGE_SHIFT; +} + static const struct file_operations dma_buf_fops = { .release = dma_buf_file_release, .mmap = dma_buf_mmap_internal, @@ -502,6 +507,7 @@ static const struct file_operations dma_buf_fops = { .unlocked_ioctl = dma_buf_ioctl, .compat_ioctl = compat_ptr_ioctl, .show_fdinfo = dma_buf_show_fdinfo, + .file_rss = dma_buf_file_rss, }; /* From patchwork Fri Jun 24 08:04:36 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: 12894086 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 2DB3ECCA481 for ; Fri, 24 Jun 2022 08:04:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B2918E01F5; Fri, 24 Jun 2022 04:04:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 638618E01F3; Fri, 24 Jun 2022 04:04:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 48C148E01F5; Fri, 24 Jun 2022 04:04:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2C31D8E01F3 for ; Fri, 24 Jun 2022 04:04:56 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 079AF349CD for ; Fri, 24 Jun 2022 08:04:56 +0000 (UTC) X-FDA: 79612393392.04.5032E04 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by imf08.hostedemail.com (Postfix) with ESMTP id A635116000E for ; Fri, 24 Jun 2022 08:04:55 +0000 (UTC) Received: by mail-ed1-f51.google.com with SMTP id eq6so2313649edb.6 for ; Fri, 24 Jun 2022 01:04:55 -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=693VGEXA19r817fSkp2HQ7yboKFhWxOFXyjV0CxaoD8=; b=bPO2J7WjvzBcNpfIHv7dl25KdodmC5owqOj/ao7wNhAnd3KqvnC/BclTClPISp0FIg ErmyDY0AnX0VgWurEGxdWOwwQCER5PQ8tiXh8uXejlJ71JfTDxMflFOmlfyeUtCgpzYl GCNQ6a3+oelf8dKov7UIjW0o/PNElo5JTYQYT16G+EdOs+rFrzp8MWQJaRzfStUeqoJU MAaIvGG9hQ1CJqJB/mBg7bHcQtPQ4wHEK/inBzbq6m/eeuM3S02aw2kKyDLmLsG/efiK hoTfCJ2TyZ5SBAvoWyQg6Igc48Som98fLO9wcbofHL1PNn01cJ6620JB+zhOQQSTbm9Y 3eGA== 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=693VGEXA19r817fSkp2HQ7yboKFhWxOFXyjV0CxaoD8=; b=W/+n8H5TCJ7IR1X1iMv7auQiC+sIJROavhUhdd9gCU03rFkKUlD3abxaUS7vfYqO9L N+I1+t7n83E/D4oTaBWEJNougNgys/yJRkIG21SJ74pshQwpi7CVmxM23t77us56B2sJ hj/l4D6VNO3W0cT8x31jKu6qm7xHyDCeDlxHQasleUrbenvCSJV5LgNnCkYTHSCbuR8E zF5y50QAYeXqm986vevXvt2CV5Y3x/D4Y4rlAstKHh3MkNqQWvQRVOgMmK6M47UB2cot YHSFvPUgLNLx/Dda4c12MsrRdaKF1LniYmAOBfmAFWhVqKMFTqhFdBegl5JZdC2D9/di sNTA== X-Gm-Message-State: AJIora+ihdSNj9nC76dEUjxlGf30PQHVI6YuI/mkP0aJbgGwLWdYQIEC 7dV1F5S39shI09xjsx4+yfLu9oJnr0o= X-Google-Smtp-Source: AGRyM1sUzCXIERY4xHIb6/DBgczJUjRT28k1Ye0d5toII0cbHGJ1AwKeLvxpb+HA2e+MaKqALcspsA== X-Received: by 2002:a05:6402:5188:b0:437:618c:c124 with SMTP id q8-20020a056402518800b00437618cc124mr290922edd.233.1656057895213; Fri, 24 Jun 2022 01:04:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:54 -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 06/14] drm/gem: adjust per file RSS on handling buffers Date: Fri, 24 Jun 2022 10:04:36 +0200 Message-Id: <20220624080444.7619-7-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-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bPO2J7Wj; spf=pass (imf08.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057895; 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=693VGEXA19r817fSkp2HQ7yboKFhWxOFXyjV0CxaoD8=; b=KeZsVUSygLe7fWptG3IqXkZqgf6tFXm4uil7dO+SYf915sWM8CurifZyaaPM2ithyAt2wH XmdN45/wiKJFYcjq7+13Ro5fD7hgvOuLtS8cPm/vnQSJQnTpzwiydTPwyFkNnRzNgwGQ9R oOVXHPTGbO/mx6vV0oLO+snldOlgtX0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057895; a=rsa-sha256; cv=none; b=vNjRuQJvQ8ob+tOPO0rP+Nu5QwwX5iubXBY246pdQeEpyon7bAQk5348hPhSp6y6PfMZeM cPPv+3+p6a7+iqPUReGXBNuVu8G5dU/Snab0Q2+2Cv/np0cql74CMiDpW4K2Iy/uCbP5vw UBpwCPVyxTQpHGmWBUtMR1GBWmFLaNc= X-Stat-Signature: kytbcyhy13qghxm9txan75buzin7aus3 X-Rspamd-Queue-Id: A635116000E X-Rspam-User: Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bPO2J7Wj; spf=pass (imf08.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-HE-Tag: 1656057895-126851 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 Large amounts of VRAM are usually not CPU accessible, so they are not mapped into the processes address space. But since the device drivers usually support swapping buffers from VRAM to system memory we can still run into an out of memory situation when userspace starts to allocate to much. This patch gives the OOM killer another hint which process is holding references to memory resources. A GEM helper is provided and automatically used for all drivers using the DEFINE_DRM_GEM_FOPS() and DEFINE_DRM_GEM_CMA_FOPS() macros. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/drm_file.c | 24 ++++++++++++++++++++++++ drivers/gpu/drm/drm_gem.c | 5 +++++ include/drm/drm_file.h | 9 +++++++++ include/drm/drm_gem.h | 1 + include/drm/drm_gem_cma_helper.h | 1 + 5 files changed, 40 insertions(+) diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index ed25168619fc..b60795c5067c 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -1049,3 +1049,27 @@ unsigned long drm_get_unmapped_area(struct file *file, #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ EXPORT_SYMBOL_GPL(drm_get_unmapped_area); #endif /* CONFIG_MMU */ + + +/** + * drm_file_rss() - get number of pages held by struct drm_file + * @f: struct drm_file to get the number of pages for + * + * Return how many pages are allocated for this client. + */ +long drm_file_rss(struct file *f) +{ + + struct drm_file *file_priv = f->private_data; + + if (!file_priv) + return 0; + + /* + * Since DRM file descriptors are often DUP()ed divide by the file count + * reference so that each descriptor gets an equal share. + */ + return DIV_ROUND_UP(atomic_long_read(&file_priv->f_rss), + file_count(f)); +} +EXPORT_SYMBOL(drm_file_rss); diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index eb0c2d041f13..69b3e93db816 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -256,6 +256,7 @@ drm_gem_object_release_handle(int id, void *ptr, void *data) drm_gem_remove_prime_handles(obj, file_priv); drm_vma_node_revoke(&obj->vma_node, file_priv); + atomic_long_sub(obj->size >> PAGE_SHIFT, &file_priv->f_rss); drm_gem_object_handle_put_unlocked(obj); return 0; @@ -291,6 +292,8 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) idr_remove(&filp->object_idr, handle); spin_unlock(&filp->table_lock); + atomic_long_sub(obj->size >> PAGE_SHIFT, &filp->f_rss); + return 0; } EXPORT_SYMBOL(drm_gem_handle_delete); @@ -399,6 +402,8 @@ drm_gem_handle_create_tail(struct drm_file *file_priv, } *handlep = handle; + + atomic_long_add(obj->size >> PAGE_SHIFT, &file_priv->f_rss); return 0; err_revoke: diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index e0a73a1e2df7..7c6ca13d8549 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -366,6 +366,13 @@ struct drm_file { #if IS_ENABLED(CONFIG_DRM_LEGACY) unsigned long lock_count; /* DRI1 legacy lock count */ #endif + + /** + * @f_rss: + * + * How many pages are allocated through this driver connection. + */ + atomic_long_t f_rss; }; /** @@ -430,4 +437,6 @@ unsigned long drm_get_unmapped_area(struct file *file, #endif /* CONFIG_MMU */ +long drm_file_rss(struct file *f); + #endif /* _DRM_FILE_H_ */ diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 9d7c61a122dc..b64cad26e9e9 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -338,6 +338,7 @@ struct drm_gem_object { .read = drm_read,\ .llseek = noop_llseek,\ .mmap = drm_gem_mmap,\ + .file_rss = drm_file_rss,\ } void drm_gem_object_release(struct drm_gem_object *obj); diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h index fbda4ce5d5fb..8c56cbc8d10f 100644 --- a/include/drm/drm_gem_cma_helper.h +++ b/include/drm/drm_gem_cma_helper.h @@ -273,6 +273,7 @@ unsigned long drm_gem_cma_get_unmapped_area(struct file *filp, .read = drm_read,\ .llseek = noop_llseek,\ .mmap = drm_gem_mmap,\ + .file_rss = drm_file_rss,\ DRM_GEM_CMA_UNMAPPED_AREA_FOPS \ } From patchwork Fri Jun 24 08:04:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894087 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 ACB4EC43334 for ; Fri, 24 Jun 2022 08:05:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B95F28E01F7; Fri, 24 Jun 2022 04:04:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B1D358E01F6; 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 8D43A8E01F6; Fri, 24 Jun 2022 04:04:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 627D98E01F3 for ; Fri, 24 Jun 2022 04:04:58 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2DA42341E2 for ; Fri, 24 Jun 2022 08:04:58 +0000 (UTC) X-FDA: 79612393476.21.2E1A8FC Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by imf13.hostedemail.com (Postfix) with ESMTP id 8B7CF200B6 for ; Fri, 24 Jun 2022 08:04:57 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id o9so2276362edt.12 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=ID2laRfYSApmjGzin/c5O7ZzYP1tMI9ua34YWk456Wk=; b=U7uY3MsA0DHippF6S8UKVRKmsJnNzZVtyS/oxSk8mnuxYbuH6lVcfrpX+0QqNbAzsr OHPqC1A2CJXe90yHB7/dZKLeRQkrpAbVd3R0tfpASOsFiFVpqjxyZSja4Ln6UQfGkV1F vEhUaLJqQTsf0mDlK6LHd6b+sDgfx27xoxB1E1JLj9lewb9qKNqcQpOqIQ9VN902Eeco K9AuesVMeK0hPkCglbUSWjfKsjVujF7T8cb3mCE5ZaCnxoDqUl7F2zCL64/5pa0gH7B9 1NKNHVz889djG0KWGG8iwf1I/ljLUIKtvBLVbUBVPCkEvOT+MIVlMWKc5SSwZwD6KAKU AbXA== 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=ID2laRfYSApmjGzin/c5O7ZzYP1tMI9ua34YWk456Wk=; b=rdLusYm8jSqRDIUkJZFunTAG2DaDkqY3SjE2H4EiwUfYeY3Lg2syR9ijhg7wUJGSg6 6a83tn9at5miTZQT5natSGJQ3m5x/aTR/CIaufPhphv5wyzMWBF81IIv0WKlTd6NN0JG Tcfr5k5Kc/6SN7HaSsUJu35ylT/H01SnEHheN76fh5JreU8LXbEFv993UoqqrGr5z88G zsgRDZC5qZucUB6i0ffiFUiaGJ7NjQs5dR/7Dom8e1WJMJKLequsZMfXiYYFEvi2jPr2 lFhlIUh9PVcmwCge1ecji0UH9tnButLTFlGbPp0uB6D2ZMrL6zJ0zN8bwfn53z+kZChg C4yQ== X-Gm-Message-State: AJIora/Vwa0j80ABuGSAQiprnRR7i6w9i6hGbcpUNDHG6TsXRNNlume1 EL8esMophWVaTGQ8azTPcE4= X-Google-Smtp-Source: AGRyM1vXothqzNCeq2wfXu0Iy7pDBGR1100k8JOpLZpuKKiLhk+9M6Fn95/BBmkDNLC1mjmi1D/X+w== X-Received: by 2002:a05:6402:11d1:b0:435:d76d:f985 with SMTP id j17-20020a05640211d100b00435d76df985mr7954996edw.8.1656057896438; Fri, 24 Jun 2022 01:04:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:56 -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, =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 07/14] drm/gma500: use drm_file_rss Date: Fri, 24 Jun 2022 10:04:37 +0200 Message-Id: <20220624080444.7619-8-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=1656057897; a=rsa-sha256; cv=none; b=7UV5gSa+bYt916uW04v/MLcEmUSLJmtJRE3t0S4fflSO8QGjLzzq+tYAHmvev8LOY7Qy2d ewm9IF1JwwtdXqyUWoH23NKMHQYgwUSVDav2FKXFsZKEzn3xgQ6H4LRdR8GxsYRZClnp1+ RA693jHSL0Dy0C/5B1OlHrrKVpIjPTo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057897; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ID2laRfYSApmjGzin/c5O7ZzYP1tMI9ua34YWk456Wk=; b=RLoPKmPrKCTVio3CPW+Lpf1XOR0+zDjJ0nLQJzFAQAQfdD1Bpy4PKOtfC1VlhVMbqvo8A2 rxWBtTo8MSLaEQJhOg7Wol8UTOrNfA2c8Wdnzl7SMIKOk+vypM9WWw37CoZWWukg0edzjP Ivu8KeBaq5TOOKRDi9Ly9HTETOX2QF8= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=U7uY3MsA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Stat-Signature: f1qbncdeukufusrkwunyenmood3fwjan X-Rspamd-Queue-Id: 8B7CF200B6 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=U7uY3MsA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1656057897-108222 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: This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/gma500/psb_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 1d8744f3e702..92c005aa6e9e 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -513,6 +513,7 @@ static const struct file_operations psb_gem_fops = { .mmap = drm_gem_mmap, .poll = drm_poll, .read = drm_read, + .file_rss = drm_file_rss, }; static const struct drm_driver driver = { 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) From patchwork Fri Jun 24 08:04:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894089 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 0D5CECCA483 for ; Fri, 24 Jun 2022 08:05:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB9E58E01F8; Fri, 24 Jun 2022 04:05:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B41A28E01F6; Fri, 24 Jun 2022 04:05:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91FD68E01F8; Fri, 24 Jun 2022 04:05:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 74DC38E01F6 for ; Fri, 24 Jun 2022 04:05:00 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4BB2333F44 for ; Fri, 24 Jun 2022 08:05:00 +0000 (UTC) X-FDA: 79612393560.31.E29C6E1 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by imf18.hostedemail.com (Postfix) with ESMTP id E165C1C0096 for ; Fri, 24 Jun 2022 08:04:59 +0000 (UTC) Received: by mail-ed1-f42.google.com with SMTP id o10so2358355edi.1 for ; Fri, 24 Jun 2022 01:04:59 -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=byPE9Yoru8EMtsMIQe5jAdiqqlz8rrO56DVvtVJd9qg=; b=m1LPw4Tq7YAn8lQCGgWgt12CjzJ5ei1Ei63rf/aKMcF5rpgBfXhWWd5y3NKVG8Ui9/ K3F30mqlEy32o+QZsZXlA17af4wRr1DVKixhlju+deheafQ/NAXkt5GRlFmAkXrz01om TzwlkMMWSIsZz8Y8uObLx5ljXVdIXmDX3AUzGfBhaZh2KCqzGxsWKyfjOqHtTTOnuQk3 r1HIiRKeCgO4p1DUTcPzLqAFw481eF/Afji3PnuaKxzRhlw9/Ofd3QbWU/gWWeNF2Y9Z eMVfDCvHAUic+3PY3ZEtifzoXXEm0gqpa/KTCrNtzATjGFHR2fzV08RAqKXrhHMLRFyL Yixg== 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=byPE9Yoru8EMtsMIQe5jAdiqqlz8rrO56DVvtVJd9qg=; b=WhjgZ6YHo1lfcw1uCdpaFVpwxF0+LfaIHZ6ykjPdv9qs2+7DFj4e0ZdbwtnLQK3lS+ dN+IjX5ztgEW5/o7JQVepRsVSv3UEwK2107WL/2audbimLSugQOnvsotfPBx6qc+SAdi 5p8NyjTzKX0btjyeXk7DMScwf7RSBWTtXUZTUkgmh+LgoB0N7sxfiAOpcDjDGsY0vyg7 FfDAfu5CtcwmY+WXLjhGShgmrpJ8zdVZKncxfkt4TVWOEyd5w2FQTA0GYij0c/J5pFzU d/5FaORT7pLQHwRaStbPyAiSGnIPECUjCHmahuAKsAZPndjLqR5LZpfc0OLHEohnOywF cNgQ== X-Gm-Message-State: AJIora9IJ2+zqDJXeeIkuXdPd9tMdo7NjqGn8IpD5Uvmx7XrsC9+NQ8b vzvgOrGvumedp5Wm3Xi8QdkW9JjuL1w= X-Google-Smtp-Source: AGRyM1tei8ieA1a6mCZFwIOAyKz2hIJ91XJFBH3Ye843yczThgaTMvzSiEfsJRV0/KOD+tyxr8SMCg== X-Received: by 2002:a05:6402:2790:b0:431:4bb6:a6dc with SMTP id b16-20020a056402279000b004314bb6a6dcmr15766928ede.48.1656057898870; Fri, 24 Jun 2022 01:04:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:58 -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, =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 09/14] drm/radeon: use drm_oom_badness Date: Fri, 24 Jun 2022 10:04:39 +0200 Message-Id: <20220624080444.7619-10-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-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=m1LPw4Tq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.42 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057900; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=byPE9Yoru8EMtsMIQe5jAdiqqlz8rrO56DVvtVJd9qg=; b=XYjE9NEGTAKtoTgGFMRcLxFcrm3KUaBJ8tIXhjt+KGiJ3TsRAmPzDztcvFucFNtk70muyO VyPNfscD7dp92QavBYgqB1J71PZr9BkMCbAyIavCLIz079NnPOPSnIi0wirZgMxpBAKRJp nSJzaFjUybSGTaSGmvpAPHSIxo9uyaE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057900; a=rsa-sha256; cv=none; b=KnXXQKHWrFU4CCirZFIOF+0CXmMjj7Vm/MByaCNKEVyw4tzldsZ8uChdK3q3RQUOCbxVf/ Z9v2OARqssNcOLl1RaSWkAG+RxZTiJQUQPM5CcX35CLv5vXQaQQM60xM3obdIwGstOolw7 BWzj9Aph2oFCXXAObLmCFytiJfi/9Q0= X-Stat-Signature: wt54cfbytx39dt9iwi1rfjsng6br4gtf X-Rspamd-Queue-Id: E165C1C0096 X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=m1LPw4Tq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.42 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspamd-Server: rspam12 X-HE-Tag: 1656057899-410116 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: This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/radeon/radeon_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 956c72b5aa33..11d310cdd2e8 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -550,6 +550,7 @@ static const struct file_operations radeon_driver_kms_fops = { #ifdef CONFIG_COMPAT .compat_ioctl = radeon_kms_compat_ioctl, #endif + .file_rss = drm_file_rss, }; static const struct drm_ioctl_desc radeon_ioctls_kms[] = { From patchwork Fri Jun 24 08:04:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894090 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 60893C43334 for ; Fri, 24 Jun 2022 08:05:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8AE108E01F9; Fri, 24 Jun 2022 04:05:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 835E58E01F6; Fri, 24 Jun 2022 04:05:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59D678E01F9; Fri, 24 Jun 2022 04:05:01 -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 451198E01F6 for ; Fri, 24 Jun 2022 04:05:01 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2052A20EA8 for ; Fri, 24 Jun 2022 08:05:01 +0000 (UTC) X-FDA: 79612393602.08.BC792A3 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by imf13.hostedemail.com (Postfix) with ESMTP id 6D1B820033 for ; Fri, 24 Jun 2022 08:05:00 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id o9so2276362edt.12 for ; Fri, 24 Jun 2022 01:05:00 -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=m/E6hWEFQyi25CxFeEuPVoEVkNjsUA/fW4bkRRrhTG8=; b=e8Okw9V9KyZY0LQ9UKvtkO1+tj9txF7SZgjxfu0nIPVJ7UHFSFPajh1LcrrR+mc/Ax 7Xcml0b3DTzx3T2bMsv8lp7T6q7E8SECtadIf2BbI5ZWp1CKCCjXMJ+X+N3gB+Fbk+hI b31Ng6R/qrQ8N6LOuGNRH4RuKGuBjnKOVPxxK7EXBtqVHECTyUdENgmbiNMStYeqtDEf i8j/Pv/qCpjDot+5YbNEf4ExwNPa/ehQnPHUm9ruLn2IZbJZpd2tKFDQwHw3MDtpAITE BVAJdg6xrEucAqwIZovpm02Nb/tWQUOGD/LUv75bzOhZfpRKGHx3/vDdg1//bFowy+2C xUAQ== 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=m/E6hWEFQyi25CxFeEuPVoEVkNjsUA/fW4bkRRrhTG8=; b=3sIe5GArUnDEWKUq4811zU3WU08GegE7+cCl84wo3xyerHjgxbrkLU4ohfDaXbEn7d qzxJOcxG2GvZPUZN68oh3iTtLmRV1/11Dxpp4UewSynOsg1lvthM8PFigXujp0bY2+Iv 7nuRBKtSRdy6v/FCDKVPpczSdRTviB8MBnzSEljW5EXKN5yeuo4KDDUU5qddaE7I4doH SF+1AWWFQz8iRaS7pYmHMfA7AjAwuTHDV0hJz6HRphzXk8n9j1GZNkbFdu+qNl/w5GGx Nir2IlyJ169dPx1UECan4Q19yi1af53y8ZS783LW/zJLMW3okSnqZF7FpaYTJcd9ibZ3 FkcA== X-Gm-Message-State: AJIora8quwgyu8enRoIzL3D2mDRCi/60qV162PsYwAKHz7krtbmN/gR0 +S8zMslJQrto1MzjH/byHno= X-Google-Smtp-Source: AGRyM1sPm1PtPb+HeXcaBFnsmjeMMONuCGOa4UKNnvwqlpKNsvibmM7CXbEqPCXHhwwP42+MiDXxcw== X-Received: by 2002:a05:6402:5c9:b0:420:aac6:257b with SMTP id n9-20020a05640205c900b00420aac6257bmr15655024edx.128.1656057900060; Fri, 24 Jun 2022 01:05:00 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:59 -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, =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 10/14] drm/i915: use drm_file_rss Date: Fri, 24 Jun 2022 10:04:40 +0200 Message-Id: <20220624080444.7619-11-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=1656057900; a=rsa-sha256; cv=none; b=tDciqj33nEtbKnqUmhQMSZdlD/qYziTTeBaMPmDzpmsqmbVjZ2L0jwu6abvl2uEmcf/eIh ljJ7fhBLXF9Mi0S6Lh5Egybe7Zq2bX5nyvu6Jex4v1KrytdVupbGBH/fsMx/TaDnpRpSQ4 Fk//5WIWDajjCz9HquO80O1fzbKUvBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057900; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=m/E6hWEFQyi25CxFeEuPVoEVkNjsUA/fW4bkRRrhTG8=; b=VTIVEwWiZC0PMgoqCDjwt8ZpgQeM1tS0nWYKpPRdKopkl4tUTSd5xtWuvV2LLZiNaLyEBI R9y1esze7UyRrlKSUs3J///Yn53TA+VrgNHoZy6ayJiWN1CmMajm30qVL1AeLG+4YVkbOj ZCNsfWc6XR2nFUv84Q38h88VGtLQcIY= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=e8Okw9V9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Stat-Signature: tz7rymrc65dpaab7wgqpmyqx469eyc4h X-Rspamd-Queue-Id: 6D1B820033 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=e8Okw9V9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1656057900-118736 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: This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/i915/i915_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index 90b0ce5051af..fc269055a07c 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -1741,6 +1741,7 @@ static const struct file_operations i915_driver_fops = { #ifdef CONFIG_PROC_FS .show_fdinfo = i915_drm_client_fdinfo, #endif + .file_rss = drm_file_rss, }; static int From patchwork Fri Jun 24 08:04:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894091 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 D1AC7C433EF for ; Fri, 24 Jun 2022 08:05:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E06C58E01FA; Fri, 24 Jun 2022 04:05:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D3D218E01F6; Fri, 24 Jun 2022 04:05:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B91B78E01FA; Fri, 24 Jun 2022 04:05:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8BE658E01F6 for ; Fri, 24 Jun 2022 04:05:02 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 05D63DC6 for ; Fri, 24 Jun 2022 08:05:02 +0000 (UTC) X-FDA: 79612393644.11.7A94204 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by imf04.hostedemail.com (Postfix) with ESMTP id 987A840021 for ; Fri, 24 Jun 2022 08:05:01 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id e2so2335676edv.3 for ; Fri, 24 Jun 2022 01:05:01 -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=TEEoP8KCSv5pjlxAC2eGIjep+gJf30N0QWrbUiAblRs=; b=NsqpIeUqz6z1oXfKvdYH1/TqTFTXK9j1sJxHR/6+teGsI6wAcS38sTUENz1r/j+qWB Zx5BEXmUAQRLHC+0/WMd5cHg7pqTjt2mJsun4y65v/FkbkdUuEowB0Xeil8wiVIopW0C v7uFC+sCP7XMFz3Y74shfL8paThvoo6rqN5jyvJIG2lp6HaYqdHKi3OzUK5gdPk77trY JLyV0mg+oHiky3PUkntBd6bE+5pzI81H81uvLdg5+PBonm8eW64IOlBu28lZPhHT9xEL e7ST6iswEXQNp5oHPD8epprMYI811lDLgUfizTiIewMN4uvazsjzOwEcCSjRB0yo2rxG tMwA== 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=TEEoP8KCSv5pjlxAC2eGIjep+gJf30N0QWrbUiAblRs=; b=ckiyTDc1qoZkRqoyT9Cyy6a8r5sRAu5+49Wndc0Z1h76lYb73PNDs5S4bzCiM3i5cf gW2YOJpY87IkAPd6RCTPnZHCbwbypYUMnQ5PvvUa3mVN8qOlqk9/EiPXf3gYFZgbityu VQg7bElf9sMYg0OpZodNC9iFTGfD85in65Lm/rnfYQ2B71vqWRSPcClaDPgWnYL87lQ5 bxSsqFMUEBJq4mfl86Q+/eqjRrV3cJWKWkV0jmmSZdIe03lRGVCHBgmwgGXwZuzH8tct J07a/IDMek4U9Qc+8EscGcFCjdIGMEEc2mJyM+A4OHe4ENiKoVH3Z2haKuNiG90DEpni BYog== X-Gm-Message-State: AJIora9ANeeRWYTu1bSwH6mTdQBzo3hh5EpKkmf6KFIhqaMnkPnWasNZ feLvlkhbcPjPPAi+ZV25AAEhLkrASmA= X-Google-Smtp-Source: AGRyM1s12FOWdmvVSggeHhbhrd16lE3/DoVEUD/LwuW4RhCc+Y/hP3ZDhy6clyaoJ7ITIboMGB65hA== X-Received: by 2002:aa7:c952:0:b0:434:edcc:f247 with SMTP id h18-20020aa7c952000000b00434edccf247mr15543375edt.412.1656057901251; Fri, 24 Jun 2022 01:05:01 -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.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:05:00 -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, =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 11/14] drm/nouveau: use drm_file_rss Date: Fri, 24 Jun 2022 10:04:41 +0200 Message-Id: <20220624080444.7619-12-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-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NsqpIeUq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057901; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TEEoP8KCSv5pjlxAC2eGIjep+gJf30N0QWrbUiAblRs=; b=Dc9D6KmHAkyZkLSW1L0Qp2ILs0+nQV13a9dAEZCKONmxQzUsxkZvZ+SwQllUD5P+YTBk4a MBlvrqIBjG0FpCkDzz1g3TF4l2J+uDOzwtReY6sHPVvzxJZ/tSnub24ln1zGMNj1eN7h7w XkXi8xr3kp1wJI5sAie5xWikW5wOHcg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057901; a=rsa-sha256; cv=none; b=g5DBbeemlQ7XmsQqzdeGKfjmGetbu4Vomd5xGnzKV2+swxtA3J2k/D+AVAPcvJhE8+mITU zDzF9KAnHlQgBR5SNdYIrgV5aosv344+jjHwqYGxQyXsOcY+bC3wEnr3HOqT2qmYnEJa8R JvDSHh2Eg4B168wZ90bFHO6Y3MKfH8A= X-Stat-Signature: r997im53bcqo15suju6u76rjp181p5gr X-Rspamd-Queue-Id: 987A840021 X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NsqpIeUq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspamd-Server: rspam12 X-HE-Tag: 1656057901-253852 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: This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 561309d447e0..cc0ac7b059fe 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -1218,6 +1218,7 @@ nouveau_driver_fops = { .compat_ioctl = nouveau_compat_ioctl, #endif .llseek = noop_llseek, + .file_rss = drm_file_rss, }; static struct drm_driver From patchwork Fri Jun 24 08:04:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894092 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 4C228C43334 for ; Fri, 24 Jun 2022 08:05:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 79C178E01FB; Fri, 24 Jun 2022 04:05:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6FC658E01F6; Fri, 24 Jun 2022 04:05:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DC368E01FB; Fri, 24 Jun 2022 04:05:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 228AC8E01F6 for ; Fri, 24 Jun 2022 04:05:04 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 024A7C4F for ; Fri, 24 Jun 2022 08:05:03 +0000 (UTC) X-FDA: 79612393728.05.9CCA4C1 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by imf11.hostedemail.com (Postfix) with ESMTP id A699E40032 for ; Fri, 24 Jun 2022 08:05:03 +0000 (UTC) Received: by mail-ej1-f44.google.com with SMTP id sb34so3030771ejc.11 for ; Fri, 24 Jun 2022 01:05:03 -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=7h6tONB4sw4uv1o8ITO08dQoAN0r8TWfzTc1cDvUnqs=; b=Q59ZDM0bs66kYTouHFV3SH7kQiFRv8zAdPLal5R6bK6lLwicp/kD7pik3lBee8DZX6 WjFSGBfwF+GZvlJE8V2r4yZYlHtq+V7w5wxAfdmue81Rk5Au3jDlZEuUJFHZndYxL05t Ibe4zJZteTFiI3OYBpLOLUg3BL649o69+FMAHcL8GF+ZgZAjH9/pTivOYrkyoaDuf/d6 QStbApg579KEKEi3o8lC8TkfL1GqADjPzKl4hmJsbaygYpN4yg8E0HDtU5D+m69zgWyk oqqPfy5Xdm5n/aLuRFeGPi/fosEZBhi026xzbJX77OYzK7dtCEyZRZkwWliyAnH8t2Be qmkg== 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=7h6tONB4sw4uv1o8ITO08dQoAN0r8TWfzTc1cDvUnqs=; b=4tZ3B89cQSRtGbGSmE3pmS06wHp7fpPWqXj1H418t0wf7xAm6MziR+115f/7tjmIc5 doGoe+00uMwpsLLECMtUd9/847gzqSoEDiX2Lx4XbTd0enQKAHyym4cAs7rf83cPY7RM jP5qaB8cIN9oei+6fJzFKlU6qobKggwKxGx9lmsWV7xFjWhg2hPB1PipCg9gTKi7IqSN /C8/kCmywk1jNQHaIF2hFYWzO0LY0gYbQoPa2H9JS/yLBKJfVZnK0xpzwj+jSKV40U83 o9Rot54RaECy4x8FQHg3BZw2sbi6v/3CmM3jxatLvHwUt3UBWl2iSfv0X0zLkw33E91H nPFg== X-Gm-Message-State: AJIora+pO+CxdUFrCGBq28zXGyJojAmnSgGzXHvkRoWf/Dprd9rU5O/z 74ssNXbazXOPLbizQ53b1kY= X-Google-Smtp-Source: AGRyM1u1kM9hV5B2jw9gM+JFOfPel32sur1C9sCcKAHE7MFpkQ9lyzjasZeMq//UEzPa6HSaMFHF8w== X-Received: by 2002:a17:907:97d1:b0:722:e6fc:a04 with SMTP id js17-20020a17090797d100b00722e6fc0a04mr12082666ejc.217.1656057902587; Fri, 24 Jun 2022 01:05:02 -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.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:05:02 -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, =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 12/14] drm/omap: use drm_file_rss Date: Fri, 24 Jun 2022 10:04:42 +0200 Message-Id: <20220624080444.7619-13-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=1656057903; a=rsa-sha256; cv=none; b=f59LoscrGR5vrAoW66iMhKR1x5MN/U+inOu4Cv7/ojcnEpu1r6d319TLAK69k7J34QAYzA zJnrw/F1FsjBYBBZPQXYH15caOvoxeHcz07EA1L9z1wPVStLBMosdFNCIZ3ZLXnPH+v1Bc EeOtxkJq8hOfU/k8ClPKXJRwL6C/QHs= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Q59ZDM0b; spf=pass (imf11.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.44 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057903; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7h6tONB4sw4uv1o8ITO08dQoAN0r8TWfzTc1cDvUnqs=; b=hCe46DkilUv4IJMwGvqnYG7JCqLochnb7zn3Fzy6x7zJUZhSFIjsUvcBiF9moM0i1mFt+9 BUcL9bmFJ76h1sddFdGOMH44/usVAjR0pgzpqtcLUIBcrn7pv1WbP0tsO47uTUpp58BXbJ lsSQpSV95Vades4oUBTAZYl/xXhb+2E= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: A699E40032 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Q59ZDM0b; spf=pass (imf11.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.44 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Stat-Signature: 7q5y4yarspc14n5fk558pg3gairxihew X-HE-Tag: 1656057903-687950 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: This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/omapdrm/omap_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index eaf67b9e5f12..dff637de00a3 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -684,6 +684,7 @@ static const struct file_operations omapdriver_fops = { .poll = drm_poll, .read = drm_read, .llseek = noop_llseek, + .file_rss = drm_file_rss, }; static const struct drm_driver omap_drm_driver = { From patchwork Fri Jun 24 08:04:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894093 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 B0886CCA473 for ; Fri, 24 Jun 2022 08:05:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A33EE8E01FC; Fri, 24 Jun 2022 04:05:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 996198E01F6; Fri, 24 Jun 2022 04:05:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E5A98E01FC; Fri, 24 Jun 2022 04:05:05 -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 64E4C8E01F6 for ; Fri, 24 Jun 2022 04:05:05 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3E21E34193 for ; Fri, 24 Jun 2022 08:05:05 +0000 (UTC) X-FDA: 79612393770.31.1384B1E Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by imf24.hostedemail.com (Postfix) with ESMTP id EBAD9180034 for ; Fri, 24 Jun 2022 08:05:04 +0000 (UTC) Received: by mail-ej1-f48.google.com with SMTP id mf9so3200344ejb.0 for ; Fri, 24 Jun 2022 01:05:04 -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=zYeizJ3QsvNICXqczpSXbVJYn4Q15WJ3kWZARt06sMw=; b=J/wgCdTYLso/wR3DyIMcpoWNVTSy/cjwLHx9Q39+E1ZodWxIhAlJ61DCaVuR1rD/f1 pY38NwP9kY3Plwb6iN8EMe8/vG9qymIkGWF2JCZ+R7/X1R4EnwTmpYPULDKENIe2Fh6w FQCJsTwM3UQu3vJZESwvyK8+QhBWg7q572dTWiwHnN2NLv3ZwrQIiyW3sjqRVSC1nkgR oPerAY9zKue3qqTiHQ2r5ixckyjq8LP76+lkRLuVQapgOCZ4X7rOOw4Ml4021WrsttG3 2MNeb6ISLKoiQ0jg06LSWwnAoniobzMHdFdZQd7CD+Jp+dZlI40apQN+4mRvkiBAtwMN +2hw== 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=zYeizJ3QsvNICXqczpSXbVJYn4Q15WJ3kWZARt06sMw=; b=FHnlMmpSNtUC1U47JHTaiBQ1S9CuqwgpZ9rnXaDSIh9vd6Rc8xQen8SJyQNRNbFX/p b+Lo+NLq36yjmKlfO10SrKWasFcXLERbhF7Jj6Qj39k28+K677+AcMdbmUm6Ot69dDDE E/D/eRimt5LV7oZHOdBOT6kw3VrYa05tHZylKbHzSfoV98cxxEiMrM+V7iBsMEQZzn5I tdrnWazKatlek7xAFQaX5k8guhn+sewumnN+4l4eiIur29LPN2maIDwvQoFM3AutjjDj 5WTcgGM9uzh0Mzu8JNyGYNzFMQS/VaHrZs7JKENe4o6dIXSx7xIzDCF6EvEDjKX02oVI uRFw== X-Gm-Message-State: AJIora9Ht0FDJncvYx04Fy51upIpq3K71SjkUv1RoHeLNkWAyVETNFEX 2UkVddFFbJh7KTotG5BWG0g= X-Google-Smtp-Source: AGRyM1uXEIqId7b73deRFKUwrzmvPTkFA55neIHh4LETAN1AX61HEKuXSB8HtzpeXXBy1GfUk1mJtQ== X-Received: by 2002:a17:906:ee1:b0:70d:d293:7b30 with SMTP id x1-20020a1709060ee100b0070dd2937b30mr11782721eji.134.1656057903826; Fri, 24 Jun 2022 01:05:03 -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.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:05:03 -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, =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 13/14] drm/vmwgfx: use drm_file_rss Date: Fri, 24 Jun 2022 10:04:43 +0200 Message-Id: <20220624080444.7619-14-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-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="J/wgCdTY"; spf=pass (imf24.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057905; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zYeizJ3QsvNICXqczpSXbVJYn4Q15WJ3kWZARt06sMw=; b=atUUTnYBL8+s1fKLs5S/7UOaD3Hns/0X2jhJrq8C7fU9HG5C1KwxWeXx8AItOA0BjR700a mzpEIgJ6mMyZ7MXcbnlFZUc/vdCySbqFr6R2fhmVZSN0viSc5/uy8FCMYdhPUEe/9qE+0S ic0YCitFoS+ehNYCj7Tm8iS4MjzLTcE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057905; a=rsa-sha256; cv=none; b=c/SrWm411iTYffVpPQhTUmkfOh9zasrsTwCGkLEM9kRHpZyAzuNC+4KK2IIfMWFxWhV+x9 jYU5hyq4xs0qc3N/p7P02vqct2+Oa4ezIFgJAJlXlvye733F+k10RJHPi4KDYSpqN87i0v 3O9219jSUiPaXj/9WXycLdH02XSt/FQ= X-Stat-Signature: awfr6gymj4whfm5a1ebnd3sumqux8fdq X-Rspamd-Queue-Id: EBAD9180034 X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="J/wgCdTY"; spf=pass (imf24.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-HE-Tag: 1656057904-534651 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: This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 01a5b47e95f9..99bf405d31b9 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -1577,6 +1577,7 @@ static const struct file_operations vmwgfx_driver_fops = { #endif .llseek = noop_llseek, .get_unmapped_area = vmw_get_unmapped_area, + .file_rss = drm_file_rss, }; static const struct drm_driver driver = { From patchwork Fri Jun 24 08:04:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12894094 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 4920BC43334 for ; Fri, 24 Jun 2022 08:05:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E01BC8E01FD; Fri, 24 Jun 2022 04:05:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D64568E01F6; Fri, 24 Jun 2022 04:05:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF5188E01FD; Fri, 24 Jun 2022 04:05:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 978DB8E01F6 for ; Fri, 24 Jun 2022 04:05:06 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6D88833C7C for ; Fri, 24 Jun 2022 08:05:06 +0000 (UTC) X-FDA: 79612393812.26.1BACD61 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by imf30.hostedemail.com (Postfix) with ESMTP id 161A380035 for ; Fri, 24 Jun 2022 08:05:05 +0000 (UTC) Received: by mail-ej1-f53.google.com with SMTP id lw20so3108025ejb.4 for ; Fri, 24 Jun 2022 01:05:05 -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=EK5bTabBrzOC4s5o5qACkkoAhewHbBIhpYTiUtnXhVE=; b=JwN96QcsgT/HsX0Xpol3mA630eF5N5PgavN/AUY9qBXwAsuVmy5cd/GZroEBwxc86X ZaDki0JPCb7oEXIMUIfGTswi25k7wAP19cnFbDOv/5t9BukJv9rDcgt58DFQ74NADH2u CYXiAOkYs3SpdYAaOxY3UUVCX6ptHEJ6TRdbP7p4or3Zgu3/WAjyLLMK5jZ7vcqCp7eW EZMJA+g9/yiNDw7fyROAvFU5wIayjnD37MVXkIpRkTRGWcd7zygExPX5kLKinTCY8K/T 5pdb6n5eb6/P1j1smDPETJawXNBlVLLfjUdE34ynUZs+JMkdILaXVbWdyIS5dNH8CO+w oVxw== 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=EK5bTabBrzOC4s5o5qACkkoAhewHbBIhpYTiUtnXhVE=; b=KA76mcH1rwWjf6YRNqCK5BPSejV+57sYLpyJvt+bhXicjPDPgf0nbL8ADVirg3rNxR SCx4b0MrA+x5QngpP+oLWPMfuB1glPYAdZqm1VBcJKseOSGIVcjNnCuEIEBRDxYKFU+B EsTs+If0mVEl/I+OjcGqI5OUEXb8eE8ueDrha02rcloEvmgnlO5JmsyhirC/tJaLkTay UJdsUlRo/GPhEYSospcz6HAZoqnXL2O2ei0D2nEOu4AN+ayPLNdwQcvwpbwIhH/V5ozg QK5Ag+79mWrHUmnOoWV3jHet7vNiQUvwrfey4WKt8doxO53GYWT9RxQHCdaLM3q6FqjQ bkMA== X-Gm-Message-State: AJIora+lWZsl5OfR9jAL+N/BKTlAQkrCcUlgdmh6W1eZH7AakbBXX3BF duOZZhaElvFp5kqOBSZ7070= X-Google-Smtp-Source: AGRyM1tgbH7HQwAMplhNlcow9evBtQqHgtM4KLSWjdQaSt6HlGVy+kDMyMimMYEkA9mtx94cpAF30g== X-Received: by 2002:a17:906:7a54:b0:722:e8e3:ef60 with SMTP id i20-20020a1709067a5400b00722e8e3ef60mr11829570ejo.453.1656057904986; Fri, 24 Jun 2022 01:05:04 -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.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:05:04 -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, =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 14/14] drm/tegra: use drm_file_rss Date: Fri, 24 Jun 2022 10:04:44 +0200 Message-Id: <20220624080444.7619-15-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-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=JwN96Qcs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057906; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=EK5bTabBrzOC4s5o5qACkkoAhewHbBIhpYTiUtnXhVE=; b=Six7+jGMGrIYLPGH5zp3M54SeAtDiFhy7m5E6waIOOD2iHcYb7sVWJNhgZXyVkQDVnb4Ha yLLZVN9kLVkSSAh6rBlg92216Zl2Pv5jNuE51GavLW07IPAOQPqsgmNtiK654eoKz1MWXr R7JwLTSbfnQ+zhoupShadq5yqgolG5s= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057906; a=rsa-sha256; cv=none; b=thOvbrrEf6vzPCHX2RM6ZOX82iNZyafAGkqaDsJ43qK8bxx5dJMSqLAY2vLk4UbhAawpZZ vEXw1vGMeImFHVxLCorESpVuJYXjOV0PuhUBzyQ4KoLgSlnOxSZbO9TdzQJvEu96FJQ2Y8 unH64j3aLhxOc2TXhOO2GC3VkccoEME= X-Stat-Signature: 18y47wo6u3hotjy8jmqtgrwffx6hksgf X-Rspamd-Queue-Id: 161A380035 X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=JwN96Qcs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspamd-Server: rspam12 X-HE-Tag: 1656057905-367881 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: This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/tegra/drm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 4cdc8faf798f..cc0c2fc57250 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -804,6 +804,7 @@ static const struct file_operations tegra_drm_fops = { .read = drm_read, .compat_ioctl = drm_compat_ioctl, .llseek = noop_llseek, + .file_rss = drm_file_rss, }; static int tegra_drm_context_cleanup(int id, void *p, void *data)