Received: by 10.223.176.46 with SMTP id f43csp833188wra; Fri, 19 Jan 2018 02:42:38 -0800 (PST) X-Google-Smtp-Source: ACJfBovoRMMWNn8H8OFiT/Okxa6YTBjWRpOe/bYGoNXwaFntjLgvCLBK9trGrniOx14KeYJhHx9t X-Received: by 10.98.74.20 with SMTP id x20mr19488157pfa.191.1516358558604; Fri, 19 Jan 2018 02:42:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516358558; cv=none; d=google.com; s=arc-20160816; b=ryhgrlhkimR3r8aPJAoUcgybqgK3K8YleXA2ydyNXxeyCnJHXf3B4BXw4fDcCwu5eI CA4I8c6blzAjDstTH7H5dKhgCIv46NEEO4YWc8pgQuyd/teEWpGvJhZhI9cl1id+zEZo 6dE9SkSsoGCuvRU7qR0yZlQ38dHxIZLFMSueFk53SblC9rzWiu8vCLYE87CMIDZ3RR9m L41nrd0gUFn8MX+E5ammMgQEL1v5DiAZ5z+XtwH/vdutaVb1slA7Zs5DEi/+K01RtGo9 aM5fNQqvBqqpeIThWIC6e2MdOZRgT9JVWDbrcHbbeLnBHxmgbcudRYghohGfrnAeXIOx lZlA== 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=zbLVSXJzP7ZfkCSAJTnDxLie8EYj8fDN7TSY5B5IN2U=; b=lK4uLXhjGeRRJu80LC4RPw4pQyxKwn3t1FYlFl9tFyJoKjTZ7IA3eTBvzvFQLd8jVD D8DOftrEMGsUdb/a7zYtd+DuWCBWuzchFrP1Qz9mwjyOdG8hqLyh8N/ucZh8G2K+Wqkc 0IN1sNjio6FFdb65IuSAUZWlrAhphsOcqn4Vs/dP5V00UBSIIVxxmdFSJoSJ/eyr1eGt CfwdhYX0mqQF4cXtJM96EPDR3xQiX7A2XKpi/1uWxMiHFr3p2p+eTllY5Vg/1HoMmIYB vjDDEAqQmipSSWZV5GVRoYymRciMAbSpt+FYPTtGOmHv5OcKbW3V3VqAceIDas3OVJLq 70PQ== 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 t25si5487042pge.368.2018.01.19.02.42.24; Fri, 19 Jan 2018 02:42:38 -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 S932287AbeASKlV (ORCPT + 99 others); Fri, 19 Jan 2018 05:41:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:45416 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932089AbeASKlB (ORCPT ); Fri, 19 Jan 2018 05:41:01 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CA779ADDD; Fri, 19 Jan 2018 10:40:59 +0000 (UTC) Date: Fri, 19 Jan 2018 11:40:58 +0100 From: Michal Hocko To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Eric Anholt , Andrey Grodzovsky , linux-kernel@vger.kernel.org, linux-mm@kvack.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: Re: [RFC] Per file OOM badness Message-ID: <20180119104058.GU6584@dhcp22.suse.cz> 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> <0cfaf256-928c-4cb8-8220-b8992592071b@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0cfaf256-928c-4cb8-8220-b8992592071b@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 Fri 19-01-18 09:39:03, Christian K?nig wrote: > Am 19.01.2018 um 09:20 schrieb Michal Hocko: [...] > > 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. Then you have to find the target allocation context at the time of the allocation and account it. As follow up emails show, implementations might differ and any robust oom solution have to rely on the common counters. -- Michal Hocko SUSE Labs