Received: by 10.223.176.5 with SMTP id f5csp4142845wra; Tue, 30 Jan 2018 02:48:56 -0800 (PST) X-Google-Smtp-Source: AH8x226a5+/s/JjJdELexUUyHdh6E5Q8+lJ8slWVIfWG0r1ztaUpyRoHC9GL0/+qIF19O4mz3uJU X-Received: by 2002:a17:902:42a5:: with SMTP id h34-v6mr24099609pld.265.1517309336243; Tue, 30 Jan 2018 02:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517309336; cv=none; d=google.com; s=arc-20160816; b=S0clYebtpTcnYx+wyYceqkvV571glY2EaGfgU8b8KxuLZ4fXTY59R9o9uJL8AwqmcS UftCEfARrsOavUQmAYxe6gaE9nVFoJdFBbQq69sLwEmOtBqtbUazjZxDXyFcBtpqeP7Y SXZm8vKJeLsI/jR8IJw2gOa4TJRYXQFE0klfB8RNw9Q8Ski/2Zk1AitJAJ5kzaWUM1NK NkBFzK6ZswmTljTX5mNzY99apmtm7ZT10OAhXdLw6PkRag/6E34LPGHFkvlRVaXNN7LD 1y3OJ7AnUo7/4W+kuyulx/+2V/xtuiix8yVTlCS/XlQwd6kR/ILgCOJi/EpjRSRxikh2 YXQg== 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:cc:from:references:to:subject:arc-authentication-results; bh=gCOtQ32LoymF2lM0QJaxdO8X1oEoV5k8Gpq4jlJF1nc=; b=msd9NBsmUghPuHmn9bChFATLHiHNXPedGQ2BQsFqY3XJJsnYOWOgtWXbD3tVPXyDgI 5gnrXkFB4XsJpwTUikJoGftajcls79rNOP5rlNvDcWMtEz7CiTGodcyzxrO128fe6pF/ RfKwGMnROYDtIdnH9pGNjtS4Qf0cP7fKpLCyH0IDFHgk+5cuMKTaaB50gzdTTuaCkT3s Sy19pZ8wsVaQezSJONETpgpDS/s1L19IAv0PSdAR1UM4GSeyjAkp+lCtJTpfkB/uwxiw EtD5L7YA3ALL9cYyIJY+8csjTegX8aP6JFpLwUlWnPD3ytOnm0dcaSSIU/41Aw405XJ8 EfhQ== 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 q19si1451887pgc.321.2018.01.30.02.48.41; Tue, 30 Jan 2018 02:48:56 -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 S1751716AbeA3KsL (ORCPT + 99 others); Tue, 30 Jan 2018 05:48:11 -0500 Received: from mail.netline.ch ([148.251.143.178]:42906 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbeA3KsK (ORCPT ); Tue, 30 Jan 2018 05:48:10 -0500 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 1A0892A6045; Tue, 30 Jan 2018 11:48:09 +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 qg9RwdJuJNcc; Tue, 30 Jan 2018 11:48:08 +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 C0B602A6042; Tue, 30 Jan 2018 11:48:07 +0100 (CET) Received: from localhost ([::1]) by thor with esmtp (Exim 4.90) (envelope-from ) id 1egTSQ-0001hS-T3; Tue, 30 Jan 2018 11:48:06 +0100 Subject: Re: [RFC] Per file OOM badness To: christian.koenig@amd.com, Michal Hocko , Roman Gushchin References: <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> <20180130104216.GR25930@phenom.ffwll.local> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, amd-gfx@lists.freedesktop.org Message-ID: <5c3f8061-d2d2-fa33-faac-cb95e0b2d44b@daenzer.net> Date: Tue, 30 Jan 2018 11:48:06 +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: <20180130104216.GR25930@phenom.ffwll.local> 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 11:42 AM, Daniel Vetter wrote: > On Tue, Jan 30, 2018 at 10:43:10AM +0100, Michel Dänzer wrote: >> On 2018-01-30 10:31 AM, Daniel Vetter wrote: >> >>> I guess a good first order approximation would be if we simply charge any >>> newly allocated buffers to the process that created them, but that means >>> hanging onto lots of mm_struct pointers since we want to make sure we then >>> release those pages to the right mm again (since the process that drops >>> the last ref might be a totally different one, depending upon how the >>> buffers or DRM fd have been shared). >>> >>> 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. > > I'm not concerned about wrongly accounting shared buffers (they don't > matter), but imbalanced accounting. I.e. allocate a buffer in the client, > share it, but then the compositor drops the last reference. I don't think the order matters. The memory is "uncharged" in each process when it drops its reference. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer