From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1749DC433DB for ; Wed, 27 Jan 2021 11:06:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDE5920770 for ; Wed, 27 Jan 2021 11:06:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236245AbhA0LFV (ORCPT ); Wed, 27 Jan 2021 06:05:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:49958 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236307AbhA0LDE (ORCPT ); Wed, 27 Jan 2021 06:03:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1611745336; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ju2N1jG53lMFxxVc2NAYc72E2pl8QR5olvZUsyDkBak=; b=AA9bvWk5QA70wiw6O1ZPSDKUoqyu0AVXkgupz7DWubfXYLwjZdranJNQOeXK67PiHXNqrP Ps2F1OxikIKZssE6h1Vs7SpZUjh9ufNGMSdPAtlyTn6XVfb1YJ4Z/8o58VS3Q7PIRxtVnv O6qDC/79DfVs86Id/zmCKilWMrRYH9M= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 82B07AD2B; Wed, 27 Jan 2021 11:02:16 +0000 (UTC) Date: Wed, 27 Jan 2021 12:02:08 +0100 From: Michal Hocko To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Kalesh Singh , surenb@google.com, minchan@kernel.org, gregkh@linuxfoundation.org, hridya@google.com, jannh@google.com, kernel-team@android.com, Alexey Dobriyan , Jonathan Corbet , Sumit Semwal , Mauro Carvalho Chehab , Andrew Morton , Kees Cook , Alexey Gladkov , Szabolcs Nagy , "Eric W. Biederman" , Daniel Jordan , Michel Lespinasse , Bernd Edlinger , Andrei Vagin , Yafang Shao , Hui Su , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-api@vger.kernel.org Subject: Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds Message-ID: References: <20210126225138.1823266-1-kaleshsingh@google.com> <20210127090526.GB827@dhcp22.suse.cz> <6b314cf2-99f0-8e63-acc7-edebe2ca97d7@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6b314cf2-99f0-8e63-acc7-edebe2ca97d7@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed 27-01-21 11:53:55, Christian König wrote: [...] > In general processes are currently not held accountable for memory they > reference through their file descriptors. DMA-buf is just one special case. True > In other words you can currently do something like this > > fd = memfd_create("test", 0); > while (1) >     write(fd, buf, 1024); > > and the OOM killer will terminate random processes, but never the one > holding the memfd reference. memfd is just shmem under cover, no? And that means that the memory gets accounted to MM_SHMEMPAGES. But you are right that this in its own doesn't help much if the fd is shared and the memory stays behind a killed victim. But I do agree with you that there are resources which are bound to a process life time but the oom killer has no idea about those as they are not accounted on a per process level and/or oom_badness doesn't take them into consideration. -- Michal Hocko SUSE Labs