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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 2E362C433E0 for ; Thu, 28 Jan 2021 08:16:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D5D0264D9D for ; Thu, 28 Jan 2021 08:16:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5D0264D9D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2336B6E90C; Thu, 28 Jan 2021 08:16:23 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1128C6E560 for ; Wed, 27 Jan 2021 11:02:18 +0000 (UTC) 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?= 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-Disposition: inline In-Reply-To: <6b314cf2-99f0-8e63-acc7-edebe2ca97d7@amd.com> X-Mailman-Approved-At: Thu, 28 Jan 2021 08:15:36 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, Szabolcs Nagy , dri-devel@lists.freedesktop.org, Yafang Shao , Kalesh Singh , Hui Su , Michel Lespinasse , Jonathan Corbet , Mauro Carvalho Chehab , Daniel Jordan , kernel-team@android.com, Alexey Dobriyan , linux-media@vger.kernel.org, Kees Cook , jannh@google.com, linaro-mm-sig@lists.linaro.org, linux-fsdevel@vger.kernel.org, Bernd Edlinger , surenb@google.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, minchan@kernel.org, Andrei Vagin , "Eric W. Biederman" , Alexey Gladkov , hridya@google.com, Andrew Morton , linux-api@vger.kernel.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed 27-01-21 11:53:55, Christian K=F6nig wrote: [...] > In general processes are currently not held accountable for memory they > reference through their file descriptors. DMA-buf is just one special cas= e. True > In other words you can currently do something like this > = > fd =3D memfd_create("test", 0); > while (1) > =A0=A0=A0 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel