Received: by 10.223.176.5 with SMTP id f5csp4126813wra; Tue, 30 Jan 2018 02:31:09 -0800 (PST) X-Google-Smtp-Source: AH8x227vKQnYpYJWKbuiTsjvAwSiml4zk6vrG0VJnVviKgCl67IzbUVeV9C5+s/8n3kaJA1m4yEO X-Received: by 10.98.69.82 with SMTP id s79mr29709702pfa.214.1517308269475; Tue, 30 Jan 2018 02:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517308269; cv=none; d=google.com; s=arc-20160816; b=oJThg7NYpbLN8RO3WfHGbQpoYMWOtkHms8fXgzZyHh4R+2/rgYUfU4MgrC9JD6gCS3 z/hIQE4C9w2/AsOxJM0/zUVXSOU985vP/UphNK6wAvyeElCoZEPVRH2ELz7EP7Bbf3Rk /NBWLJQOHSJ385HGbhsRyxUGlVhVMrBUfzruLccXcPePCvSbwKYmWEkWe7wvvMTHCF0F rl3Zou+cn/o1SFfxTNOeJ0Mk6zL3q8+KAzBdvn9mdQxbJHD+PUy9/e71nH3jnJdCcvoH 1DpD+9b9g6LvJfrWkAlB1OjsNqzRL9y+UCUBuHAUiscQqGN1s7ACUUOQy0AtcPMwisqR VP6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=fXw0iDUyWmgd140x/PU1LhIdCtmMHgPzO0HezMHTlb8=; b=w852ZCUc751wHXGlwKHK7UwRzh6DmzPDphflx5QoVdy86JoK/k4rRkJRI6xGFr7ids zzJzuS7SYAAeHlFF8/aITy1ujm2C0efgsV6YDGBmB2Qad7d1umjg0nTpzxh7du8riB2R HP8BT+AAhasfXoZk19SZ2tzWeTUl3CwKPcvLrD6856tiPYV3sozCIEY3GMuLBGt2xyE0 toaMHbuHb10pDWUeL8XCWWiU0ilxsqnX1C2Wad35uDi+Gee+OZtDuk56fEQU20+QpB7X /Dee+EF4B8W0TAbtP40h888GTPGYxJH2gx3byDsCRZ4xTchLORizlxl6PXg5Z5uRTIic aTXw== 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 e4si1346809pfb.84.2018.01.30.02.30.55; Tue, 30 Jan 2018 02:31:09 -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 S1751913AbeA3K26 (ORCPT + 99 others); Tue, 30 Jan 2018 05:28:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:42400 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751474AbeA3K25 (ORCPT ); Tue, 30 Jan 2018 05:28:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4F724AD82; Tue, 30 Jan 2018 10:28:56 +0000 (UTC) Date: Tue, 30 Jan 2018 11:28:55 +0100 From: Michal Hocko To: Michel =?iso-8859-1?Q?D=E4nzer?= Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Christian.Koenig@amd.com, linux-mm@kvack.org, amd-gfx@lists.freedesktop.org, Roman Gushchin Subject: Re: [RFC] Per file OOM badness Message-ID: <20180130102855.GY21609@dhcp22.suse.cz> 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> <60e18da8-4d6e-dec9-7aef-ff003605d513@daenzer.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <60e18da8-4d6e-dec9-7aef-ff003605d513@daenzer.net> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 30-01-18 10:29:10, Michel D?nzer wrote: > On 2018-01-24 12:50 PM, Michal Hocko wrote: > > On Wed 24-01-18 12:23:10, Michel D?nzer wrote: > >> On 2018-01-24 12:01 PM, Michal Hocko wrote: > >>> On Wed 24-01-18 11:27:15, Michel D?nzer wrote: > > [...] > >>>> 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. > > > > OK, I guess you have to bear with me some more. This whole stack is a > > complete uknonwn. I am mostly after finding a boundary where you can > > charge the allocated memory to the process so that the oom killer can > > consider it. Is there anything like that? Except for the proposed file > > handle hack? > > How about the other way around: what APIs can we use to charge / > "uncharge" memory to a process? If we have those, we can experiment with > different places to call them. add_mm_counter() and I would add a new counter e.g. MM_KERNEL_PAGES. -- Michal Hocko SUSE Labs