From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 17A9336B07D for ; Fri, 19 Dec 2025 15:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766159945; cv=none; b=F2p5yoB6BAMCDE90BVPKaUj+AGm2BeKmH7H5CJYFQfSMPLzhPqr+wPxKgttturVo10pL3oi3twKmOWXSOMjlc4ZnxgLJoBwTrRO/yWXC/v035WtGqoEOx4HTeLpj39Ffl4QSER1d07QA00Ejevq66mhqGNxq1673aDxcBsz/W+k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766159945; c=relaxed/simple; bh=NuVKMRCOXiL/q8JSNbJx7Vrep0Xak1sDKET9rwhN+f4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H+LNOL6KVsP64bg0Df5GfX2r8ZFfj1TJJXMGTGBiaKP7jTKPOewFrtzCGbN4Pm21Z2oNSB2mWBxe9aDlQt5JbS50cUGiQ3QLruV/BafDkySXLuIBner5kB7Grn9/FPLPpQI/Fnd8Pzv4sA+tZnaoz/T9PXJVRLjgQ7ogzELQ50A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=H9VKfjuJ; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=N6IPCKQI; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="H9VKfjuJ"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="N6IPCKQI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766159943; 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: in-reply-to:in-reply-to:references:references; bh=NuVKMRCOXiL/q8JSNbJx7Vrep0Xak1sDKET9rwhN+f4=; b=H9VKfjuJT7xTqp8ZjSQBSxnRbYYyNIpsYsirggZx97RwCWpFgAsz9gvMcHiejxuWyZAOTe gG1DXGygvOgOhSG4UAMWZHvk4+b7HMXgzxdg6D7/UGMsFNjS6Q1V4Gwa2cQB4XgpTUpzNH WFFDs2XPLx/uP4JwtaPcoQOx0oacLKs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-111-teqHWhR8NSKSmWuWAiVjuQ-1; Fri, 19 Dec 2025 10:59:01 -0500 X-MC-Unique: teqHWhR8NSKSmWuWAiVjuQ-1 X-Mimecast-MFC-AGG-ID: teqHWhR8NSKSmWuWAiVjuQ_1766159940 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-47a97b785bdso13324315e9.3 for ; Fri, 19 Dec 2025 07:59:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1766159940; x=1766764740; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=NuVKMRCOXiL/q8JSNbJx7Vrep0Xak1sDKET9rwhN+f4=; b=N6IPCKQILlNFEijbjaTTEW/OGh4e0Qx/vl2CnC1a2egATRkboXgVu8lCfBDs7IJJDg zICFy2OXgBy3ohVL+/84go0cFneOLBDqcTYTmvkhefgx/1rTI0alnGfBH0Pc4Iw6mqHB NjSbJLg450GDb+PpOt8RJ0koqcM9FFDLQiA+lXAlim02rS3Xdl1+oXzlAT9M+LHym+U7 HCQjCzIxTshdvAEQy+83aWA74vNMzJv73D5j51Y1jbsarzy+OYe0kImj4vIwn17fsKOe LKNZBD2vVZC14maecUM/paHaG4NDmGFLAbocIfsZEWWJBYo5Vu6fjm4HfPoms+L2EMcq vlPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766159940; x=1766764740; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NuVKMRCOXiL/q8JSNbJx7Vrep0Xak1sDKET9rwhN+f4=; b=bOsrEAR6Fj+8uejyDlA7orNfoAipvDirHEmB+3Hr1/Dsl4oyFvxSa1kDZd7/szGdWB 57eWtsL4sRToS5P3/0gUOHT1texMzbDtkwLxbhZYyZLK2UWaFAtLwpb8PLdPfmsXWdGm fNeh6A1eXXvIC+tLPCsWdH62vcK/SbZ1y6kK0VkonY2T/eQl7h4Z9QYD/UynO/4d0siW pPsuixFj9Xu134sHhIu9AY4uPWHyGrkpTtMOzLzONqf6bAprmioCBQl4nO03tG+m+6T8 xkcrsTPS2HrC3iYE75G0clXaviKp2pF9xUX++isa2RDbis9vfDvO3rFHD4VjToFeiSGL uv7w== X-Forwarded-Encrypted: i=1; AJvYcCW5zV/HIFiLh1Gb79j1Dxa8d/V0uCrBFCEpxsMZbw+yZ3D+t/sXa7KmnrVF8nAP1A1kofM/cpG402AP4yU=@vger.kernel.org X-Gm-Message-State: AOJu0YwCrbM6AOQ2LXwJEmjCXna0jrQQwKazNfYhvvC1ibv+Dt9e5SKs SWguvUPK6RyKaL6iPeR3yIqRhWmxpZOj1Qv+9DswHVfFVR73wYLCRTVQUAsc0mKl9ZKwS6mO+Mi TZQZWJPAGUehGv+EP5pr5sQTF+0yW6ZQIOSZ+l6c7GYOuU1C8lqrmqV4ICZZe3Mkftw== X-Gm-Gg: AY/fxX78qwR5IATFl2yHxM6xI24DKzUY1wNUF91Y6CMoUyATg1ikEiNK20acd0coB/4 Ur46egVMYxLYcQQM+nJlpkAQElSCBFIUvoymjpVtNy8tUNZh9S8qTYExMyDtUSXsJroEgy17mvY LZxS+Ubh3cxOnmRl4BW7/EM75/eDKwbQutdTzP7f9S6nWKmzkm4p9d2eAlFYRexAVi6I+OaSZQQ O1MtGc1SgDIPj8tbqiT17StqSO6a3wp2pr/s/VrHz/3o3kDceXwqT/IwQJc9tyr8/9YrZEamWqn MTnZRMNAltoMmsxxX47TFUZ+fHk0tfmXPeQU5juHyWcwDTikSFQFRaEhqJoHFA== X-Received: by 2002:a05:600c:8710:b0:475:da13:2568 with SMTP id 5b1f17b1804b1-47d19592102mr31215155e9.25.1766159940204; Fri, 19 Dec 2025 07:59:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGz4saKUE5xlJBqdu6Gk7rmDOjerDoiXpYwJNHDHvTSpuZXU0uy6ESaJF6LqfbEUnkQVRXGsw== X-Received: by 2002:a05:600c:8710:b0:475:da13:2568 with SMTP id 5b1f17b1804b1-47d19592102mr31214855e9.25.1766159939720; Fri, 19 Dec 2025 07:58:59 -0800 (PST) Received: from localhost ([2a01:e0a:b25:f902::ff]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d192e88f5sm49165545e9.0.2025.12.19.07.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Dec 2025 07:58:59 -0800 (PST) Date: Fri, 19 Dec 2025 16:58:58 +0100 From: Maxime Ripard To: Christian =?utf-8?B?S8O2bmln?= Cc: "T.J. Mercier" , Eric Chanudet , Sumit Semwal , Benjamin Gaignard , Brian Starkey , John Stultz , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, "open list:MEMORY MANAGEMENT" Subject: Re: [PATCH] dma-buf: system_heap: account for system heap allocation in memcg Message-ID: <20251219-cuddly-platinum-cormorant-ae6d0e@houat> References: <20251211193106.755485-2-echanude@redhat.com> <20251215-sepia-husky-of-eternity-ecf0ce@penduick> <07cdcce2-7724-4fe9-8032-258f6161e71d@amd.com> <20251215-garnet-cheetah-of-adventure-ca6fdc@penduick> <20251219-large-daffy-monkey-74665d@houat> <5eda1755-865c-4bb0-a1a0-a4e6dac5388c@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha384; protocol="application/pgp-signature"; boundary="62gvz4x3u7aurz3v" Content-Disposition: inline In-Reply-To: <5eda1755-865c-4bb0-a1a0-a4e6dac5388c@amd.com> --62gvz4x3u7aurz3v Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] dma-buf: system_heap: account for system heap allocation in memcg MIME-Version: 1.0 On Fri, Dec 19, 2025 at 02:50:50PM +0100, Christian K=F6nig wrote: > On 12/19/25 11:25, Maxime Ripard wrote: > > On Mon, Dec 15, 2025 at 03:53:22PM +0100, Christian K=F6nig wrote: > >> On 12/15/25 14:59, Maxime Ripard wrote: > ... > >>>>> The shared ownership is indeed broken, but it's not more or less br= oken > >>>>> than, say, memfd + udmabuf, and I'm sure plenty of others. > >>>>> > >>>>> So we really improve the common case, but only make the "advanced" > >>>>> slightly more broken than it already is. > >>>>> > >>>>> Would you disagree? > >>>> > >>>> I strongly disagree. As far as I can see there is a huge chance we > >>>> break existing use cases with that. > >>> > >>> Which ones? And what about the ones that are already broken? > >> > >> Well everybody that expects that driver resources are *not* accounted = to memcg. > >=20 > > Which is a thing only because these buffers have never been accounted > > for in the first place. >=20 > Yeah, completely agree. By not accounting it for such a long time we > ended up with people depending on this behavior. >=20 > Not nice, but that's what it is. >=20 > > So I guess the conclusion is that we shouldn't > > even try to do memory accounting, because someone somewhere might not > > expect that one of its application would take too much RAM in the > > system? >=20 > Well we do need some kind of solution to the problem. Either having > some setting where you say "This memcg limit is inclusive/exclusive > device driver allocated memory" or have a completely separate limit > for device driver allocated memory. A device driver memory specific limit sounds like a good idea because it would make it easier to bridge the gap with dmem. Happy holidays, Maxime --62gvz4x3u7aurz3v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCaUV2PQAKCRAnX84Zoj2+ doBbAYCwC6GM+nDbVQ+qPSj3EG6TPcebfy5+uYyIL8SOICJl/3ohBlkB/AN0k0qs +sZn+aYBewZWQxkmfc2iSOFLjm35fV4hD2oDDGu74kWLPPrJefPelEf0OooFJoux CX9E84nf8Q== =seo3 -----END PGP SIGNATURE----- --62gvz4x3u7aurz3v--