Received: by 10.223.176.46 with SMTP id f43csp824452wra; Wed, 24 Jan 2018 06:32:13 -0800 (PST) X-Google-Smtp-Source: AH8x227hpCWOcPiBMXNu2oRs2NQ+RPm92vW26M05TG4aGI/Cdmk+9ZwiOE1bauxj7CaSp2bL4nXP X-Received: by 2002:a17:902:147:: with SMTP id 65-v6mr5873822plb.128.1516804333797; Wed, 24 Jan 2018 06:32:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516804333; cv=none; d=google.com; s=arc-20160816; b=b3S3UV/bLfpN6KqRtO6ajl6u2yw9PawJExDBf2KROmxAtgLO1k3F2x6Xsqrigc+llI 5EZ9BVpWjNDabj/RgOVVPByfdE2MM2fR8srFXQ9URHARj1qYMyAZpJK8nCa5noKxvwGd 9IWaUWr+toGjNjPAWqEbZx4XBLWgf3qkG+B7UFNk5WEAkayphfHcJNfIN4iO6feo2394 nHlRpYasfvHQQRZEyIEo84zpvVab84VQSfsUjTLFVRb9od/0CaNcSktdF22yLOn+2DQt 7XINKskBVM9i+h9bzVO46SzpUACoL0Y4ADRgNVksLKbAywrwXV3eDnTbWCmirGOJf5Oq 0FfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=CI8TR2F0c5b8zKfC7Oo4gkcjbXh4r8f/LyhtEbvrL9I=; b=U75cj8vBAhEfcpuPWhi8lvBRBsWcCUZ8ISKx5bhxgBeLSWoPcGBib/XoZoKIZhBHGc eBmR4qQqQRIJa7JM13DqBXUk0FIyCeXtpra2GUjwTZTZk881yXuA0OhEBDGrKEz0S7qR fmlnZX0FDRmke3x8+v0w+h2iMoscDG5lMgG/21N0GGVTyr5ArKrA0IAqZ9Ksm2x2gLLt iJ3Ww0s6nZT4L8ydBxM2TCmzQZMvo8sVpZVyoi4wlwqpk/mjHg99RnvubDig4hyrFlAx gsvxzqySD9SfjcQLCRuK3eQRzhY7WjrmC2osllsFcmXqO1QadP0zohNbuC6Aj/6GZIkV XjHA== 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 z185si187592pgz.694.2018.01.24.06.31.59; Wed, 24 Jan 2018 06:32:13 -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 S933936AbeAXObd (ORCPT + 99 others); Wed, 24 Jan 2018 09:31:33 -0500 Received: from mail.netline.ch ([148.251.143.178]:60553 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933688AbeAXObc (ORCPT ); Wed, 24 Jan 2018 09:31:32 -0500 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 770D92A6045; Wed, 24 Jan 2018 15:31:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lqD6DkqnMTCx; Wed, 24 Jan 2018 15:31:30 +0100 (CET) Received: from thor (190.2.62.188.dynamic.wline.res.cust.swisscom.ch [188.62.2.190]) by netline-mail3.netline.ch (Postfix) with ESMTPSA id 8D60C2A6042; Wed, 24 Jan 2018 15:31:29 +0100 (CET) Received: from localhost ([::1]) by thor with esmtp (Exim 4.90) (envelope-from ) id 1eeM5I-0007j4-Qw; Wed, 24 Jan 2018 15:31:28 +0100 Subject: Re: [RFC] Per file OOM badness To: Michal Hocko Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Christian.Koenig@amd.com, linux-mm@kvack.org, amd-gfx@lists.freedesktop.org, Roman Gushchin References: <1516294072-17841-1-git-send-email-andrey.grodzovsky@amd.com> <20180118170006.GG6584@dhcp22.suse.cz> <20180123152659.GA21817@castle.DHCP.thefacebook.com> <20180123153631.GR1526@dhcp22.suse.cz> <20180124092847.GI1526@dhcp22.suse.cz> <583f328e-ff46-c6a4-8548-064259995766@daenzer.net> <20180124110141.GA28465@dhcp22.suse.cz> <36b49523-792d-45f9-8617-32b6d9d77418@daenzer.net> <20180124115059.GC28465@dhcp22.suse.cz> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Message-ID: <0a320079-c08c-0762-6967-9e85f24c8e9d@daenzer.net> Date: Wed, 24 Jan 2018 15:31:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180124115059.GC28465@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-01-24 12:50 PM, Michal Hocko wrote: > On Wed 24-01-18 12:23:10, Michel Dänzer wrote: >> On 2018-01-24 12:01 PM, Michal Hocko wrote: >>> On Wed 24-01-18 11:27:15, Michel Dänzer wrote: > [...] >>>> 2. If the OOM killer kills a process which is sharing BOs with another >>>> process, this should result in the other process dropping its references >>>> to the BOs as well, at which point the memory is released. >>> >>> OK. How exactly are those BOs mapped to the userspace? >> >> I'm not sure what you're asking. Userspace mostly uses a GEM handle to >> refer to a BO. There can also be userspace CPU mappings of the BO's >> memory, but userspace doesn't need CPU mappings for all BOs and only >> creates them as needed. > > OK, I guess you have to bear with me some more. This whole stack is a > complete uknonwn. I am mostly after finding a boundary where you can > charge the allocated memory to the process so that the oom killer can > consider it. Is there anything like that? I think something like charging the memory of a BO to the process when a userspace handle is created for it, and "uncharging" when a handle is destroyed, could be a good start. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer