Received: by 10.223.176.5 with SMTP id f5csp4191647wra; Tue, 30 Jan 2018 03:37:47 -0800 (PST) X-Google-Smtp-Source: AH8x2267VvRA2+Av8+WzHBmaRe37uYgPEPMhtytxuot4OEqAQzmyPt0Isd3oFz6pLA5S16zlDbeR X-Received: by 10.98.245.214 with SMTP id b83mr29305743pfm.85.1517312267116; Tue, 30 Jan 2018 03:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517312267; cv=none; d=google.com; s=arc-20160816; b=y3jmjrRr6uLW/3FgOKveqzaqmOB/efmiMxkQyho2bH/rmgsQJwJNZ8/4ieA1KmXqh+ +wegVcVOy/EYVP7aWqXiszIU5mffk7xDB21jj3m2VTn49Z+GYqd70VDI5/aZ2Kq1CsCB BZjxCU7eJq2Y0IlXZ/lwHVPhv0QAxwRg4+ifrbhkYEsDWJFyLGBXoRcdf1uUH2FuO42e Ebbo4UD6gISfKODUu4VXpg2+D1C9+T8t5gJMXRTMVFn4csUdhukHdogxB/QkEQ9Eb+Ze 7EjFAwcaVCVopqbIiw/VIT3Ej2tEk2nGgUUC+hosNAIZzjZDqlWFG5tCc7Nrbh+Y34Go NeXA== 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:dkim-signature :arc-authentication-results; bh=aa3HL6d6kZnMGrFPTDtcr9FnycgnetMXigACWCIkUdg=; b=aTRepV1ect4ZPSLuHY6va7xMnnHNF4Y/5WMb7eghCt+nnymMBYhLHyzUBbzrq1igVw V5xYrV0lB3msR78cS96aXKojDgiU7TlKOCzPXh/eKBrOgeCf6hthJZ5DZyXmMnZLUri4 /AjvBL60oWGV+/FAJJ+rThXOBjJ3u97SqfYv4rIxutwa09epVO1jDW96iw2HqkPULuik zIFwx5s3Hg+fe5QpHLT9J4IQS3quuT8MOsZr6qCi6+Dq6FHyZn2C3vyQfUUbtd4ZEHBg i76Mldd15HCDrEoyrqFyrlv/SwWd9w4EdhL5Z4+DPWvcAwZbASz/QQ06GoR1DyOXebPQ j0KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PgkPT6jW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78si962682pfk.253.2018.01.30.03.37.33; Tue, 30 Jan 2018 03:37:47 -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=@gmail.com header.s=20161025 header.b=PgkPT6jW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751764AbeA3Lgr (ORCPT + 99 others); Tue, 30 Jan 2018 06:36:47 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:39085 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751574AbeA3Lgp (ORCPT ); Tue, 30 Jan 2018 06:36:45 -0500 Received: by mail-wm0-f65.google.com with SMTP id b21so445218wme.4 for ; Tue, 30 Jan 2018 03:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=aa3HL6d6kZnMGrFPTDtcr9FnycgnetMXigACWCIkUdg=; b=PgkPT6jWkjhIFtCzSz/LCvq+Sa69L04n8xdkuLMikLSm3L8VIB+FHBn9Rgp3apzQLn EoQXHXpBq7S4rkfo99be/DTrZ9f5K5Q55oB68xJvVqpGKCLggFtqk11njHDRfaSkVD7I GR520p/IadwdAMXLe1uukXm11QNUSjslNFKiYUB3bcu0uUTiAwigKE5COn9F6m6no2ok AmzVbY4HDlCYPuV4MfZjMJXBZ0ZiMzs7qBNPnvHt7/8bcqenDcBF9+n6LKh6VYchyoE3 U9Eb/J/B2Q7RSCtMZNIf4whVsorVVg8PUSsMs0LPp3aFW2lz7XmZGyta6C+wCyWiidnZ P4Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aa3HL6d6kZnMGrFPTDtcr9FnycgnetMXigACWCIkUdg=; b=f+SV6Iaoj4xZF5W3BvbQ6FbU2pSes1z76XM0Wlj87muErJVZe1pmftvn9NgjuIIseh ZeOFGq0HBmbU9RZYDK9lKxwi8fNCmMtU+wPNrk2DRcpEQokEWi09n60+1AG6h8/s4QCn LrzBgb5/2dUdr0VtnVJuJIFcH6XsL56TxvRrlONIZEYaDbDPGuZdDEAReNeXEubrnMdR 6MMk6R9hZhSY2WkXrzziAG7b/3Jim83+uDkD+xbUqeXhx0kYzzkdPaDo4zKI5vCfFJ5t r38LkUWdPgtEfTem4tmBVUjzgORzInm3/XlErfub5pXC4TLuOuXSa68yDgDsWhUuSlcQ Ybjg== X-Gm-Message-State: AKwxyte0LH7+7Wb45P+vvS0ZU5lFthDxCtN1rlDr56p3UHmCrkwKHiQ6 uRtfPgwtWJE2EPMBe/mmXqlY3gAI X-Received: by 10.80.194.194 with SMTP id u2mr50898132edf.84.1517312204709; Tue, 30 Jan 2018 03:36:44 -0800 (PST) Received: from [192.168.1.109] (80-33-144-85.ftth.glasoperator.nl. [85.144.33.80]) by smtp.gmail.com with ESMTPSA id a38sm7350540edf.97.2018.01.30.03.36.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 03:36:43 -0800 (PST) Subject: Re: [RFC] Per file OOM badness To: =?UTF-8?Q?Michel_D=c3=a4nzer?= , christian.koenig@amd.com, Michal Hocko , Roman Gushchin Cc: linux-mm@kvack.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@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?Nicolai_H=c3=a4hnle?= Message-ID: <82d5894f-f4ea-98cc-068a-5d470f5267df@gmail.com> Date: Tue, 30 Jan 2018 12:36:37 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30.01.2018 12:34, Michel Dänzer wrote: > 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. Existing protocols pass DRM fds between processes though, don't they? Not child processes perhaps, but special-casing that seems like awful design. Cheers, Nicolai -- Lerne, wie die Welt wirklich ist, Aber vergiss niemals, wie sie sein sollte.