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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DD9CC67871 for ; Thu, 12 Jan 2023 10:25:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 050D38E0003; Thu, 12 Jan 2023 05:25:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0001D8E0001; Thu, 12 Jan 2023 05:25:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE4C98E0003; Thu, 12 Jan 2023 05:25:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C63C88E0001 for ; Thu, 12 Jan 2023 05:25:43 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A6A5A1A0C79 for ; Thu, 12 Jan 2023 10:25:43 +0000 (UTC) X-FDA: 80345765766.28.FE1B030 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf13.hostedemail.com (Postfix) with ESMTP id F284D20013 for ; Thu, 12 Jan 2023 10:25:41 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=kXlRU9ud; spf=pass (imf13.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673519142; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RFRkZ+Fj3t8T5BZaiHz5NCYqROwzY9AM/nVOyatEKtk=; b=fYVTcT5mJp5rWtfs1aYpaJ0VgHzbBm22w9U7G9Z3OoVXobFC0mHINw3t/C5ITVocxuI6tI xhTooELNegPhFfPIokMpfcXY+CN2VFL9jHX2tkoXaVQliosegyz97xMaCaDniH43JnWmbT 9LjlgyU4jSbQsHHc6LDuRXjfTLSNuZ8= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=kXlRU9ud; spf=pass (imf13.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673519142; a=rsa-sha256; cv=none; b=3kIPlIXY0anUNZ6aIHMnpDSJuCBeE3VRVWsgjUyB2E0DA894C1BhoOMQKJ48ymNTZzcvLZ YEliAe1++jocBXnkUb2pjhyf1KQGSUI7+qf+9yTTSG+Vtb0aCDfJRU5T1Let1OhYQgzxsT iEJDcM1idxYQHhZCo0+rAMHeWH1yOmE= 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-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: pte9js63wzt5y6fu73ogf1atb79qksxq X-Rspamd-Queue-Id: F284D20013 X-HE-Tag: 1673519141-36347 X-HE-Meta: U2FsdGVkX1/bf/Av2gtlFi7QxCG96NBcPdxRHpqYUR4Fpki12MC4wVsnPwRT5jbToYFu6aaekmoem3fk8t6G0J2BXr1IQLWyOiCquBrri0OLgcly4aAXuh7KCLeo3XDJ7n04TPQ0+Ui485hxuSfhYyALHHG6xgK+5qAadEiae3DXa0nMyw40Kl9VAmwmmcg+HjrzavukKfOqOF9qyeVWHgcYme4KrbDaZ6muCz140Ooj8u38a8baZvkYV1jzXm4hHaUrvCP8P0+sPvbQpXGMxbikFxiSPTN7ng8ebt8sxbrc7Ew1J8WOExAMkz9bLA85UylAj9xg/27WdyCpHQVKzOYntlABSKYXY6Xo2hHYcnUnwNJb7wSfEqPUaKG9wi5mkJGyZ/oglPvTlgwD4//dGYycEReH3Sia5+vSmqsMWqKMi3Vg2OLiIgFOPm9yp75IKoHaAIa8EzsyMqSHSueK9J1E8X/Z7oB3kY9oGqxgyVpGl4win5uCa1AjbxoNAfdpnS+OTpTgDrWNjo6ipiXEmKeICXRm/424ur7lar/EQ/hUcCufMOkyPFE50xTFk3MUx2+MXyc7v5hzsfaDeU3+7jw/etr2lcu0qvUe7kUqg40xUp7LeVazTU3bhGL9VPDWqaCZ0iXNu/3e6zPKRE+iF7qweRlAelcIcDqzMeL7jD70d2BCUKgH9VUGRpQqFBaoui6gcP71tKSh/DwVknxX+C7azIBc/5Mp0PGUvAAF9VGuFYtoplzsZzD2rG1CiHmoELSuLE1ReWQGjgcOvHUHdTVjKw6UJIrO2NwYXAfo/XgRDMxOk+Edr4tDuDa4YReCvez+VfMf2qRnUjsAfSfXptHZTVYvNsrSoh/V7t+NaJFrdG6G1yA/hBeEGvg7M8W2yvXb90BC6cjGRnRxF7X0+hngLPmKoIA9MWUvHVlWQVV2nKRHx/Renw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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