From patchwork Tue May 31 09:59:55 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: 12865246 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 F1AFEC4332F for ; Tue, 31 May 2022 10:00:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 726D36B0073; Tue, 31 May 2022 06:00:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6FA846B0074; Tue, 31 May 2022 06:00:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C3E06B0075; Tue, 31 May 2022 06:00:14 -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 4DF3F6B0073 for ; Tue, 31 May 2022 06:00:14 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 1F659602C5 for ; Tue, 31 May 2022 10:00:14 +0000 (UTC) X-FDA: 79525592748.17.6E69F1E Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf27.hostedemail.com (Postfix) with ESMTP id E10F940024 for ; Tue, 31 May 2022 10:00:09 +0000 (UTC) Received: by mail-ej1-f54.google.com with SMTP id n10so25580020ejk.5 for ; Tue, 31 May 2022 03:00:13 -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=s/d7KhR0z000Hs/IA+QwE65RKZidQwaLcmmsuNIx8Rk=; b=jlmbD0lwi6rUzLqjCUjXO1DNk/hQQjjKuOHlr6e8k22ViZDgKVzUz93W5EYx10np0/ Xh2ALDpQ6yIyeIe45k8a2sJl4amrOM+41IYI/txxFcT5UiQiv8db1GOFm4nHNEit2nsT t6Lk/Ru1k3XgR2+zaythLqoBQNPWx0Sq35QwntG6y1Dagw4XSMLJoD/MgsY7xDjJfu0E RDqGAq6AuvEeKHy4q+b3C0gubIRXhKGHY2dodSyKGXyL5yGmdZeVPY58oq3Uvft0jR6c xVeACw7Idp6VxMTOsOvsq4Sy7+v2x6+Yzp3O+8Z7K9aogRlAi/UblC7icee5ruMftqkd rgVw== 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=s/d7KhR0z000Hs/IA+QwE65RKZidQwaLcmmsuNIx8Rk=; b=3bxcyTHG/CUv54zBYb5GkCuesBOBVUI2+XGHD3WxtgAO7ahBbjq61aPKMRvyv1f7j3 B1fQtohKMZDxZQfW8teSCdtLqpefsMyOVV0zMxbT2wz6pR5csN14Ek7zLtLUwnSFUt8Z qimETrdB4anH39kaFbaaRyOje9CfMCQBE1TWj9viuY6vjAJ/ERg3cEklfceFrzZZLkOX 1qk2NgB4f5u+DWPjBYP8J3Vi1Rp/FCUAuTd6j7IiWmN+pbVIv49LGdMko/jaSzo1OpHu elGAkvB8zb0jVDkEJgKLWcXcaUzgTaZQYqXwwWpahBV5p1VTv/zOwcFys6dDHj7WCTYC /NBg== X-Gm-Message-State: AOAM530dU9uH0+j5o7pgVmzq/sn5tzfFOEjFL6YmWXaU3nL9SnzVvF3j 0kB2LiLhWSvwqSup6+JVVkc= X-Google-Smtp-Source: ABdhPJyprdDlfIYDCtP3JSXlPBRA6lpUaNM/DoimNqu/NR7jJ7DMpCFACqCWHS14mUBV5Y9XUPfxDg== X-Received: by 2002:a17:907:9483:b0:6ff:b1:467a with SMTP id dm3-20020a170907948300b006ff00b1467amr31727121ejc.683.1653991211970; Tue, 31 May 2022 03:00:11 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:11 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 01/13] fs: add OOM badness callback to file_operatrations struct Date: Tue, 31 May 2022 11:59:55 +0200 Message-Id: <20220531100007.174649-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jlmbD0lw; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: E10F940024 X-Stat-Signature: uqpjepghki4fje6nwpd7ci9h3fjekc7o X-HE-Tag: 1653991209-789480 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 file_operation implementations to specify an additional badness for the OOM killer when they allocate memory on behalf of userspace. This badness is per file because file descriptor and therefor the reference to the allocated memory can migrate between processes. For easy debugging this also adds printing of the per file oom badness to fdinfo inside procfs. Signed-off-by: Andrey Grodzovsky Signed-off-by: Christian König --- fs/proc/fd.c | 4 ++++ include/linux/fs.h | 1 + 2 files changed, 5 insertions(+) diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 172c86270b31..d1905c05cb3a 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c @@ -59,6 +59,10 @@ 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->oom_badness) + seq_printf(m, "oom_badness:\t%lu\n", + file->f_op->oom_badness(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/fs.h b/include/linux/fs.h index bbde95387a23..d5222543aeb0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1995,6 +1995,7 @@ struct file_operations { struct file *file_out, loff_t pos_out, loff_t len, unsigned int remap_flags); int (*fadvise)(struct file *, loff_t, loff_t, int); + long (*oom_badness)(struct file *); } __randomize_layout; struct inode_operations { From patchwork Tue May 31 09:59:56 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: 12865247 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 4AD71C433EF for ; Tue, 31 May 2022 10:00:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58CDE6B0074; Tue, 31 May 2022 06:00:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4EDCF6B0075; Tue, 31 May 2022 06:00:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 33D376B0078; Tue, 31 May 2022 06:00:15 -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 26C386B0074 for ; Tue, 31 May 2022 06:00:15 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EC2D2355 for ; Tue, 31 May 2022 10:00:14 +0000 (UTC) X-FDA: 79525592748.09.F86ABF0 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by imf07.hostedemail.com (Postfix) with ESMTP id 610294004B for ; Tue, 31 May 2022 10:00:02 +0000 (UTC) Received: by mail-ed1-f47.google.com with SMTP id o10so411433edi.1 for ; Tue, 31 May 2022 03:00:14 -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=SljQJAeVhGKeIBI51MbYTdJihy0sRNkihcgcWrQIyMk=; b=ZBp9EWdv4dyFa/WsIYerVBV/5Czl1dSOQzB0bWaLR8VuemQ6QOm1M4R69eKpHA9nd6 c1HPF6oYuRRxZPShB/rzFxpDYr2SzpVcfmaTTI1/AsPIJMT2sPHv14VCM3Ka5VBHYXAs x+RhdpJZ93axyquUdQTI8BbhfGTHEGOHs1mum12ZFtPHB/T1dEkf20VpzDu5c8o8JJxt L5805s8can7oaGbMP04m/NeJEPnJ5J3kmnPoXDsme1EeBIo1b0t4i/Kl8NIO/OOcqJec 9FKHHAZGXXE+S9p7n7ifDG4TYZso+CBFSqXccDBgxGoDfbZX1IAhrrimZdFs69Jaqd2K a48g== 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=SljQJAeVhGKeIBI51MbYTdJihy0sRNkihcgcWrQIyMk=; b=0ZRdrCUq/CIAG4AtD+bGzioEaqi3b9wAamBsedKnj9vxgc0k0W8Zj5Sn+DRroz1Rs8 PzFS4p49kYozXL0gI8LGjBblX4LBm+cBCL/qQmoigBOkZ0mztAeUv7zdFBPP2JRX+t97 o16C5GbT1b8zyxabnYP6PSs1dvGLVFEyUZj9r6hUFnliiFCPmkoP2W7zU7o9Ec62/InF RcsVmqe5JLrbZvG2CsAJxeWldja5dfhq0UBcbIrtxgg0UIAKyCp/0GXLF26qde5oIRf/ 96owhL75voz+KApz4DbuVZnpHk9+Manqf7aGJ88zsxpnWjF7iIC4VxXSl3paBEDDTMSV DXaw== X-Gm-Message-State: AOAM5320j6TgXXvV6/2I+BLsQva7zMFSRNGX9fxhsY0QDT3PFWDtr3WU uXb3xLew61q/nzO5DU8Wrt4= X-Google-Smtp-Source: ABdhPJyZPq+OysWRAlAZamevHlLGk4fQamGD+X1EEEY6OJezkY6NR4XeOrBHuCnsv4+0HlBYkj/10Q== X-Received: by 2002:a05:6402:34d4:b0:42b:35e5:fc78 with SMTP id w20-20020a05640234d400b0042b35e5fc78mr53286582edc.372.1653991213421; Tue, 31 May 2022 03:00:13 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:13 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 02/13] oom: take per file badness into account Date: Tue, 31 May 2022 11:59:56 +0200 Message-Id: <20220531100007.174649-3-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Stat-Signature: o4pn4wf8akcqrh84hrtwy1se8k7ngscm Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZBp9EWdv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.47 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 610294004B X-HE-Tag: 1653991202-679007 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 OOM badness. For this the per file oom badness is queried from every file which supports that and divided by the number of references to that file structure. Signed-off-by: Andrey Grodzovsky --- mm/oom_kill.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 49d7df39b02d..8a4d05e9568b 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -52,6 +52,8 @@ #define CREATE_TRACE_POINTS #include +#include + int sysctl_panic_on_oom; int sysctl_oom_kill_allocating_task; int sysctl_oom_dump_tasks = 1; @@ -189,6 +191,19 @@ static bool should_dump_unreclaim_slab(void) return (global_node_page_state_pages(NR_SLAB_UNRECLAIMABLE_B) > nr_lru); } +/* Sumup how much resources are bound by files opened. */ +static int oom_file_badness(const void *points, struct file *file, unsigned n) +{ + long badness; + + if (!file->f_op->oom_badness) + return 0; + + badness = file->f_op->oom_badness(file); + *((long *)points) += DIV_ROUND_UP(badness, file_count(file)); + return 0; +} + /** * oom_badness - heuristic function to determine which candidate task to kill * @p: task struct of which task we should calculate @@ -229,6 +244,12 @@ long oom_badness(struct task_struct *p, unsigned long totalpages) */ points = get_mm_rss(p->mm) + get_mm_counter(p->mm, MM_SWAPENTS) + mm_pgtables_bytes(p->mm) / PAGE_SIZE; + + /* + * Add how much memory a task uses in opened files, e.g. device drivers. + */ + iterate_fd(p->files, 0, oom_file_badness, &points); + task_unlock(p); /* Normalize to oom_score_adj units */ From patchwork Tue May 31 09:59:57 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: 12865248 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 01006C4332F for ; Tue, 31 May 2022 10:00:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DCEEC6B0075; Tue, 31 May 2022 06:00:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D2EC86B0078; Tue, 31 May 2022 06:00:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7CD46B007B; Tue, 31 May 2022 06:00:16 -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 A8B626B0075 for ; Tue, 31 May 2022 06:00:16 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 7E57F2CC for ; Tue, 31 May 2022 10:00:16 +0000 (UTC) X-FDA: 79525592832.10.E56634F Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by imf27.hostedemail.com (Postfix) with ESMTP id 2069C4005B for ; Tue, 31 May 2022 10:00:11 +0000 (UTC) Received: by mail-ed1-f43.google.com with SMTP id v19so9456289edd.4 for ; Tue, 31 May 2022 03:00:15 -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=mIxGnBiNQH7wWhpTAOYvfGm3yBUdW2Lv8hSFkOKs0aA=; b=YDb0d+PyOKs210qCqYAFGBvUZTTS4RAIRhhK/d+QO9gshGdaDWgKspQVMQpG7nrtX+ TufVc/6A+Te4bjWf9pWyv6ntrZjNTvO1o8tYpzOoAdjIqo9Bklfzy8dXk7BYMrxpSM95 usfHUfKLh7JEKoG9wN5zLAoQm71wvfUxu+xCGMzIBHPjTBYFFRg/fQ8Bc1mbpWvV9bwY PR/pdpoW3OmlfWODJKjL9jIEkGs8hD/ZjjXmxLFGR2b/njvlb082VeR+rrGF1R55oj4p qQAdYumTKMLx79UKpj8YkktDQvBcFKlZvP9zcVhZ48lAtSdY31sMnKI1F4yE0kXKaL3w HsZw== 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=mIxGnBiNQH7wWhpTAOYvfGm3yBUdW2Lv8hSFkOKs0aA=; b=Pg3jUvEDYiXmeXhpFhJWDSmQIq8TUpOQq8wRTMSimzTWR44z/6zhFuPVTb5qLreaAo AWBZXkM3G9l4ErUTL870IE41Q3X9RfoQaK2h2oAyd8ORt2+Wmda0bU38tkp2QBuWzdPr Ele0+PhKEfHCStgkIE+rRBJOSmQGxeD1gc/5VEfjW+rJs6K2fKZe55Nb9Re0HuPJE6W6 e4aeUyMDoXyhA4D8V5fTEViuklDeqr7uO9EbAsibPJOV2OlUEiDZVXOXdNkeeKLQG1rY mwmZ8AbWAERrfMGVvIIzNMAla/XWfIfVrLJumGWBMkA033pF9kdy7XrwidaxXMJilUAN y5hQ== X-Gm-Message-State: AOAM531VeRaM69Mu4jKWspXYHvsjOPBEP/YSpw+Xfj9mlro4eBhjV77R vz76jhwTAt+k6mkV1H6BBAU= X-Google-Smtp-Source: ABdhPJym6XbAZzn9cN4OBs65hCeI931sSsPopVK1yV+b7qr9DjRRmdjRD8OGAyhyWkR+LhQlwkaGRQ== X-Received: by 2002:a50:8754:0:b0:42d:e92f:c924 with SMTP id 20-20020a508754000000b0042de92fc924mr902302edv.389.1653991214818; Tue, 31 May 2022 03:00:14 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:14 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 03/13] mm: shmem: provide oom badness for shmem files Date: Tue, 31 May 2022 11:59:57 +0200 Message-Id: <20220531100007.174649-4-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2069C4005B X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YDb0d+Py; spf=pass (imf27.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.43 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: qb3xf4g74wbxj9aidd63nw8q3cti5qfe X-Rspamd-Server: rspam05 X-HE-Tag: 1653991211-803968 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/shmem.c b/mm/shmem.c index 4b2fea33158e..a4ad92a16968 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2179,6 +2179,11 @@ unsigned long shmem_get_unmapped_area(struct file *file, return inflated_addr; } +static long shmem_oom_badness(struct file *file) +{ + return i_size_read(file_inode(file)) >> PAGE_SHIFT; +} + #ifdef CONFIG_NUMA static int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *mpol) { @@ -3780,6 +3785,7 @@ EXPORT_SYMBOL(shmem_aops); static const struct file_operations shmem_file_operations = { .mmap = shmem_mmap, .get_unmapped_area = shmem_get_unmapped_area, + .oom_badness = shmem_oom_badness, #ifdef CONFIG_TMPFS .llseek = shmem_file_llseek, .read_iter = shmem_file_read_iter, From patchwork Tue May 31 09:59:58 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: 12865249 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 BF3DCC4321E for ; Tue, 31 May 2022 10:00:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 916066B0078; Tue, 31 May 2022 06:00:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 89F2A6B007B; Tue, 31 May 2022 06:00:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 673F56B007D; Tue, 31 May 2022 06:00:18 -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 57FC56B0078 for ; Tue, 31 May 2022 06:00:18 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 26F27120300 for ; Tue, 31 May 2022 10:00:18 +0000 (UTC) X-FDA: 79525592916.19.DDC6FCE Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by imf25.hostedemail.com (Postfix) with ESMTP id 2756AA0054 for ; Tue, 31 May 2022 09:59:44 +0000 (UTC) Received: by mail-ej1-f52.google.com with SMTP id f9so25641364ejc.0 for ; Tue, 31 May 2022 03:00:17 -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=Nne0qJckA/hMuSOr0O9+SBShBUR9gCrIksc3pugIfaw=; b=O04QHlDY6DBBsKrGQS2x+dxNPUvaLGwatBhA9Ypf6fUvXeQn4u2iZyLs+G4Gopi2gn lMPnA9p2Gz45t7ICtHVl6tg1eE8albLaPc/BmmQBPg3ZJxqBikRQy57f7Gd//Yisj1mq 76jYCx/vPIdNy0UXH2etO7PDMMWd1OqeisBEgyFTI9zNlOQxBgL6irhDuYoGR91FeUzH EGqVWW4gL9+MALPxEAxgJkeLA1KAldYG/7fZPitSHzltfhEhG1K7I0p/7oGL1xaLWwU1 IWCc36zCKbmVtfqPjeE1k5dNjDQMnB1bXMwDXVEhisX6bguza7GDvQPXMaO9uEGf9zR/ OIgw== 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=Nne0qJckA/hMuSOr0O9+SBShBUR9gCrIksc3pugIfaw=; b=u+8N0jlLTohP+J5olejoO+uTfEyFfk28NBPapcmGPcVBaysYAHg58jI1SC9HuuFtrD XIrLjTyheAM7WDcMdRwlXbeH/WeYGEW/bIfeA0UTowvHWWqm6g4+TgR3UAN1gA3j5M7U I0gKau9ddroJ4HHheoS1H1nflPq8AGDfWsDxC5Nv/bOf06ptaExVEEpYUTk58HhIOx40 3YlH6cx3bixqWaPvJkuvt+QAlWdJ8mvcY6JwoovrXmhvCZwAcUoaza7Aj0p8dGOyQJyS GVMQtSdxlhyg0/6+xKLxXB6B28x5DqQlRm47TAiqHa+3tJXOMgyhvUvs6P2jVUnQqdjX 2oUg== X-Gm-Message-State: AOAM5317eaGZGXZyWIWahy8raCwYi1dT/Q7DMuJls3Rf396UFf+/N5+x Bjk4t9z2lWX0TlBB6DRlMro= X-Google-Smtp-Source: ABdhPJxmWnOcxxDaVC0tQGNbj0CSrxLQR0xy8ghD6daeqEn1NVbnq/aFqlXxIqVHd6RNxE0nHnKb2Q== X-Received: by 2002:a17:907:3f13:b0:6ff:18ad:6936 with SMTP id hq19-20020a1709073f1300b006ff18ad6936mr25394163ejc.158.1653991216188; Tue, 31 May 2022 03:00:16 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:15 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 04/13] dma-buf: provide oom badness for DMA-buf files Date: Tue, 31 May 2022 11:59:58 +0200 Message-Id: <20220531100007.174649-5-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2756AA0054 X-Stat-Signature: dpnbsr4ajak13x711ysmhcoa6mdtj3ut Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=O04QHlDY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf25.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.52 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1653991184-840979 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: For now just return the size of the DMA-buf in pages as badness in the OOM situation. That should probably be extended to be in control of the exporter in the future. Signed-off-by: Christian König --- drivers/dma-buf/dma-buf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index a2f9a1815e38..bdd4e8767cd3 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -388,6 +388,12 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file) spin_unlock(&dmabuf->name_lock); } +static long dma_buf_oom_badness(struct file *file) +{ + /* TODO: This should probably be controlled by a flag */ + 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, @@ -396,6 +402,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, + .oom_badness = dma_buf_oom_badness, }; /* From patchwork Tue May 31 09:59:59 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: 12865250 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 A1111C433EF for ; Tue, 31 May 2022 10:00:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1CF5F6B007B; Tue, 31 May 2022 06:00:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 15A736B007D; Tue, 31 May 2022 06:00:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC07F6B007E; Tue, 31 May 2022 06:00:18 -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 D331B6B007B for ; Tue, 31 May 2022 06:00:18 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9E13534B79 for ; Tue, 31 May 2022 10:00:18 +0000 (UTC) X-FDA: 79525592916.19.20F4A70 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by imf13.hostedemail.com (Postfix) with ESMTP id C46CE20012 for ; Tue, 31 May 2022 09:59:45 +0000 (UTC) Received: by mail-ej1-f45.google.com with SMTP id wh22so25593039ejb.7 for ; Tue, 31 May 2022 03:00:17 -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=TNC+q1HYAjRPp62MTH/zi2loKTLmxRGj7rz2onfHvYc=; b=GBXq9vHHCJxrvvL36ccyiGaBUxAA4gOuuAE6JJqw7rKR68K9hwr5XNyqXOEIIT7vcs b+n0Pi155O7ZJ3hNSKyRz9mXIkUEKm2lcFNblLxTflNcxgkeUjq/QrKdI4HYMHPMzWAq SVmk2ARrocIRZTeQ2RslzCLdsKehpXg+Kq0kTeKoNXvG6sD16XOQ01MvqTpq1vkjhPtq +sWJbuWYYHK+e5WSj+SIwpEX66Y+xGwye9J3sHcOAM1TU5DbXJA7e3WOh4GWP04ovYuJ BVp7Cx+40rXPVhuLagJwI31hssTpBLyHz/XRKyjdzt8EQGLbOfMOhG6RJdTATBNFmuK2 0Y5A== 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=TNC+q1HYAjRPp62MTH/zi2loKTLmxRGj7rz2onfHvYc=; b=aL7DxanRsVfHU/ZQmeK+dAD3akvdUj6xq78umdaZeUQy0BgHZxTJdLw3+fVhIyOyIy Z4VXq2CPoeq3QsxYC9hKfAO82CVj3z5DkbuRI/okPPHjOW0zAtFFPd8nMmfGQeXlZoTG tQbIKOajsVbfakpcCRoO6/9AQ7wvzb+o81/cm+bMYEH22Bfh6q7sx522+Tu/PpzTWwJs Aa0CkhpSDJw0UAbyreAxfQDWiInc476OtHNtgEHn3pLBJlKgPqYRVlamV/Q2DkvPW+j3 tL2D8DKhmJY4QytEaToa9yxQTwXpBOW+uU9pipNbXl9JOM5Mkyjyvk8/nw701G9bU7Po Whjg== X-Gm-Message-State: AOAM531ROeULfUyY0BLw/DN40fGKjbRUsjef12T/2i356ZdFPJ04eZ3A de37s4vi8XqW46Pcb2gGgPU= X-Google-Smtp-Source: ABdhPJw0gyeFnw57oxp0sq6bqgANIsrzObxRClwQk6Sv+DHCrMObVZ1M7XOYXmXPr5CJvAsoBP5qig== X-Received: by 2002:a17:907:1b03:b0:6ff:78d4:c140 with SMTP id mp3-20020a1709071b0300b006ff78d4c140mr8861505ejc.554.1653991217575; Tue, 31 May 2022 03:00:17 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:17 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 05/13] drm/gem: adjust per file OOM badness on handling buffers Date: Tue, 31 May 2022 11:59:59 +0200 Message-Id: <20220531100007.174649-6-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C46CE20012 X-Stat-Signature: x8c3xwknhdswy54pen5if67nc87ib4mq Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GBXq9vHH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.45 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-HE-Tag: 1653991185-785641 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 | 19 +++++++++++++++++++ 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, 35 insertions(+) diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index ed25168619fc..1959a5b7029e 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -1049,3 +1049,22 @@ unsigned long drm_get_unmapped_area(struct file *file, #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ EXPORT_SYMBOL_GPL(drm_get_unmapped_area); #endif /* CONFIG_MMU */ + + +/** + * drm_oom_badness() - get oom badness for struct drm_file + * @f: struct drm_file to get the badness from + * + * Return how many pages are allocated for this client. + */ +long drm_oom_badness(struct file *f) +{ + + struct drm_file *file_priv = f->private_data; + + if (file_priv) + return atomic_long_read(&file_priv->f_oom_badness); + + return 0; +} +EXPORT_SYMBOL(drm_oom_badness); diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index eb0c2d041f13..768b28b198cd 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_oom_badness); 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_oom_badness); + 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_oom_badness); return 0; err_revoke: diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index e0a73a1e2df7..5926766d79f0 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_oom_badness: + * + * How many pages are allocated through this driver connection. + */ + atomic_long_t f_oom_badness; }; /** @@ -430,4 +437,6 @@ unsigned long drm_get_unmapped_area(struct file *file, #endif /* CONFIG_MMU */ +long drm_oom_badness(struct file *f); + #endif /* _DRM_FILE_H_ */ diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 9d7c61a122dc..0adf8c2f62e8 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,\ + .oom_badness = drm_oom_badness,\ } 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..455ce1aa6d2c 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,\ + .oom_badness = drm_oom_badness,\ DRM_GEM_CMA_UNMAPPED_AREA_FOPS \ } From patchwork Tue May 31 10:00:00 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: 12865251 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 589B2C433F5 for ; Tue, 31 May 2022 10:00:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 60D666B007D; Tue, 31 May 2022 06:00:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 596DD6B007E; Tue, 31 May 2022 06:00:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A6EF6B0080; Tue, 31 May 2022 06:00:20 -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 166346B007D for ; Tue, 31 May 2022 06:00:20 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E5C7234AD6 for ; Tue, 31 May 2022 10:00:19 +0000 (UTC) X-FDA: 79525592958.08.22B0111 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by imf07.hostedemail.com (Postfix) with ESMTP id 3D12540035 for ; Tue, 31 May 2022 10:00:07 +0000 (UTC) Received: by mail-ed1-f47.google.com with SMTP id o10so411433edi.1 for ; Tue, 31 May 2022 03:00:19 -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=z7tQVrAvhtwsiyqp5g4EfVxGXeEppLEfrV1ntrEYWJE=; b=Xh9vdv7Md1Jc0nNaz/QEZs5wsG3AfJ2/jRFF8rTAcPZ6QG7f0rxiqBLYOf13+3PUe5 DS/CL5kAFDHB7/bv8EYLoIYIYA3Cx4+ppq4UyjhqSGPcSsG+p4nVI7VGhcdno4MC08p8 XVfyNLF1mWExyyS8ZBwIS6tDDHVn9frsIcma0mUCQvKpUlAle8k82hD4G+7Sd4WdVmlz 3Cwt+4X8TIMztGZf/ISlFleQ6/rglSf1VgibZ0Ewo75ycww+oCt0RuyECJkUJZ9D3opK u/Qh77+csPwSloqfrGgfn1EfcZpOm7AfMN65GulQjeG/U1vHukfs/GzY6+Kbrf4gD0d7 2ncA== 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=z7tQVrAvhtwsiyqp5g4EfVxGXeEppLEfrV1ntrEYWJE=; b=7f0owilChZ2/mZchYuupYkTBy3QNrxK5Cbi8TBAoZulnp0AGHnTyWzzLEwCBw73ZcN 8fsoVYXBOO5X3Wk3AcPmdX5ydcIC/3QT9wGAzwfDy0/NYdFXqONH+loGo+4SceqOSf/l 9dlL+v6wsj+rfNLuXtWkyxxnkhkDrh5S5kkrLpTjC6jcoBEmkFcs8NMRCUAsg9AHpue3 MO3cRZ65g8wutHexV8UEuR+2aZsjiE0f2e0VxdzX1brMSqeU7SOrc3/whFlJ+AtM/Z5a 1Tduoyg7M8pAaZm4MPmdwmkczSBU/QHPp5JPCjH6Eu6mPOyCgf71uOqnRCV2uK9mWzGJ fsRQ== X-Gm-Message-State: AOAM533bfsBgSRm7J0LYL/lMoIXZ91E+C/uznGkNYq1btIgF0wFxdyzX xSojYRthWjtfs3ovNX+XIyY= X-Google-Smtp-Source: ABdhPJwU+/41hzABOSPHIeWy2MYGjljgCs1L+eRQW55IH1wpboag3ARspMl2JoO5SvKoTgZp0xZVQw== X-Received: by 2002:aa7:cdd2:0:b0:42b:aeb2:bc99 with SMTP id h18-20020aa7cdd2000000b0042baeb2bc99mr34074044edw.382.1653991218991; Tue, 31 May 2022 03:00:18 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:18 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 06/13] drm/gma500: use drm_oom_badness Date: Tue, 31 May 2022 12:00:00 +0200 Message-Id: <20220531100007.174649-7-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Stat-Signature: 91qpqygzmg4imbio3hmwi7kqtnhy7nat Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Xh9vdv7M; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.47 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3D12540035 X-HE-Tag: 1653991207-857549 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..d5ab4e081b53 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, + .oom_badness = drm_oom_badness, }; static const struct drm_driver driver = { From patchwork Tue May 31 10:00:01 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: 12865252 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 DAAFFC43217 for ; Tue, 31 May 2022 10:00:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9537A6B007E; Tue, 31 May 2022 06:00:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 68C606B0080; Tue, 31 May 2022 06:00:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 552156B0081; Tue, 31 May 2022 06:00:22 -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 46E0A6B007E for ; Tue, 31 May 2022 06:00:22 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 2063A60308 for ; Tue, 31 May 2022 10:00:22 +0000 (UTC) X-FDA: 79525593084.30.8DBC835 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by imf02.hostedemail.com (Postfix) with ESMTP id CADDC80061 for ; Tue, 31 May 2022 10:00:16 +0000 (UTC) Received: by mail-ej1-f53.google.com with SMTP id l19so7699039ejr.8 for ; Tue, 31 May 2022 03:00:21 -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=RT3RFL0VBSkluM1f3vm/WSgrGA2Qjw/08Ja0Fnc8nAM=; b=pn14iMQ9n0FDWwmArA4Jf35k//oaml9s3mxFl2ky/DMcmh2eS5QQUAfVDrFOHrWe0F KMtAdL2ItYXoMBH38/cM7Y5adUTzh6hcJoR+bDw3M9kaX7/WIFSLDyC89uegMORBvy8a BHKTy4vuZTReGoejbiTSY6UKILNxobjAL1xvmGcoXh1D/U10MyxWoiEN1o6YdrZUfevt sj80RQonfCLZAawaQ34qBTRrlatRa3mUKNi0wDk1pC3/0cWVa8FNjNAuvChUXdFusk2T xG3+L8wayhRfjE/jFGd2K1s01WQzFRlhAG5nSv/aQI6SJBaKFuP7a15DEZJ3u2J3fVab 1s1A== 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=RT3RFL0VBSkluM1f3vm/WSgrGA2Qjw/08Ja0Fnc8nAM=; b=CzYpo3aerKPGHG38irdjEJz6e5hTakS7gxKJOHOSNSJIRy28tEjaq7oW0aYkyOEANg Xj0Yg8q53I0QzryvCkDtv6qv5x0mB4ZZcGSqbs4mEvR2mZyQBYXuMBQQUKR0NezoqOlv LNSDahThmXMRI3+5Rz0RSHT6xhxw31KH3kXdMIXTLdtmRMDPo4LNpNMTBhm/PbhLgjKC XOcY1ibma/K4yxK8iPqTrklZ6m6EOlXoO6kxdFi7aL6dPkTLhuNo8OCWilGFUKz5ntmT C+Ww1kBnF49Da/tDelmE7eYDCwsmU8jWGbEAiTr0EbRGCVxDFsQ2+6YPXIzG5FRrWu8h BIIg== X-Gm-Message-State: AOAM5312y0lPZ1Ht9rPToZ0N5suS0+yCBEqAJtVS5ChzzykJkmoJKRlM FprcyBTG3BOQpet0w7ryfsMbSgCYpJhG5Q== X-Google-Smtp-Source: ABdhPJw2HPaoRajF+IeqkgNAoVDs/MgxP3po1idYa4R4fWsq47S5BbJXHf6FD6GIdoI/D1SZlKNRiA== X-Received: by 2002:a17:907:2cc4:b0:6fe:2100:de21 with SMTP id hg4-20020a1709072cc400b006fe2100de21mr52095547ejc.462.1653991220342; Tue, 31 May 2022 03:00:20 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:19 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 07/13] drm/amdgpu: Use drm_oom_badness for amdgpu Date: Tue, 31 May 2022 12:00:01 +0200 Message-Id: <20220531100007.174649-8-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: CADDC80061 X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=pn14iMQ9; spf=pass (imf02.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: oa44eye1qbmttkrduqnggb8mseubtzaz X-Rspamd-Server: rspam05 X-HE-Tag: 1653991216-457064 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 ebd37fb19cdb..9d6e57c93d3e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2651,8 +2651,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 + .oom_badness = drm_oom_badness, }; int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv) From patchwork Tue May 31 10:00:02 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: 12865253 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 171AAC41535 for ; Tue, 31 May 2022 10:00:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D17EE6B0080; Tue, 31 May 2022 06:00:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC7C36B0081; Tue, 31 May 2022 06:00:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEECE6B0082; Tue, 31 May 2022 06:00:23 -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 891AB6B0080 for ; Tue, 31 May 2022 06:00:23 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4EBCA33F17 for ; Tue, 31 May 2022 10:00:23 +0000 (UTC) X-FDA: 79525593126.06.6F316BB Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by imf24.hostedemail.com (Postfix) with ESMTP id 1CE5F18004F for ; Tue, 31 May 2022 10:00:07 +0000 (UTC) Received: by mail-ej1-f47.google.com with SMTP id jx22so25472627ejb.12 for ; Tue, 31 May 2022 03:00:22 -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=0fF+SmUCgmGBHMWIupVoHZia80K1ptfL7PQV1qLHe5E=; b=pGad9b/BwcaioFOjylZCfm5P6oSeZF3Qa2xsSM2t1mLTeOulJ6Fk7o/kQXSFGfU7lJ fp+6f/aeJYjHr4ThwoNMeFWvRYk8Xi3t4V6MuHjD4pXyJ85cRklWkQW6ame4vh7fx+mt eaMJgziirhMF0TIu3swNi0t8QcgG/D+TrXhYN/6zpOjgadE1pDN936EPEKG/3T0VKKBY eGDD/HmuCJdKW697mwOSCL+AIzK1PpEsB7W8mV3UO/gZVPIZSxHIDtHAeMFs64m0dwsi kXbIgj/gmD2mW2jfFnmLmUvUEs8rVjrgUuJi5qMnGsABI9in6Ar4JrgyhpFWFSv1YPAZ psrA== 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=0fF+SmUCgmGBHMWIupVoHZia80K1ptfL7PQV1qLHe5E=; b=cNgj9/+7OHJrQT3mR9QjybeE31vCfgkWciXUC3xiX/GEBAYDYE8FSQ8X+Pjc7OrHQt bB1H0+txrjnAZPTqJr/f4b/HNzyjl8YXhMuDsPSO2JcV0AkdIlFDuiAFTEQUde7Wxvy6 i/+KJk7AA8gFA8Jx9hq4dcUCoRkU3kUKDF0GS5gmjC2GG2IKaH4jEPjYD2lOq6xQ3gXP lJayV2DsjpZ5AGdeXyG2r/5UEOXTfdJS/kKustEe2SRgCP9TBdtVquST4+c7JPTedgqG YnWZX3JNieyA06a9TdjixELoLmtSdprdgvgVJIx/HgGZjUfbGi7LjO5IyjRv3aXqEdnt 813A== X-Gm-Message-State: AOAM5329AYGTYvzy6rOm2DAWTeD5ohMJUUqcvqTerFxLEkVRuUo7L7Ez YQludUKzPRwSRnLY5DfUA3U= X-Google-Smtp-Source: ABdhPJzxN/Ir8FJD89b6qow8Ub7cZ5+SzEkXV/zrFCVZFTH37oV1HNV4o+OUoqVfB6+SbpZEADHJkg== X-Received: by 2002:a17:907:9482:b0:6f5:171d:f7f5 with SMTP id dm2-20020a170907948200b006f5171df7f5mr53043726ejc.68.1653991221803; Tue, 31 May 2022 03:00:21 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:21 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 08/13] drm/radeon: use drm_oom_badness Date: Tue, 31 May 2022 12:00:02 +0200 Message-Id: <20220531100007.174649-9-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="pGad9b/B"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.47 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 1CE5F18004F X-Stat-Signature: dpgunnynbeti6wmok6ndmk86tj75xyj6 X-HE-Tag: 1653991207-112290 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..7e7308c096d8 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 + .oom_badness = drm_oom_badness, }; static const struct drm_ioctl_desc radeon_ioctls_kms[] = { From patchwork Tue May 31 10:00:03 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: 12865254 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 C061EC43217 for ; Tue, 31 May 2022 10:00:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 55BDA6B0081; Tue, 31 May 2022 06:00:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 50B676B0082; Tue, 31 May 2022 06:00:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 384366B0083; Tue, 31 May 2022 06:00:24 -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 241A86B0081 for ; Tue, 31 May 2022 06:00:24 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0571E60475 for ; Tue, 31 May 2022 10:00:24 +0000 (UTC) X-FDA: 79525593168.27.E907E5F Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by imf13.hostedemail.com (Postfix) with ESMTP id 491182005E for ; Tue, 31 May 2022 09:59:51 +0000 (UTC) Received: by mail-ej1-f45.google.com with SMTP id wh22so25593039ejb.7 for ; Tue, 31 May 2022 03:00:23 -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=SAtySkLvcNUXzz7ib9IziiicjVedfmYHvbHXwfWUJSo=; b=ezNoQAUxlApzRSlxG4JiS/YCWxGANQEMBMCQgATxnhP3gp3+ZMVr411g/URtHp2KFA f2ChR3RFwngrCVs7MCiQWoekB8YkFKK+caOAEKNtMtGAJPRZLUJ7j2c00h0X9TNtL0T+ aHJui7m2EbzQadDD+FbLWipH1ktNgQpHm6lf1sj28ZZvD/1iiXkps8ipinLAy0O42RLY zTTegaIaDQYL53vJKk+O5RhcAs4qMBsDl6YHcQkYjXJTY1EOfzlpFLZZ/uwgiQXHKYDy rZAwphV2HGF7mwKPv8gVMLQ03jkfQzE4TopEkv5xWw0C5eXfVpfmNZ6CvesBT9o5ZvqD ltxg== 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=SAtySkLvcNUXzz7ib9IziiicjVedfmYHvbHXwfWUJSo=; b=b7QpcX9gl0o+yg7lz2boHg0xhSfjcIlpEEm0z4LvpMYPs5pva5VrrnZPNdAsc55JDo ujNtT+g/04VMlrPoXLjaIu2nAGJPoNUx5Z3n+DmodR23xN37mHemSbVuT0PCff6umM69 byDE159doiLwD7Zu6PDacNrtPn5YI5bcaSYWZHa+mSX0e3fO3gobvYh3YKw8ElNaWHjE 3odXHLjxVETtsdVZUMkFbmfA9as2Ex+2M9oH3Q6cybhQxyPlhkXo6dsURrIXOy5QF+30 d+p17oK8lC5P+1euj1w4Q/kJ/gpWbyYVWEiGFOfu9CD6qVTiA9ZsxyF90dz9+N8M+lw3 dUIQ== X-Gm-Message-State: AOAM5326xDDdFr1wWE7xbUP6cWjtCAP7FIeyEiq4v6GOpOt4Gl+u/iMA gA0Mi60IvNKKnSbAci0kos8= X-Google-Smtp-Source: ABdhPJxwBRRiOzRIc4wcP7bPQevp2uh1nTKIEri7IbT6+yRjL76vQVcRcKWHOXi4dB6U6w/w9RxFJg== X-Received: by 2002:a17:906:974e:b0:6f5:2d44:7e3c with SMTP id o14-20020a170906974e00b006f52d447e3cmr51605009ejy.167.1653991223194; Tue, 31 May 2022 03:00:23 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:22 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 09/13] drm/i915: use drm_oom_badness Date: Tue, 31 May 2022 12:00:03 +0200 Message-Id: <20220531100007.174649-10-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 491182005E X-Stat-Signature: yh14crc6d5fiwkj6b6hwby6fi8f5e4wm Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ezNoQAUx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.218.45 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-HE-Tag: 1653991191-508219 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 3ffb617d75c9..f9676a5b8aeb 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -1748,6 +1748,7 @@ static const struct file_operations i915_driver_fops = { #ifdef CONFIG_PROC_FS .show_fdinfo = i915_drm_client_fdinfo, #endif + .oom_badness = drm_oom_badness, }; static int From patchwork Tue May 31 10:00:04 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: 12865255 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 87A3FC433F5 for ; Tue, 31 May 2022 10:00:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 93FDC6B0082; Tue, 31 May 2022 06:00:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 89EB66B0083; Tue, 31 May 2022 06:00:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A0DA6B0085; Tue, 31 May 2022 06:00:26 -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 4D7926B0082 for ; Tue, 31 May 2022 06:00:26 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 29C5934B69 for ; Tue, 31 May 2022 10:00:26 +0000 (UTC) X-FDA: 79525593252.21.CF3C3A1 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf22.hostedemail.com (Postfix) with ESMTP id 67B60C0066 for ; Tue, 31 May 2022 10:00:22 +0000 (UTC) Received: by mail-ed1-f44.google.com with SMTP id h19so8692214edj.0 for ; Tue, 31 May 2022 03:00:25 -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=CBtdyMzsAJ1/aOexJ9rl7ZeO2ErFHAD5HxTQN3Dqn3Q=; b=clhRBft+k4X+UmpE7If794qBfOtGFA7pbEByZ2pinyy2YRsA2O6lLDOynJMSIVJoFM Wvro65LH9mtebwNBzBwhrtxkvox46+r6wwZH4eYd+mYlM8gfp2s7dxCrtouRZ2HvQ9rb 5qqKVWSj4jEdYbd8S6LPV6K7PJCG4fHMCcDZkvLBlGNukalvsGNQKBVKwFWP7x+ZUNc0 mZXiAkmse4krF81HSAGDete8t78Ll4SG7G5gaBi9gesUSTbQOYIe2O3LdV31q8XNetNL YzKH8enFbBx54aGHmjR5bRjrnOqioVrO6oNE62MwqlFCmvCaYYCBPM8DqoQ36EIiOpxJ EWLw== 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=CBtdyMzsAJ1/aOexJ9rl7ZeO2ErFHAD5HxTQN3Dqn3Q=; b=20t9EfllHge85v69hGypGoTTCGSaSujLhbDI29Fh9QplqBJJmq8fh7Tfjei2bY/aOK u1xvqgFN5Qi3s5amnYIfNFtZcOqAWkUliQj4vKobD2hBo01zrKjiWohPzlF4yyuXNdwy l2MBC8/tBUrpaaSgHQZMd1DjDZxivlxH3w5aMg7XGPsY6WA5R3N3VkLg/XcQAvWdr6Yh tMj1Yb2l9EXhsh3Mqi1h2/cHfNUkrM8jKFLFBHFUKHbrP/lCyUHhLkTD/TB70nk81Iw2 Ae2oDBdLSBrcRwGz+jaOlW/DqXKD0z9WdybjXYPyegCiKQ+i+WnFgkpkWTvS+rpq04GE 2eIw== X-Gm-Message-State: AOAM530sARpWGh5zzXLvOdHCfEqHTQ6Q2jdUp00Cqh/1ThxFp5XvPATx AR8h4f1xVSaPasEtW9uD8iqhv66mKRSBwg== X-Google-Smtp-Source: ABdhPJw42FrkjYM4LnR278q9mfBravYOk4Zj2lNKJYJUZ/HCUi9Q4cA6PZiVhbQJK68MTRAAzi0sdA== X-Received: by 2002:aa7:d285:0:b0:42d:ca4f:a046 with SMTP id w5-20020aa7d285000000b0042dca4fa046mr13232089edq.354.1653991224557; Tue, 31 May 2022 03:00:24 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:24 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 10/13] drm/nouveau: use drm_oom_badness Date: Tue, 31 May 2022 12:00:04 +0200 Message-Id: <20220531100007.174649-11-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 67B60C0066 X-Stat-Signature: ih6a41b3tpizet4od93nbdn9nz63679f Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=clhRBft+; spf=pass (imf22.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.44 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam09 X-HE-Tag: 1653991222-727708 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..5439b6938455 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, + .oom_badness = drm_oom_badness, }; static struct drm_driver From patchwork Tue May 31 10:00:05 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: 12865256 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 8C37BC433F5 for ; Tue, 31 May 2022 10:00:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 174CF6B0083; Tue, 31 May 2022 06:00:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0FED96B0085; Tue, 31 May 2022 06:00:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3D2A6B0087; Tue, 31 May 2022 06:00:27 -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 CCC9C6B0083 for ; Tue, 31 May 2022 06:00:27 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id AD03F33EDA for ; Tue, 31 May 2022 10:00:27 +0000 (UTC) X-FDA: 79525593294.30.12C3B1E Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by imf29.hostedemail.com (Postfix) with ESMTP id 647C812005D for ; Tue, 31 May 2022 10:00:14 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id b8so8823984edf.11 for ; Tue, 31 May 2022 03:00:26 -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=JruBtp3H6AJykO9OR/eL1GiHC7q7udWmPGM/sruwocU=; b=gblxCfTt5pOw7A9YHZEJV+r2VG2ChUPoOQENqtkp2cD9u6jNXJgjxv2GFFFMsM/j1v Q2bAWtuYoHVtOWqHe7hjKmrV3TsMB+pNFCxXxg98Hxoy145vOkyrtRBbQ1b4zZpA+A1+ m3vrIpLanU3qXFTpv1WHgWerwCM08gLxzMyuLrfLY2BLdTpWmtpZZCIA8VnGVxQPJSGw xqv5Ii2BDXG3LKm7eR73P/dCNDyy1at1PARvuyUQJ4QUTBg+DKyDnVUw6Iop+kGwRAzR hJvsA8R/+LW94eBMAMh3wccqPVIx8QKXEc5XbXbso3UNdF0HbknOCrBEyS28rXYGBpJ4 wTKQ== 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=JruBtp3H6AJykO9OR/eL1GiHC7q7udWmPGM/sruwocU=; b=PW/k0k7DbrvNIUuk7YFSCGVgygkE/HBlXkEjSLEiO6kMHSU/YvXHWVU0rLebAA8Eum FCWPuFYnBADLhTH9FaYRr0BwpNp6v8G3EpSunQgpn9yVcrGRPziWuvn6Hq6JlHCDRgMy z/FMyomxlYHlsZRDlmi5bM7hu3o7XZh0etRwdDrWhwyaFgDEnCoy4BePsL9/HHSkZOfQ msIfblnWx7sF6jcn0q5Rsu/ZIsCphzz3ffYdDmoOaPWn88RDMynNbDtIi+weayWiu67k ep8pGJz07gZOHdhodeorturQ1sQ+JWlu5LOpHwo3Ut4CHDDa2UBBKAHkADi9uyM8NDPS MRLQ== X-Gm-Message-State: AOAM5330Usmq25DdRr4f2LbcgTp2sOrkOLKGW3ZKEQhuGtn+KgFc/ffU kfRQOncBjadn5t1YSP63+PY= X-Google-Smtp-Source: ABdhPJxrLNkOBCK22JKPARmcl5BjmY6TUTpFvEk9uA+1n3mHpJJ9+WrPqf1O6PJKP4JfkZxzMsKPKw== X-Received: by 2002:a05:6402:350b:b0:42d:d565:a62a with SMTP id b11-20020a056402350b00b0042dd565a62amr7607557edd.172.1653991225974; Tue, 31 May 2022 03:00:25 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:25 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 11/13] drm/omap: use drm_oom_badness Date: Tue, 31 May 2022 12:00:05 +0200 Message-Id: <20220531100007.174649-12-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Stat-Signature: 4wx59uxgjwmq6uebsnsqs93zk71sp9p7 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=gblxCfTt; dmarc=pass (policy=none) header.from=gmail.com; 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 X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 647C812005D X-HE-Tag: 1653991214-401306 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..ca2c484f48ca 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, + .oom_badness = drm_oom_badness, }; static const struct drm_driver omap_drm_driver = { From patchwork Tue May 31 10:00:06 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: 12865257 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 3970CC4167B for ; Tue, 31 May 2022 10:00:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D6FA6B0085; Tue, 31 May 2022 06:00:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5876A6B0087; Tue, 31 May 2022 06:00:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 401876B0088; Tue, 31 May 2022 06:00:29 -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 2852A6B0085 for ; Tue, 31 May 2022 06:00:29 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id DABC81202EE for ; Tue, 31 May 2022 10:00:28 +0000 (UTC) X-FDA: 79525593336.31.52E89BD Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by imf23.hostedemail.com (Postfix) with ESMTP id B5E2914000E for ; Tue, 31 May 2022 10:00:03 +0000 (UTC) Received: by mail-ed1-f50.google.com with SMTP id h11so16771335eda.8 for ; Tue, 31 May 2022 03:00:28 -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=NiGv7XqpyS2XED0WdTZJaaW3qxD3EEwJnBgFNlUBlKA=; b=aUB5B9Qt8tVriEh42JHF6p0XPngykorf81VEvkU+jbQb7CSF/l+p5bKKOyZ20uEgsA E43T85l2RNnZ7ArvqSkvuaTiD93Z/Q+CcF5nsxGUHtbZPnk25OSTrL4t5vJROge1iv08 D43ebZ6vcKHFJLX+daUhnhKonDnOhJN9wbzFrqgWFfIh7GjGBXxWi48JT9I+x8K6ogvq Gyvusf+zhEL6Gk09/w34fLwp6G9rdW/r/FFrInAhnujV6+INA3rKvI4kTTFmibLu1J5X yfuU2boXQuUY1zqYSg/AQttssmci0RltzIdFgKtVRPa9qApgcGl9lqhFBcWEyD7XIwTB xPcg== 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=NiGv7XqpyS2XED0WdTZJaaW3qxD3EEwJnBgFNlUBlKA=; b=GH/Z4UJ+ZcgggHNVWPlIBmeEzCHOsd/lg4EV9qziLhhq0DG+etDmIguPnu7ehXNOTV N7jpsyBz4QDSDOjFdgaeQVm7rUvAzzzbHlsZoFkldI0uwT0PS+EqPN5Jm72sBiT46UX8 6m4mMm4Ei0qXSideVRyLtELwPsGxfxs9xS54bPPCwgB/37ChjHvKYjV6u268SHoobBBP SMXPjd2DHQsZNakjsphR2mycwkYsrSSXymGOC0VGoiY5gIesZNmcZPrq+03EWH9QCUFr m95GW9dEsVO9E3JaKjDCpWLdPDt2HSXEfJFRukKgQK3JyEtF4CLnE3okVk7x3fxNbJhy I2+g== X-Gm-Message-State: AOAM533rfuS8yZZAP3RNwyDQFN+XHUYGdrdy1SV688AK5HijSkndsQBv an3NjUDuSfMt4oyiEvyZE91eJTSsCqFotg== X-Google-Smtp-Source: ABdhPJxaefghKbMHCtIN9ZsUiLrQ9JGsM6ui0kyhG9BoMRuUMSSLwMZQJupGKdHga/0PvqPhhZrEmQ== X-Received: by 2002:a05:6402:90d:b0:428:c1ad:1e74 with SMTP id g13-20020a056402090d00b00428c1ad1e74mr63021246edz.345.1653991227420; Tue, 31 May 2022 03:00:27 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:27 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 12/13] drm/vmwgfx: use drm_oom_badness Date: Tue, 31 May 2022 12:00:06 +0200 Message-Id: <20220531100007.174649-13-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: B5E2914000E X-Stat-Signature: 5owdsf4tk7w3yfruxmtamjknb91k1fbr X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=aUB5B9Qt; spf=pass (imf23.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1653991203-77770 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..e447e8ae29be 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, + .oom_badness = drm_oom_badness, }; static const struct drm_driver driver = { From patchwork Tue May 31 10:00:07 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: 12865258 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 A4BF1C38A02 for ; Tue, 31 May 2022 10:00:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 359BC6B0087; Tue, 31 May 2022 06:00:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E24A6B0088; Tue, 31 May 2022 06:00:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 157EB6B0089; Tue, 31 May 2022 06:00:30 -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 03BA96B0087 for ; Tue, 31 May 2022 06:00:30 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C8C6A60422 for ; Tue, 31 May 2022 10:00:29 +0000 (UTC) X-FDA: 79525593378.20.7440CD0 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by imf29.hostedemail.com (Postfix) with ESMTP id 8266B120061 for ; Tue, 31 May 2022 10:00:16 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id b8so8823984edf.11 for ; Tue, 31 May 2022 03:00:29 -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=dox2mMkLl/5c9D2gga469zGN9zQ+j614KEWkuEZ4MV4=; b=TtHtny7NdbtnaKMNgHxxZ1P6YiZMqlmrfAD504KQpkpUdOed8kz6s4qe73Oso8t6aL GH45XnJdlS9fPbcsu06cjzlIDPfSLe4vdmLZk7L0colYmkysDdcFQUfaXrpgfhWM8Uu9 mwNsso9fA2grp70nK3W+gfRLzK4em/GxgeHMyOxZAQwF2uHJZHUlKeoWDTsO9Pf3mIoR +MU2pw1Hj93sIubQtkBk95FwjgyvioAIuxLDOXetbKFAI5WclUufvdU4gR+xUVC90tO0 kjPZ8sljqOzsGufGGBR2iVo/n5ohkrTAeCPS+lQRYxTn5nYYxcG4Bmjfy2K5n7PsifJS ohDA== 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=dox2mMkLl/5c9D2gga469zGN9zQ+j614KEWkuEZ4MV4=; b=7g7E5xjQ6IqcVwEDFLv3FzEZW7RPC29DHjzC3brU5r4z6r0kgXLvjFp+3+Y+sMXFfd 6fbLNVJGz+tisSgWTaN6/Jx1QvqbNm5OhClufq9B43XaID3NYTbssFRECaBx7iSb2ad0 BiagrnFIX99GxlagVa4CFJZmi4Tgh0atlNoox2fe3+N89jncmw4ErvNgyE7FFrIDbR4a c2WRWaFne2FvmyUgd2xmuGG3q732pRyNnYoQrVj2BqHUIHvB2rWyEMM0F0zl4Z8a0dol 7N5Wc0usR5xABsc9Q8P02tot3cg9JsoUVqgIPiCXSbOntb3MYX2AVy67v7Q7a1wf5UM5 KfSA== X-Gm-Message-State: AOAM530SYhnneaZSVdKDE5QtkLfk93sgbrKkBLfzMAyWNSzPao2CE2ej pUWXksrNgtbqyx5OazEvZMs= X-Google-Smtp-Source: ABdhPJwaDMI96aKfbI0lqqtNolmvi5yHB6A4EjRXIsAbd+0AZ25rrn/qiMxaKibl1aGvqzYNEfcjIQ== X-Received: by 2002:aa7:db02:0:b0:42d:c3ba:9c86 with SMTP id t2-20020aa7db02000000b0042dc3ba9c86mr14927377eds.337.1653991228918; Tue, 31 May 2022 03:00:28 -0700 (PDT) Received: from able.fritz.box (p5b0ea02f.dip0.t-ipconnect.de. [91.14.160.47]) by smtp.gmail.com with ESMTPSA id r13-20020a056402018d00b0042617ba6389sm582062edv.19.2022.05.31.03.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 03:00:28 -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 Cc: christian.koenig@amd.com, alexander.deucher@amd.com, daniel@ffwll.ch, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, hughd@google.com, andrey.grodzovsky@amd.com Subject: [PATCH 13/13] drm/tegra: use drm_oom_badness Date: Tue, 31 May 2022 12:00:07 +0200 Message-Id: <20220531100007.174649-14-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531100007.174649-1-christian.koenig@amd.com> References: <20220531100007.174649-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Stat-Signature: tfxnquuah7k8rqfij19idtu7uaxz77ah Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TtHtny7N; dmarc=pass (policy=none) header.from=gmail.com; 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 X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 8266B120061 X-HE-Tag: 1653991216-433027 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 9464f522e257..89ea4f658815 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -803,6 +803,7 @@ static const struct file_operations tegra_drm_fops = { .read = drm_read, .compat_ioctl = drm_compat_ioctl, .llseek = noop_llseek, + .oom_badness = drm_oom_badness, }; static int tegra_drm_context_cleanup(int id, void *p, void *data)