Received: by 10.223.148.5 with SMTP id 5csp7754386wrq; Thu, 18 Jan 2018 09:03:50 -0800 (PST) X-Google-Smtp-Source: ACJfBov3fM1X3NB7Z9v1U3Du1FLbKmA6wqyZS0IG1tGoudIKtQvPwHmwTmYX/I+Cypprqa0f/FzO X-Received: by 10.99.94.69 with SMTP id s66mr37596654pgb.190.1516295030447; Thu, 18 Jan 2018 09:03:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516295030; cv=none; d=google.com; s=arc-20160816; b=kuKfqS3Uq78mcdw2ZAlOBApYUagCrsWhVBnXw+LpoThgbUNT1DhOnIrDOpvMqo1Xpy xKDwqVAE89e277QCgAgMZ3egcv4SG+7IM8HpM1Pw2gPH07Zu4LaKIpo2YvxTi9ZJKjGu Yh0wQAVkCvsIXOcAZoY2eXb/qny/4n79RuiuCRy5GlFsw4/BwKa36N85BjX4g6y+94o2 Kwdppl33ldo103BBd/FPeY2Z2jQFXjJX1CiE/k7CchqCik74SEQW5MUU4KEYVMLu2VJB bjfUcMBsmpvhEwIKJnJ/GPRbfJai2bz2muR+pmmBo7OTCmb5OLt6RbrGv0pA2jxmLXwC jH0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=54Ddc9QQYPFA1RZTZQaS9Mlgkz5PB9V2C3Xy9scdliQ=; b=kCbWdJ9w4Hh2QphJZXvqbSMndPK5rygbjCKyNYOyrL8QRDsZ92fyBTVMdqZB/AhDNX H2pklOmRDjrEA1zbtyUlrh5sd205fILBaal9sXDs99uuBEOzdAYzHeb+rEEgCGpIPpSL 25Kk1IK0fXH0U7lh9aQIFkRjO9H/m6GIGIJbmr3U1/YS3k2p4652PY6yS/rZpaqbe4mS YvMkb2/4XYjJUhJyTGmwkNRnQF8fNZIsjB16NfxXjJVcMh6D4+r9QMlW0pnGQYa40Zk1 9I1AaLWy3AeW0nhFxczTZB8a2OmpZDC+0T8bquzltuiW0ta2wKbNMGxhSK3FFuV2SPZ9 2dXw== ARC-Authentication-Results: i=1; mx.google.com; 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 o30si6437868pgn.548.2018.01.18.09.03.28; Thu, 18 Jan 2018 09:03:50 -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; 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 S932915AbeARRAK (ORCPT + 99 others); Thu, 18 Jan 2018 12:00:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:57530 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932550AbeARRAI (ORCPT ); Thu, 18 Jan 2018 12:00:08 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 38150AEAA; Thu, 18 Jan 2018 17:00:07 +0000 (UTC) Date: Thu, 18 Jan 2018 18:00:06 +0100 From: Michal Hocko To: Andrey Grodzovsky Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Christian.Koenig@amd.com Subject: Re: [RFC] Per file OOM badness Message-ID: <20180118170006.GG6584@dhcp22.suse.cz> References: <1516294072-17841-1-git-send-email-andrey.grodzovsky@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1516294072-17841-1-git-send-email-andrey.grodzovsky@amd.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. : : 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. : : So question at every one: What do you think about this approach? : : My biggest concern right now is the patches are messing with a core kernel : structure (adding a field to struct file). Any better idea? I'm considering : to put a callback into file_ops instead. -- Michal Hocko SUSE Labs