Received: by 10.223.176.46 with SMTP id f43csp614521wra; Wed, 24 Jan 2018 03:24:21 -0800 (PST) X-Google-Smtp-Source: AH8x227c8I8rbFupTN9rS1W6zt7YunvQdS3CBh7nISTiATt952v1DPq4PvZ8V7IavsQ31Ky97Kd8 X-Received: by 10.99.129.199 with SMTP id t190mr1542890pgd.120.1516793061274; Wed, 24 Jan 2018 03:24:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516793061; cv=none; d=google.com; s=arc-20160816; b=e0JS5JIZk47a9LJf5fN+22+I+aEIX/wOOe8s0HLZqe9KDjbCTsvGO26vXoVFrY37xD XwQcDmN6/c+HMovMwsNPyaGWWBSKDs1rm1+xrSjwE6um+M3d5ranu02h0Jcfso+QthaR WrijyVy+RoeNBmSMauZhsadbZH68FL4bQqBBcSRL4yc8nWvy48T7muRHsOQnyr3LUWwR lv0PoffU3CDpxDl+Rbw7EYN+hi219fzpJiBUZxPIKepQWXnc/qXKnbUgSYkiYlsGqm30 S2h1fp0SaE4O9mHqAkVBpXmPZQt2RHaXt/f+K5vqt3DogMOJAyBrT3a3MrEwWwvmk5aB +fCw== 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=4t6NpV8ENnAaqzmzZUaFZn01VJ0MLHv92R8qDBCBTi8=; b=HxHjpxyOPcsox7kfwnkPZ1MIbptSbokybv4EuupJKsf1GgMzG8jXG4huuC3BQpWEME A9MhvaXqLbnD9SYRSFQx106rZ1ml5AY+ViKHz2gtSGjAacprv2cp0TywuviXoRewVS2v boAunvMsZ/4qjCFCCsKQhM8zx9w6yc97aa04itVQvqevoy+Vcc73gm7tIFqy76O06pOC BZvzjDVjY3hyZzocZgCaMBC60u0zuEM1rR4Qzuz/KCsz8sOySWxs32sY9bafO6vTrBLY 39QWRLM46lVH4B3a3ZlXI2QLX3kAC1K3qux85EW3kuKo3tVaI2z+gaKYLAdUdAzoRl4J ISXg== 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 9-v6si54004plc.230.2018.01.24.03.24.07; Wed, 24 Jan 2018 03:24:21 -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 S933268AbeAXLXQ (ORCPT + 99 others); Wed, 24 Jan 2018 06:23:16 -0500 Received: from mail.netline.ch ([148.251.143.178]:57745 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932891AbeAXLXP (ORCPT ); Wed, 24 Jan 2018 06:23:15 -0500 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 7B3622A6045; Wed, 24 Jan 2018 12:23:13 +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 xVlzTDHpi-5e; Wed, 24 Jan 2018 12:23:11 +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 495722A6042; Wed, 24 Jan 2018 12:23:11 +0100 (CET) Received: from localhost ([::1]) by thor with esmtp (Exim 4.90) (envelope-from ) id 1eeJ94-0006Vi-JH; Wed, 24 Jan 2018 12:23:10 +0100 Subject: Re: [RFC] Per file OOM badness To: Michal Hocko Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, Christian.Koenig@amd.com, linux-mm@kvack.org, dri-devel@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> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Message-ID: <36b49523-792d-45f9-8617-32b6d9d77418@daenzer.net> Date: Wed, 24 Jan 2018 12:23:10 +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: <20180124110141.GA28465@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:01 PM, Michal Hocko wrote: > On Wed 24-01-18 11:27:15, Michel Dänzer wrote: >> On 2018-01-24 10:28 AM, Michal Hocko wrote: > [...] >>> So how exactly then helps to kill one of those processes? The memory >>> stays pinned behind or do I still misunderstand? >> >> Fundamentally, the memory is only released once all references to the >> BOs are dropped. That's true no matter how the memory is accounted for >> between the processes referencing the BO. >> >> >> In practice, this should be fine: >> >> 1. The amount of memory used for shared BOs is normally small compared >> to the amount of memory used for non-shared BOs (and other things). So >> regardless of how shared BOs are accounted for, the OOM killer should >> first target the process which is responsible for more memory overall. > > OK. So this is essentially the same as with the normal shared memory > which is a part of the RSS in general. Right. >> 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. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer