Received: by 10.223.176.46 with SMTP id f43csp719968wra; Fri, 19 Jan 2018 00:40:46 -0800 (PST) X-Google-Smtp-Source: ACJfBotpeiR12W6PAzVyxrf6xybQvadBr3gM/JMOP2+56YSCe0xMnZuh5jaHaOvfp2BQ9OMhRf0z X-Received: by 10.99.94.193 with SMTP id s184mr41250552pgb.325.1516351246157; Fri, 19 Jan 2018 00:40:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516351246; cv=none; d=google.com; s=arc-20160816; b=Yv7smY5Nh4DTOcEjAh19WVwpCeqom02YPgjMsYspnYWhmOhEGy+uQkDXxttXCNtiJC Qaq9ud79ApL8UQ3Ve4EZGzoYT3ICNGd1vzHMA/6TjOIVihdObPaACG1FD+JFi0uCJwWt SraDAblthvy8GTyXz7kfmEp6mgIHJ3Uqrqji0e188/er41OKgQpu5Syasm9foAY7bFz2 m31DzaTNdkwOmGUdKjz7w6EXqVQ69sCm22D4nGCnikfA7T4nEQ43/xjTJhYUW2J1LeE3 Gw334riOw9wj8PGDdBKByl2mpGibDCDuB+eXxesWrqxtxV5ZcrPWJRe1uOC8uHnnb9Pk OIYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=/ItWtC6DqOIjShRnTl7DSN9OZY3ZiwiukDmZp97PXVE=; b=OrrLxEsRM+NVEml4MsDGgWQiRZQHHTj8PLNfW7h30UG5UM5STjrYXgMfs+RakcBvmC /0GDsbKoz+BhkTpjdqHKF1SASBAHhgSoHoy7wzPFjPe9rk6E0H8debx03MkrLtb/ugmt cBLfbPv47ZDphd3+y3wkCVUCgTq12VAhtqFK+XYxVNpp84EdO3PLDmPqRmz2bnV/u/7d hDLCdZKJlOTiAYT7yijiS2AiVswilWezU4mhAdsXq1Xj8Y3Jt6QT34v2SCZGzhEEBbHq PYYBnz6m9eXc+GzLbHHJVOdnHjPYhUJ8fkLOhQROpuUne++wPlatIc1yvrj4jM2J1zbH rx3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=tacZ38co; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s77si9051015pfa.172.2018.01.19.00.40.32; Fri, 19 Jan 2018 00:40:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=tacZ38co; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755093AbeASIjZ (ORCPT + 99 others); Fri, 19 Jan 2018 03:39:25 -0500 Received: from mail-cys01nam02on0075.outbound.protection.outlook.com ([104.47.37.75]:30103 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754970AbeASIjR (ORCPT ); Fri, 19 Jan 2018 03:39:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/ItWtC6DqOIjShRnTl7DSN9OZY3ZiwiukDmZp97PXVE=; b=tacZ38cogmMZMbd7NEwocpm/VJnk9Nir4izRwIghXfn/7ZigoSLBgK+o0GBqM/Vs7srmFhvuOquEdRFCxIG7pNFmyAsQSDBBxh9p79yL6R8Aq9J01tsW7A5oOtDMiebQioLwgA0qtWRzee92UY6CVFzmPULza8NvwBKJTbv9FMU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Christian.Koenig@amd.com; Received: from [IPv6:2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88] (2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88) by BN6PR12MB1297.namprd12.prod.outlook.com (10.168.227.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Fri, 19 Jan 2018 08:39:14 +0000 Subject: Re: [RFC] Per file OOM badness To: Michal Hocko , Eric Anholt Cc: Andrey Grodzovsky , linux-kernel@vger.kernel.org, linux-mm@kvack.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org References: <1516294072-17841-1-git-send-email-andrey.grodzovsky@amd.com> <20180118170006.GG6584@dhcp22.suse.cz> <20180118171355.GH6584@dhcp22.suse.cz> <87k1wfgcmb.fsf@anholt.net> <20180119082046.GL6584@dhcp22.suse.cz> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <0cfaf256-928c-4cb8-8220-b8992592071b@amd.com> Date: Fri, 19 Jan 2018 09:39:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180119082046.GL6584@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88] X-ClientProxiedBy: AM0PR0202CA0028.eurprd02.prod.outlook.com (52.133.32.169) To BN6PR12MB1297.namprd12.prod.outlook.com (10.168.227.147) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06306861-d86e-4f5a-f6e3-08d55f181fce X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020);SRVR:BN6PR12MB1297; X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1297;3:dZzMUmHmwRbyQA58jwEZqcx2UDfSn0Owx116AurW3pbBqonZu5Z6hB8hV08Yy256qvy414Ck7Q4azONdq36L/ziC1YUFGjhQKzKsVN4ktG3OTKPjnJKo3y3ByhIMFdPtqBaBJkpegl84kyB1gPx2LLfTg6aJATqeGR6W1hUww/CuenRv9MMmuaIJelcAoOp5qZLw2E0SQRlRkEtTBxiU8VKXtCePWOkSRGuN7RhZfriG/etzk4Lf1PbZuyDll36/;25:v2OWR7zIumKRE8D8jlay/H/3Bnm+byoQlxAxVUt/Pl8zt0JpDqWt9i1mUkimx/3kf15bzzsEcHvAiSvor6cVIGvKcFtDvZuNjyZgdHB+lruP04kCx+Jur7qa3SU4bGg2mkdUOhaYjYLWCpOHrY38FDXW/vv7CwE+SnRC8D+k5ny6elrU1xrS+MWFkLe3HB5v5R8aFfv4oAkKqMAa3ltXOjNzkVQKexl7plYiVOO4UHxNXDd8Ni61jh6bf8bQ8gqQL/f5ZTVwLDWxwLuCDDbs9mtMbBQ/0sEAb33+EidSS2x2fl6bqYGlaKwbadWBpFpA5JXUlq5NkO3ECXKrsvhGAQ==;31:DFsc87CQQ8osJFAjSaqC2szCQRlaikOIGiB5k/H7VzrViofvJsJ5XNAcTN9d4LPj021+80FLouDfyWT5A4zuT/tFNtneqp2d46FY8dDPUC4eiqx7L671QcbvK7R5YhI+H/LDLpbbBVZodCyYOfIEX9FsfjtCVovxGqgfWG2biQrQgFbJk37n1IiWUFbt9slSr5Aio+6eeFOUYuEqJn8Aw5xbOqzs1hVxtxYHm8CxZ0s= X-MS-TrafficTypeDiagnostic: BN6PR12MB1297: X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1297;20:Gestvo+320ZXWq9PhCDJ3yov3fnfVl3QdkHWd+kzO3ywAKzagTuYCMxLyfZ80To5EPGhgrZ+zCFVj8Xrpkc1/313JGHJkHkLjqdjrumbsyqR17CrIpeRM30IjEx0KHtPRwDCCP65lUpTynYZysFDd6UVBioKm0oQR5ta+hoq0zJOcGdgjHP6k6M/Qd8lKZxWJIVYXQ8hTKYRyj35rVNVT9/lejO5kkr/X9NdAhVQ5gLRuHTUX+95CSo8mdRYut/QFoMFdxf7h1pC4PMOikTjQDTPK+PYf+JOJKsMISyUa7EI36kF0kqxu+zliRSCZW8eeJrsb0LItaO8+zzti1xGiICwYSMwFy5vGijXh3Y+zdpmCQmAYc60DiDvgxMRx4WIvpEMHv8FiFBVvwfkaHgJKM9u3h2a37Zsm4OZdZ8f6J54z6mpwp45Ce4IXBlYypFd/p+PkGkxFnoeKKqipyxjnEyZo9Wrj4k3P4IuYIIsAVGvNqSNFsOcNoIIhYaOvfAj;4:CiqiKPUDZcpfTClPe+U5iSFpNrwc83Xp6o/2T5fhTsUgAp5mMuNjNzEsUnM241D9qlC2pt/EJj3HopHFrU0JgrMxmsX5sZeNzhknKWRhFIS5+lvlF5ptFn5PoiDFj2fAXm71BT9WefPYGiHchLZyuFbs9Vj9KsK+SWlY3anT/3Mh1J6jEKflHeaep9v9joV4ENIYQYluOSveeqmPYZ8YJhEEx2R/T5/qVooC+SEQ1J8NrM+AWsJkeiA1HyJdpgOWp818NAVzBuExl4CzofJPVGvEbQVBQ5FxJ8Hi+EtZKZfX4Rrv1PFfGDpgM5U68swf X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(217544274631240); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231023)(2400074)(944501161)(10201501046)(6055026)(6041268)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011);SRVR:BN6PR12MB1297;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:BN6PR12MB1297; X-Forefront-PRVS: 0557CBAD84 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39380400002)(39860400002)(366004)(346002)(376002)(396003)(377424004)(199004)(189003)(65956001)(65806001)(47776003)(86362001)(2870700001)(1706002)(386003)(64126003)(6116002)(52116002)(52146003)(2486003)(23676004)(4326008)(52396003)(76176011)(68736007)(53936002)(6306002)(81166006)(58126008)(5660300001)(81156014)(65826007)(8936002)(8676002)(50466002)(316002)(59450400001)(2906002)(6486002)(229853002)(110136005)(305945005)(478600001)(67846002)(97736004)(7736002)(83506002)(6246003)(25786009)(2950100002)(106356001)(105586002)(31686004)(72206003)(966005)(93886005)(31696002)(6666003)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1297;H:[IPv6:2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMjk3OzIzOnBZUEtYQ1F0UlV3UE9OWjdhYkU0RUt1R3JR?= =?utf-8?B?TFZVLzFWWTloWDVubUxXd1VBc2g0YnpnaEZkVXoxTERwRlUzWkRxdGZFOXBr?= =?utf-8?B?RittYkxleGVabjlEZTJMNDNLMVRraGZnTGVCaU56bk1tR01FaW92VWxlMk1R?= =?utf-8?B?QmN0VzBkakwrNkx5Sk9ua3gwZDhmQnF5MzRWb3ZxMjBEcUdsendkU0JuaVlJ?= =?utf-8?B?bFZyZGlLUjROM3JwYW9IODhWbE5xQndaZ3NSdkp4VjZWZnRuNUdsU3F4aG9S?= =?utf-8?B?U2FhbkNuam1UTW5wc20zcFdXOWlXRE1ZVUdFUk5Xd0pCSU43QjJQMlc4NFdo?= =?utf-8?B?c1ZCeVJPM1ZUSlUzdkFjRTZEckF3Wi9VR3FyZm1BMHNJVX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v6GDXmYjkdicnnEyVmL0tT0mMrTWaM2H1S485IR5uc5dXs/nSQ=;5:RMj22KhMrybvgPJBWz6MmD0MQpX6W6C0y8Iwa/1l33kXU1xIfrmZFoPywmWj/rRl/hwqu0sqgWW8DAfk9hXVH9QJ8IkaoD0U7xwOeZR4wRBXH0iiHy//xdUNG7/EtSCjJqT07oWBI9XqXuUd0ONlW2j3ciD5spkGpFACDX0bgHc=;24:EMAB3u3jgC2v5YgcCzfeXWJ/gyF2us5hBN0lIYRyuook4yyJQvY/2lYBJ8ivsaPfqlbajCQXniZ3Et32I7T7z2bUglHEzW1tHz+mMYBtwCY=;7:o9ZMB8A4UltJCfyMuYJFj34qH5bowkraTntCkWo1NaO3/CQsGvHS4DM9Qm/hmRqcVUeJrBidyqcRrDsye4KZMM1QdCskYDpvEQhsdlKejMZjk+neFW2vmgfdvSQTaLRQkwwNaHAEr+JdeDkN3kbo61dBaNKoetpXsK1awZoJLAqH/ftrSlm41fHAGR6EmzZe89/XaqdJhxtTCqAlLSlZzAZ0ndaWSmfl2VL2Xi4oj24BoEd5CSdusBbn0ISl0x8D SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1297;20:lpU408HwheT1C0Cedx/plNrjTtfHc1Aab/jCH1dEoWZVFXUQQTbcMMo74pYU7aDfPVuCLeJvFL/+wUCJFYN9vNwsqguvL32KKIDdzR1abszIpl+hwuOKZQXkkbC/xpY90Notb25MVSuuWzJjvE/OVNNpbAgP2JBWzKkwPozSxSOHzOoM3AAqVikr0ZzM6DPJDiRSlQtghL9UvW9b1ycxJnhNn2/B1Pg9MqT7iYksx1A+vyflgiCVAyHpHTRhnwbO X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2018 08:39:14.5304 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 06306861-d86e-4f5a-f6e3-08d55f181fce X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1297 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 19.01.2018 um 09:20 schrieb Michal Hocko: > On Thu 18-01-18 12:01:32, Eric Anholt wrote: >> Michal Hocko writes: >> >>> On Thu 18-01-18 18:00:06, Michal Hocko wrote: >>>> On Thu 18-01-18 11:47:48, Andrey Grodzovsky wrote: >>>>> Hi, this series is a revised version of an RFC sent by Christian König >>>>> a few years ago. The original RFC can be found at >>>>> https://lists.freedesktop.org/archives/dri-devel/2015-September/089778.html >>>>> >>>>> This is the same idea and I've just adressed his concern from the original RFC >>>>> and switched to a callback into file_ops instead of a new member in struct file. >>>> Please add the full description to the cover letter and do not make >>>> people hunt links. >>>> >>>> Here is the origin cover letter text >>>> : I'm currently working on the issue that when device drivers allocate memory on >>>> : behalf of an application the OOM killer usually doesn't knew about that unless >>>> : the application also get this memory mapped into their address space. >>>> : >>>> : This is especially annoying for graphics drivers where a lot of the VRAM >>>> : usually isn't CPU accessible and so doesn't make sense to map into the >>>> : address space of the process using it. >>>> : >>>> : The problem now is that when an application starts to use a lot of VRAM those >>>> : buffers objects sooner or later get swapped out to system memory, but when we >>>> : now run into an out of memory situation the OOM killer obviously doesn't knew >>>> : anything about that memory and so usually kills the wrong process. >>> OK, but how do you attribute that memory to a particular OOM killable >>> entity? And how do you actually enforce that those resources get freed >>> on the oom killer action? >>> >>>> : The following set of patches tries to address this problem by introducing a per >>>> : file OOM badness score, which device drivers can use to give the OOM killer a >>>> : hint how many resources are bound to a file descriptor so that it can make >>>> : better decisions which process to kill. >>> But files are not killable, they can be shared... In other words this >>> doesn't help the oom killer to make an educated guess at all. >> Maybe some more context would help the discussion? >> >> The struct file in patch 3 is the DRM fd. That's effectively "my >> process's interface to talking to the GPU" not "a single GPU resource". >> Once that file is closed, all of the process's private, idle GPU buffers >> will be immediately freed (this will be most of their allocations), and >> some will be freed once the GPU completes some work (this will be most >> of the rest of their allocations). >> >> Some GEM BOs won't be freed just by closing the fd, if they've been >> shared between processes. Those are usually about 8-24MB total in a >> process, rather than the GBs that modern apps use (or that our testcases >> like to allocate and thus trigger oomkilling of the test harness instead >> of the offending testcase...) >> >> Even if we just had the private+idle buffers being accounted in OOM >> badness, that would be a huge step forward in system reliability. > OK, in that case I would propose a different approach. We already > have rss_stat. So why do not we simply add a new counter there > MM_KERNELPAGES and consider those in oom_badness? The rule would be > that such a memory is bound to the process life time. I guess we will > find more users for this later. I already tried that and the problem with that approach is that some buffers are not created by the application which actually uses them. For example X/Wayland is creating and handing out render buffers to application which want to use OpenGL. So the result is when you always account the application who created the buffer the OOM killer will certainly reap X/Wayland first. And that is exactly what we want to avoid here. Regards, Christian.