Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp62622rwb; Thu, 12 Jan 2023 03:36:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXt+nrdZAeqNC7ixBYHfVfPshb6JNNl8aX7PVy7GlEzyWp+jS1bhJrzAUtq/ecZxrbIkf38j X-Received: by 2002:a17:907:208c:b0:84d:4b71:4ed3 with SMTP id pv12-20020a170907208c00b0084d4b714ed3mr13268608ejb.66.1673523361052; Thu, 12 Jan 2023 03:36:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673523361; cv=none; d=google.com; s=arc-20160816; b=lpKrzaNrZxHcBijmAU3hJfavpokZTIita0J6d0TKmA4AGz09MqOSMO5WaPrtzEMsKQ yipuVhqrSWYMRuwA16GIQO/NJ2YUM620WnvYcN+85qS3T2gPM7A66QRpJpy8Q0pBMDp5 9JViHYmpfcVU6hSfmrT93TYQLVso+Hxyot/mXdHq2Zx70gA/RZTwvsJRyiMjokkIS3/T NBxf86qItkl0m3620OqTq3dN1wRyRuumrO5cKrIQ4ZKu1QD6yjp5nD/03Nm+mqOvO4zr 76aZS5LYkXfbpyxmlk/AdWx9UsMaP7ByDGiUrVdbJRQpT6nhLOG+cHgwEgn8OndW8WLB v5bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RFRkZ+Fj3t8T5BZaiHz5NCYqROwzY9AM/nVOyatEKtk=; b=XN3Jwf4tB2rIlrQo1RO6kAsO3q22yLmotpDmkFdZI7pzK6fa/WT8y9CRw+cNu5pqO/ 1d+YS7ru4TWi0wsM72doD38htOON2jfIEEYicpqpDu0gQ6wxz8+PRxfulcHtsBbn/3Pm J6Dj5oR7+PC6kWYwMGb/UjdYrJWWNJRNus2NR1yy16LP3W960VzuGk9Ibt4zMXCk3EXe Z0y51TAGe4xA/He9WoBiMpOSnT/2LYF2cCC/tYVAU3uUl3o/IOKL+2mG2sYGr1pmnwE3 xbduxe6NUmXWN0izy14rGOHEZImxnD5o0LTUdkU8RvRvBfzrTp9d+uWIGXBSoRddtywW uqmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=kXlRU9ud; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xf13-20020a17090731cd00b0084d43aadb68si11309411ejb.461.2023.01.12.03.35.49; Thu, 12 Jan 2023 03:36:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=kXlRU9ud; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231438AbjALK3M (ORCPT + 49 others); Thu, 12 Jan 2023 05:29:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237417AbjALK2B (ORCPT ); Thu, 12 Jan 2023 05:28:01 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F9DF2019; Thu, 12 Jan 2023 02:25:42 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 900FC3FB4E; Thu, 12 Jan 2023 10:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1673519138; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RFRkZ+Fj3t8T5BZaiHz5NCYqROwzY9AM/nVOyatEKtk=; b=kXlRU9udXbFgZotDjntGowEBuvchX+T2tPOQt4l2B/QItP41pyuGf09UekzD58fu0LIxRc w76yu+pkH0Ua7YBS6uJ2rwWDxCoFeyaVSAeCGGeNdqLbR3tAQh+xq9uDiO7GTSj2Wj7bNn HineNr8vyQXh2nAR99gNAKtfqxMYBuI= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6650E13585; Thu, 12 Jan 2023 10:25:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9ozhGCLgv2PZJgAAMHmgww (envelope-from ); Thu, 12 Jan 2023 10:25:38 +0000 Date: Thu, 12 Jan 2023 11:25:37 +0100 From: Michal Hocko To: Shakeel Butt Cc: "T.J. Mercier" , Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , Roman Gushchin , Muchun Song , Andrew Morton , Paul Moore , James Morris , "Serge E. Hallyn" , Stephen Smalley , Eric Paris , android-mm@google.com, jstultz@google.com, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Subject: Re: [PATCH 0/4] Track exported dma-buffers with memcg Message-ID: References: <20230109213809.418135-1-tjmercier@google.com> <20230112075631.wc6fd54ci55drhkp@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230112075631.wc6fd54ci55drhkp@google.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 12-01-23 07:56:31, Shakeel Butt wrote: > On Wed, Jan 11, 2023 at 11:56:45PM +0100, Daniel Vetter wrote: > > > [...] > > I think eventually, at least for other "account gpu stuff in cgroups" use > > case we do want to actually charge the memory. > > > > The problem is a bit that with gpu allocations reclaim is essentially "we > > pass the error to userspace and they get to sort the mess out". There are > > some exceptions (some gpu drivers to have shrinkers) would we need to make > > sure these shrinkers are tied into the cgroup stuff before we could enable > > charging for them? > > > > No, there is no requirement to have shrinkers or making such memory > reclaimable before charging it. Though existing shrinkers and the > possible future shrinkers would need to be converted into memcg aware > shrinkers. > > Though there will be a need to update user expectations that if they > use memcgs with hard limits, they may start seeing memcg OOMs after the > charging of dmabuf. Agreed. This wouldn't be the first in kernel memory charged memory that is not directly reclaimable. With a dedicated counter an excessive dmabuf usage would be visible in the oom report because we do print memcg stats. It is definitely preferable to have a shrinker mechanism but if that is to be done in a follow up step then this is acceptable. But leaving out charging from early on sounds like a bad choice to me. -- Michal Hocko SUSE Labs