Received: by 10.223.176.5 with SMTP id f5csp4137061wra; Tue, 30 Jan 2018 02:42:34 -0800 (PST) X-Google-Smtp-Source: AH8x2268IWnVS9kPLe5Uv1PRaDMPNpAomma6qhHcz9YlRZ7cboWbbQwGq2x9wFcOGxds6TA61R7B X-Received: by 10.98.206.1 with SMTP id y1mr29516641pfg.136.1517308954064; Tue, 30 Jan 2018 02:42:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517308954; cv=none; d=google.com; s=arc-20160816; b=Ad13SZw7xXP6sVm/yQzOeV0H3CSAT0h3e2a0Qkz875vBrZOwqoqutLWF9pMMfeup4g 6VrAPIJ8TNLBdQszq+i6IgEDoODH2noiOEIVSfJuCbh4fX4ow1dKo32HeH3/3VdawmEB X0M5xKSBRHXWUWIK2ZfT24TyXuOGSL6V4filWU75le++QHiKuDmwCaD+38tOVmnNFjUi yo5mQcPhBOHHZOAijfoG+tT8jsWnT3KxXU7C8WhRQh7cVmoT+jjEVKf1k8zIRw1hN75x jdQRgaCyRLUqI/m1aA+0AZ3A/YqauobXebS267QGvFT5cXzX7Y2V0TwVUb6vxLK3Hc9f U/2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=AdWgJpgyj2NvDqXCnXhd+hp1WGq8JHex1dHLHDfEgfg=; b=wl/b0oCg3lphPhxppTSjUdek8WP79ta0qSSS/Xq0FLePgWPUVA80qTBRPF09fdybHy Lwtj2enG937hgrSVrEx5IaAJa6YCVR/0ryqUH+5shyVeoOuOaR8PC2rv8u8rbKw2vtA5 grAeIAAMIzOUMkoArQyCO2wyAEyh/c5KLcdcu3RYGyHpTvqx7NKSPFVis5M59ETRAZDw mIXJ2gsz1gGIRsf6rS+10+6/Gf1QULAsy5O2aXEKdrXGCKE+9p7+5d1SYsEmOcVGAkqZ zEHO7q1PC9aubEmlBCqbzIlp9ikGNiozBzslyQuP1ajBXBZz65U7lRBqofuV9iqnIcMC 9hvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=vJiHProe; 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 m67si14084149pfg.208.2018.01.30.02.42.18; Tue, 30 Jan 2018 02:42:34 -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; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=vJiHProe; 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 S1751707AbeA3Kkm (ORCPT + 99 others); Tue, 30 Jan 2018 05:40:42 -0500 Received: from mail-bl2nam02on0082.outbound.protection.outlook.com ([104.47.38.82]:64444 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751391AbeA3Kkj (ORCPT ); Tue, 30 Jan 2018 05:40:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AdWgJpgyj2NvDqXCnXhd+hp1WGq8JHex1dHLHDfEgfg=; b=vJiHProeIcSV0qG6GAxx9SvvvAgdz6fNGAtrG2XP+T97gvZev3VxM/ty2/AflRb3zghuJhaIGgyR24UmO4CiAWR7IM2z7+sheKcJNZKC83oTgt5fGZ4uu40KiwDNv/QzbmX6fnCiAwNflJ8kxAl8Xo1su9wJ7jI74qhoXsWCk1k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Christian.Koenig@amd.com; Received: from [IPv6:2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88] (2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88) by MWHPR12MB1310.namprd12.prod.outlook.com (10.169.205.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Tue, 30 Jan 2018 10:40:16 +0000 Subject: Re: [RFC] Per file OOM badness To: =?UTF-8?Q?Michel_D=c3=a4nzer?= , Michal Hocko , dri-devel@lists.freedesktop.org, Roman Gushchin Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.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> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <3026d8c5-9313-cb8b-91ef-09c02baf27db@amd.com> Date: Tue, 30 Jan 2018 11:40:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <3db43c1a-59b8-af86-2b87-c783c629f512@daenzer.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88] X-ClientProxiedBy: DB6PR1001CA0039.EURPRD10.PROD.OUTLOOK.COM (10.168.69.153) To MWHPR12MB1310.namprd12.prod.outlook.com (10.169.205.135) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4e1d1e78-3ca1-4cfc-148b-08d567cddc04 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:MWHPR12MB1310; X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1310;3:I6ia0av8z3jyswLDCgzYqLdnT4e8js0zJWsJ7O6vTXNVZm5ZXz+9CZNbPf8oZDjNuzgGEmkhz03f6FMeDWIjMiLbNeMRB/OxgT0A4UhbH9zF/Cds6dbyKU7Wtlk90gLU2O8gZSOOSSPC8R/5MaDrsCwNqv7zD3RKD36vNZaZf9AjsKN+/4h8bRQ4wzt6y+XggwwSyq0COF5Avk/rTs4oVC0kLgHiLs0tv7A8+AC7aNI1ayLYmX7YgwU24en3pHcJ;25:+4ZoS0dtdffYnIkGKR0DyvfAgwWbZ2n1Yqzjq/FkHE6KpEm+tG3iXXHmmrYGuG8ezkzmtov2apoTyyO6Z32CXJRdc9tq/jWoAFBaEB82MhwlxCAkEhHgGPJ58uWNRrWNkpHsdiFJisd09MHrnxH6SXQ2pdEvjyrpYwgtKs7Xm2tKeMMfI3tUX6dY059wj/+i50uM50FpEW7m0WcMVLBSHIaORTHEi5n/Ud4CdFy+jaOldHxz4iryqhYgh+U55L6nfnMZphet8kc0vKzjBxzspt4Sn08MQqKS+B2XCzGKMig92SzhkQe1ZNDQu0uLbYuALtP+Vxd75Hsgk0NQFTPSbg==;31:EyGFecMhX9AVSASLuFZDEJsvDSVkBk36slnoTLO0KBqFrvxp50PQ+oUXKp+qaucc+zdHFO3HVYin1Fv29H8xCL/QsPu7KkiiWBWuHXXfD/ZFlFk87RamRqO1aC7RHWKuCYlDzLDz03+6ge1ZwoByWwaWYhuPK4mfmJoluwCtHS1NOOiawUSX6M+jxc/Vp4i2ACa1DKVoB1gAo1fmz9kYrEDL03QV30fsX7+JLayEejE= X-MS-TrafficTypeDiagnostic: MWHPR12MB1310: X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1310;20:M9LGzBWIz6kWyxRG+Fo4GHb/kXfd1i34n3QLGLktS0dzJlJ3mcTcLGi36Ej9pq9YTxfWz65FlukjpL9SZb5koIH5i+i5N+an8qfC6+Zp0qhs4VenW6Xl1ux6tKce2DIgUSryn8yDSmv5IVgWTFFVEkXD0yF6YeFcbBXRvAX/++rU8i5xpeh4ub8oDTPkJO6ydJYotcsIpqF1PHmu5rMffCVmehdG6z6Ba7yZMpTkgV6bFdoVZrVM7FbEGJ6ndTPnqvsgxkiPLwAGtjwzZimRVjvQLcZQb6sjg6999U8oV2tsegGt8gSH8kT+LhppgTBPA7jzv93iJ5u0AK3YSfr+0hf6rEnzwtASzGVgvPlkEVnqShF85U/UfkSF9BQyCSVXbVDIdLkmUd0D9f8zADmcElhlNxlklTVeWtzrDA5yLjt9m9W5AAzApaIh9BYUDMdne3pY/LC+Il+qhKrDDU28zESCP2T1SPBC4oz7c2EefDTiWiPmKG9uM4TAGfuppYpc;4:LwWVM93lVxbn591p3AZGQUVapFM39efEaW9Wc0xnMM8r9Q4UXUR4V5saPGs//Qtm+Vg5evB8NsxHElr9m6K9sL5++LmXZV+XMn6ttG6oOA7KfkI5zkecau2AoKqN3n9yQaNs/Dse9s2ENFHKdkjheN2NgasPwB1O/4/w+WK4lXQbaUIbMbiOJt4JywIBnkoddV8juu8KHGreKe0FKKO6+oWlwHL76Fc7sIck4h+Mn3z7Nv/Y5y8ws5yfmFbmHY9Sb6cjmpeXpJfpJChSWDwn1A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231101)(944501161)(3002001)(6055026)(6041288)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011);SRVR:MWHPR12MB1310;BCL:0;PCL:0;RULEID:;SRVR:MWHPR12MB1310; X-Forefront-PRVS: 0568F32D91 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39860400002)(39380400002)(366004)(396003)(376002)(346002)(189003)(199004)(7736002)(68736007)(50466002)(31696002)(97736004)(6246003)(6486002)(4326008)(64126003)(5660300001)(16526019)(67846002)(36756003)(31686004)(2906002)(2950100002)(6666003)(25786009)(93886005)(229853002)(65826007)(305945005)(47776003)(72206003)(106356001)(105586002)(86362001)(59450400001)(53936002)(110136005)(81156014)(81166006)(316002)(58126008)(52396003)(52116002)(8936002)(65956001)(2486003)(52146003)(8676002)(65806001)(186003)(76176011)(6116002)(2870700001)(83506002)(1706002)(386003)(23676004)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR12MB1310;H:[IPv6:2a02:908:1251:8fc0:4c6d:7233:b7e1:3b88];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMzEwOzIzOkNFakNwKzhobjRKME43b3VtV2MzVFE4ZytX?= =?utf-8?B?R3liOFNDM0JHcE9HNDZSN0t6a2d0ZkhnaytPOUpyWTNvUXVpbVl1K01YTkMr?= =?utf-8?B?bTduMTFLam9JenNLTkRYWllpeW1ueW1iNzZWd1dLZ0pQdUNuODE4eEFydVk3?= =?utf-8?B?MWYrRnh2OGJoUHMvRjZpYzMzbERsVkZEYzVzYlcrcGFjRVlXU01XbkhmRndX?= =?utf-8?B?RX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vPSG9 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2018 10:40:16.3598 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e1d1e78-3ca1-4cfc-148b-08d567cddc04 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1310 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Otherwise we would allow easy construction of deny of service problems. To avoid that I think we need to add something like new file_operations callbacks which informs a file descriptor that it is going to be used in a new process or stopped to be used in a process. Regards, Christian.