Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp965152iob; Fri, 13 May 2022 17:57:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW4WNtfXyB4TtLvQb+vVQNW9DhTp4WfIhteLV9SL/13BnEXNJLTc7MqXrVCDayUa5rUm/e X-Received: by 2002:a05:6000:1889:b0:20c:617a:b087 with SMTP id a9-20020a056000188900b0020c617ab087mr5921631wri.102.1652489846058; Fri, 13 May 2022 17:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652489846; cv=none; d=google.com; s=arc-20160816; b=UCowiW9EyARgtI0+llCyMkzDvKudCPIZyOnJYoHzIe1ExupPtAEJqehTbO6mRghq4p TaU5eB7T5kkaj2kaEk6GvNqrX32TRmyYKgHp4LpkTODqtNEQwPqqd02NVh7Qk5cs1Y30 5B66XJXBHi/56tPE1Mn6QcbzWAmaiRl1fcViIAszFfZK2Pl9zavKLEr0MNcBIhhq+dVK x8AJ+Ulw6HqMI6CWPPOFOPzR3rD3LkFGjgIjt+1k3Om9L4gaeAtb9a8B/eI29xiAs8Dw qSTFYQlZJPt1mEYDE1dRacd/e0uaXRSxlGpgeuoBoTN7hIGR9I/UNBGN0FT6zVx7Lxc6 bSzA== 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:sender:dkim-signature; bh=n4Ua5qSAHgvrptVTXpgV4jY28Fp/1ApPJcGYkkazweE=; b=H7pP0D6LPm4wcd4qJ2rIxXZWZYHNaf+7kKsCTsx9SkrTW8ITj8L7twpU9FuPToJJ4K yoYduO5ogDfdaC0vhSuU4Ibc9FP9xcad6ibU1blcg40qVZukKIR+EO8M28Rlv3VvexTM bk8udNXCyAnDu2zrJDJ+5YDux/ph9mG7TMw6S40hdjhe/ITaFcU1ki09a2iHPa/R3moL lJ1/9V2IBuJ9t0mn9UjbXe+r73GQSYOFeO0f4aJfPWSur1o48YLqImbJa5vDQ1JT+YJG EwFGzH0KSiJu0rYkWm3ls7WvkhIku3bAab6PisIbyVj06DwswgdiLHDliMVRvTVYBmLo ESgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dh+CcTt4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v28-20020a5d591c000000b0020cc21d0ea4si3021244wrd.664.2022.05.13.17.57.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 17:57:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dh+CcTt4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 085C2358852; Fri, 13 May 2022 16:32:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381084AbiEMQO1 (ORCPT + 99 others); Fri, 13 May 2022 12:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381684AbiEMQNg (ORCPT ); Fri, 13 May 2022 12:13:36 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB9534552F; Fri, 13 May 2022 09:13:27 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id i17so8371184pla.10; Fri, 13 May 2022 09:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=n4Ua5qSAHgvrptVTXpgV4jY28Fp/1ApPJcGYkkazweE=; b=dh+CcTt4AjCORsqV1ZODlBqFq+OvMka9auOOZykOuG9GwHD05RDvn63lEcsItiN2eH nH+MkFBQ8v1tdeWUMN4BRvaW+7Q1uwmQiOctS5wPsQLKRk5Ykt9si+fUFSf6n/at1dmY 4JOHexwRERxmPXQVd5EWv4mWhFA3BXiW4pCX0ZdVzHtYoUWHmurH8uIA0uBpYInyofFZ pNEuW8xEgDqjAmuzWH27jn+y85YMNek74F2xgDatREWDoXEvBkL4SnO/axBiM7vQgUS4 gbWP9yrJI2fCACw+ngKTCewWFxR85tswkrdeT3TpOZ3UiGjOL9rgao5yscsrH/9y3/bl VBAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=n4Ua5qSAHgvrptVTXpgV4jY28Fp/1ApPJcGYkkazweE=; b=QcsytHXlMbPTEHIYFvpnQDkGksrZ4wabpvWRsXAT2RgqsbxfmSlmSamGthRC9S/PDz mmgpmAjPFz0JpDvkg9BuABJxKgKuE+l8IRaLRUCj5oFqtZLe9P9za9AJHpAr/V4Oyg3E BAm2ptrGTLLFB+n/+yg4VwWeVYZfh1Uf74vSWF+Z+PW77xIVD75tk2waNk8AzGckea6L hEP3Z7sIw4rRwf5ye22GhKy7ssQsCLvVJwjDZfSIBBx9QjO2pQShpv7pxWsLR9Jwq3fQ gQeD7UFwkGxsGjk4bQtspjwrLp6IxFViZGlY/wNSj/e7qdM0+ssS7W31NHvUrKu+yHRv qSqg== X-Gm-Message-State: AOAM531ktAfLKnLfVG9t7Q1On4bEYj0w7wx0itA1fhgeHk86GyWO5S4E 3awW5GrZ/SEDAKBVvooj4g8= X-Received: by 2002:a17:90b:17c4:b0:1de:c92c:ad91 with SMTP id me4-20020a17090b17c400b001dec92cad91mr5642606pjb.169.1652458407026; Fri, 13 May 2022 09:13:27 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::4:5607]) by smtp.gmail.com with ESMTPSA id ip14-20020a17090b314e00b001d81a30c437sm1796573pjb.50.2022.05.13.09.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 09:13:26 -0700 (PDT) Sender: Tejun Heo Date: Fri, 13 May 2022 06:13:25 -1000 From: Tejun Heo To: "T.J. Mercier" Cc: Nicolas Dufresne , Zefan Li , Johannes Weiner , Jonathan Corbet , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Hridya Valsaraju , Suren Baghdasaryan , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , Benjamin Gaignard , Liam Mark , Laura Abbott , Brian Starkey , John Stultz , Shuah Khan , Daniel Vetter , John Stultz , Carlos Llamas , Kalesh Singh , Kenny.Ho@amd.com, Michal =?iso-8859-1?Q?Koutn=FD?= , Shuah Khan , kernel-team@android.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-kselftest@vger.kernel.org Subject: Re: [PATCH v7 0/6] Proposal for a GPU cgroup controller Message-ID: References: <20220510235653.933868-1-tjmercier@google.com> <3365cd1d750e84fedc8e75d646a77ffd85619d35.camel@ndufresne.ca> <81026ef07c1ce20f8673b75b17bab79a2b39c548.camel@ndufresne.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 Hello, On Thu, May 12, 2022 at 08:43:52PM -0700, T.J. Mercier wrote: > > I'm actually happy I've asked this question, wasn't silly after all. I think the > > problem here is a naming issue. What you really are monitor is "video memory", > > which consist of a memory segment allocated to store data used to render images > > (its not always images of course, GPU an VPU have specialized buffers for their > > purpose). > > > > Whether this should be split between what is used specifically by the GPU > > drivers, the display drivers, the VPU (CODEC and pre/post-processor) or camera > > drivers is something that should be discussed. But in the current approach, you > > really meant Video memory as a superset of the above. Personally, I think > > generically (to de-Andronized your work), en-globing all video memory is > > sufficient. What I fail to understand is how you will manage to distinguished > > DMABuf Heap allocation (which are used outside of Android btw), from Video > > allocation or other type of usage. I'm sure non-video usage will exist in the > > future (think of machine learning, compute, other high bandwidth streaming > > thingy ...) > > > Ok thank you for pointing out the naming issue. The naming is a > consequence of the initial use case, but I guess it's too specific. > What I want out of this change is that android can track dmabufs that > come out of heaps, and drm can track gpu memory. But other drivers > could track different resources under different names. Imagine this > were called a buffer cgroup controller instead of a GPU cgroup > controller. Then the use component ("video memory") isn't tied up with > the name of the controller, but it's up to the name of the bucket the > resource is tracked under. I think this meets the needs of the two use > cases I'm aware of now, while leaving the door open to other future > needs. Really the controller is just enabling abstract named buckets > for tracking and eventually limiting a type of resource. So, there hasn't been whole lot of discussion w/ other GPU folks and what comes up still seems to indicate that we're still long way away from having a meaningful gpu controller. For your use case, would it make sense to just add dmabuf as a key to the misc controller? I'm not sure it makes sense to push "gpu controller" forward if there's no conceptual consensus around what resources are. Thanks. -- tejun