From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E094739447F for ; Thu, 26 Feb 2026 13:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772113554; cv=none; b=MNTahv7v8zNgpkK7N1VndXsEMY8/TbhwqcEnx1ByJdhilvkwaLA0dxaZRGa0dLLn0h2Qsb/ZYq7VtQHZSdA15zO+t/68R1dHxlakDrRQvRJCBn6Ls/jJHdVluXlJIw3EBCVaLuUbXWgeNxwE6ZwMvIL8O39KpaXmpb2AZvffAwY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772113554; c=relaxed/simple; bh=7cZiRZeegMAN/TTz+JCfEK/A3QXMSIxdg2vnTLfsHyQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EZQNADcBSCtVgZ6DIFgZviW0WjSxp48iEQuT6t2CsCOT9uiAtvphoqNJvJ35FQpTuN2WtJkMR23xGfE+2nvswZk6VYYUuGD+hA8LCfBLUuK/rpHXdExVkCZ3QuoEjDtHY8ym1+l5uYEbQSIRXzMPOQox3Mfvf5I50B/HVdDILUw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=vajud8Gg; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="vajud8Gg" Date: Thu, 26 Feb 2026 05:45:30 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1772113550; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dkIMrpYm1KdU3cU9ItJMZ6NttQZCM67l72DH8n80OYE=; b=vajud8GgT9YD52qua+5kbAsn1oe1msd/UJT+JLadvyyKmV6nd6QrfsG3Ptke+6XOJCq0UQ FF67owIaltxgRWsC03zZafdS9jeMvQ0c96JpnSdzKqkaP8upii2KeCA7cZDWHY1cpzJEtS Hw0OGY+MjxwUrFqDy3UK5cIfcO1+ayo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Christian =?utf-8?B?S8O2bmln?= Cc: Dave Airlie , Maxime Ripard , "T.J. Mercier" , Eric Chanudet , Sumit Semwal , Benjamin Gaignard , Brian Starkey , John Stultz , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, Albert Esteve , linux-mm@kvack.org, Yosry Ahmed Subject: Re: [PATCH v2 0/3] dma-buf: heaps: cma: enable dmem cgroup accounting Message-ID: References: <20260218-dmabuf-heap-cma-dmem-v2-0-b249886fb7b2@redhat.com> <20260224-solemn-spider-of-serendipity-0d8b94@houat> <56400505-8a13-4cb2-864c-cb785e4b38d4@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT On Thu, Feb 26, 2026 at 12:32:42PM +0100, Christian König wrote: > On 2/26/26 00:43, Dave Airlie wrote: > >>>> > > > If something is in the main memory pool, it should be accounted for > > using memcg. You cannot remove memory from the main memory pool > > without accounting for it. > > That's what I'm strongly disagreeing on. See the page cache is not accounted to memcg either, so when you open a file and the kernel caches the backing pages that doesn't reduce the amount you can allocate through malloc, doesn't it? Page cache is accounted/charged to memcg and usually it is reclaimable meaning it most probably doesn't reduce the amount of anon memory you can allocate. > > For dGPUs GTT is basically just the fallback when you over allocate local memory (plus a few things for uploads). > > In other words system memory becomes the swap of device local memory. Just think about why memcg doesn't limits swap but only how much is swapped out. What does "memcg doesn't limits swap" mean?