From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: Re: [PATCH 0/4] Track exported dma-buffers with memcg Date: Thu, 12 Jan 2023 09:17:21 +0100 Message-ID: <2df3c97f-9e54-e743-a29f-f20f5461c851@amd.com> References: <20230109213809.418135-1-tjmercier@google.com> <20230112081337.fxgnhdk44mxu26et@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UhpZ6TmtUE/4qtDH4tuv1gmdSIFfJVCkGumJ+omqkEQ=; b=rbV7JbG+YtA0jU1tnlzDCnp6b4kM8kHW6DMywXCC5+xAgbJdC03e0d2lfVKX1ULBpEc67EbskjTu31VKSUmZ2H2HEj5p4KS4pDEsyPG9AJV9Gl2KjRfOLuEEswv3B1L8wzl10SU/B2WmE8tbRIpUQ3t0ABfLjJld3pJnGouvMSE= Content-Language: en-US In-Reply-To: <20230112081337.fxgnhdk44mxu26et-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Shakeel Butt , "T.J. Mercier" Cc: Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Greg Kroah-Hartman , =?UTF-8?Q?Arve_Hj=c3=b8nnev=c3=a5g?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Sumit Semwal , Michal Hocko , Roman Gushchin , Muchun Song , Andrew Morton , Paul Moore , James Morris , "Serge E. Hallyn" Am 12.01.23 um 09:13 schrieb Shakeel Butt: > On Wed, Jan 11, 2023 at 04:49:36PM -0800, T.J. Mercier wrote: > [...] >>> 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? >>> >> I'm also not sure that we can depend on the dmabuf being backed at >> export time 100% of the time? (They are for dmabuf heaps.) If not, >> that'd make calling the existing memcg folio based functions a bit >> difficult. >> > Where does the actual memory get allocated? I see the first patch is > updating the stat in dma_buf_export() and dma_buf_release(). Does the > memory get allocated and freed in those code paths? Nope, dma_buf_export() just makes the memory available to others. The driver which calls dma_buf_export() is the one allocating the memory. Regards, Christian.