Received: by 10.223.176.5 with SMTP id f5csp4188822wra; Tue, 30 Jan 2018 03:35:11 -0800 (PST) X-Google-Smtp-Source: AH8x225o2bufRvtuXsPxVGxRc65k9tkK8H/fRLoRjQQywMhVhSHMRqgPJYHV6ZdHBaP4F2U6tu58 X-Received: by 2002:a17:902:b785:: with SMTP id e5-v6mr15773908pls.317.1517312111659; Tue, 30 Jan 2018 03:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517312111; cv=none; d=google.com; s=arc-20160816; b=uNVXxs1Jrfb57FO2EDwK3LZeoZ1z9ypsc4+6MqalLe1rLlWXPvKqZhk9tERoDprPKF lcg+O7ujzWk8+M4hKR2GJCHXasAXx1vAY91bBAwvmK9nx8hn5zgjnUeW+5blkpnfkHQ2 86Y/OW2Cx/AJV3Xro9ksiSfyYuGs4KdZu0DfDlpY/Av1Wn6N5BW258eefgqRV7IbEzjq n83rouoja/SJoYCcq0G/oNrYeVO1Ib7zUMhCOIxznAb/K2D4E3Le2CeuWId+zL6dZKyC e4dX1Cb7RY7Ldm9gETllrSeb3FF/Nd23+lYlVtQpxzzgRxqLQ/foMpvM7bRQCwMzPOt5 UZvA== 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=dacJqBtN7/vRt4LGikh/QlRILtDvNBbdYEySAqasfhs=; b=TFoKUNb73sBmfwGaR/YLbOool2QgNrchyEzOAHP7tPPk6JtWIy18XCNiPm4rctHqXS HatyQiEEOGSh2d5Ib2DAzYTL87u+VSOQCy12RKsJEVPOHyNO7mI7/puT6tMvd6wHnaOB IfrZOTImr4gn+9kldHkGCVR5xhr6fkrqsXDDr/osbA7FQnzSwpLVMLzaJU5Gzu0Vgq7P Y+Ds/87Rc9vdeMTlpRtSx953JI9O856CIbiLYepXsKl8e9xE7kmgd8zmZiCVllGijEqx 4PAjZHNH/OWZNW7rDShX9XWk05ha89LMsNoHNWDUn5EXQLU6lPVqgfxFCwU7m/ijeEIc geFg== 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 u59-v6si11469748plb.722.2018.01.30.03.34.56; Tue, 30 Jan 2018 03:35:11 -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 S1751677AbeA3LeX (ORCPT + 99 others); Tue, 30 Jan 2018 06:34:23 -0500 Received: from mail.netline.ch ([148.251.143.178]:44099 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751509AbeA3LeV (ORCPT ); Tue, 30 Jan 2018 06:34:21 -0500 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 75C4B2A6045; Tue, 30 Jan 2018 12:34:20 +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 8j4JuEB7hyKO; Tue, 30 Jan 2018 12:34:20 +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 BE93C2A6042; Tue, 30 Jan 2018 12:34:19 +0100 (CET) Received: from localhost ([::1]) by thor with esmtp (Exim 4.90) (envelope-from ) id 1egUB9-00026g-3K; Tue, 30 Jan 2018 12:34:19 +0100 Subject: Re: [RFC] Per file OOM badness To: christian.koenig@amd.com, Michal Hocko , Roman Gushchin Cc: linux-mm@kvack.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org References: <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> <381a868c-78fd-d0d1-029e-a2cf4ab06d37@gmail.com> <20180130093145.GE25930@phenom.ffwll.local> <3db43c1a-59b8-af86-2b87-c783c629f512@daenzer.net> <3026d8c5-9313-cb8b-91ef-09c02baf27db@amd.com> <445628d3-677c-a9f8-171f-7d74a603c61d@daenzer.net> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Message-ID: Date: Tue, 30 Jan 2018 12:34:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: 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-30 12:28 PM, Christian König wrote: > Am 30.01.2018 um 12:02 schrieb Michel Dänzer: >> On 2018-01-30 11:40 AM, Christian König wrote: >>> Am 30.01.2018 um 10:43 schrieb Michel Dänzer: >>>> [SNIP] >>>>> Would it be ok to hang onto potentially arbitrary mmget references >>>>> essentially forever? If that's ok I think we can do your process based >>>>> account (minus a few minor inaccuracies for shared stuff perhaps, >>>>> but no >>>>> one cares about that). >>>> Honestly, I think you and Christian are overthinking this. Let's try >>>> charging the memory to every process which shares a buffer, and go from >>>> there. >>> My problem is that this needs to be bullet prove. >>> >>> For example imagine an application which allocates a lot of BOs, then >>> calls fork() and let the parent process die. The file descriptor lives >>> on in the child process, but the memory is not accounted against the >>> child. >> What exactly are you referring to by "the file descriptor" here? > > The file descriptor used to identify the connection to the driver. In > other words our drm_file structure in the kernel. > >> What happens to BO handles in general in this case? If both parent and >> child process keep the same handle for the same BO, one of them >> destroying the handle will result in the other one not being able to use >> it anymore either, won't it? > Correct. > > That usage is actually not useful at all, but we already had > applications which did exactly that by accident. > > Not to mention that somebody could do it on purpose. Can we just prevent child processes from using their parent's DRM file descriptors altogether? Allowing it seems like a bad idea all around. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer