Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp108947iob; Tue, 17 May 2022 20:29:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5vvVx++CQvQxaRcV+v1zFAyJQriX646HbuIK5umgBh1ES2C2V9NNUKdw1VTzoKYvn0y4n X-Received: by 2002:a17:90a:f08c:b0:1df:6f35:361d with SMTP id cn12-20020a17090af08c00b001df6f35361dmr11078121pjb.161.1652844548192; Tue, 17 May 2022 20:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652844548; cv=none; d=google.com; s=arc-20160816; b=S3XCKAa1N/jsj/CWdQsItoNXKDRiyWPRdgui9cwzBRFMSqRN2Kew4R6RjBQ3N4aK81 E+moP2xK0ZHP7GM7yl3ZJnaiLl+s6OrrEqtGNcOp518y6hP5KECkkl4z2fDO7X9BKFdK qLSsLnPGVR8SRIpc1J+/brctFsuAv8YLBJCbNe0UotNmGYZmdeWD8b0gEBWpy/ry9arh oR52Ja1s/O/q02lLNk+OtmiACpL2m1pyJrUgfbeXoJMvgM8OkoU62cd3tiogxr2Eflar brha3NpzoUSnp622tIvn/L3MX+OBzJvjcZqPF8HV2V9AVr3DJ6dyLEeyHU1eFzR/RuRe uH7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kje1fxePklyTYdwuahnUd7jrh3kjOYPr65ooSYjVE44=; b=r2/138ULlhTIGKHUPFBJ3xyytOKSkl5ZV15LOmi961BelH+vyU9467qrQnTzXE7Juc 625l+iGZM9i82/PsB1CtqL2EIFXCe4pScJDtsN3/0nkwvsPgoWUAMc9bFZJ2s93DKQsG OfJKVtOYjJhEq3Eh4EH+HHjU+8sgRd1c1O6FPX86iitxFve0dx84CzvNLyS69S3TSqCY tFau/Bq+y5UwCewU/KAkckOQHrBDMM5U3nK7YF9VhHyEU8jAwCX6WPNCpOfT/mlitR7q OrftSTX7VT2rgN7dwy77ocV1TbNXR87ipZ5t7LLQKrZNANoQCiisLU+GjT4b6DYPoE3d 2Gtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BZgE0jkb; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f13-20020a170902f38d00b0016187554e67si1131362ple.195.2022.05.17.20.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:29:08 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BZgE0jkb; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9FF146C575; Tue, 17 May 2022 20:23:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231721AbiEQXav (ORCPT + 99 others); Tue, 17 May 2022 19:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231644AbiEQXas (ORCPT ); Tue, 17 May 2022 19:30:48 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F4E864F0 for ; Tue, 17 May 2022 16:30:42 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id n10so618385ejk.5 for ; Tue, 17 May 2022 16:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kje1fxePklyTYdwuahnUd7jrh3kjOYPr65ooSYjVE44=; b=BZgE0jkbkeLVvFmb8ruOV8av8A5Vi/cJesgkFUe7yW3/UIFp5JuLCAIksYmq6dxaPC UTmFxH4fn4hS3/gzRePwOA9Zgz2QoeR/e7KsL6wHOQMvCBYOzvoW2yP96YAu1wlsdo/W OYW4HOnAUXA1JVGJiazKgXoK/bUipg6BPRZaPd0iU4I6XDCU9CWewInibc8sy+vWJYxb GbGtI+anWZDqWuOTylV0pzWc9p1n+hpH4zF0jqzCG43N/eDSdV5LLd69UT0bGeoGyGse 0mKYTvfzrYVwqtPqL3gqbyjVL7SFmO6Pfdv96YRbeDf3urkh47YcrQa2GcXbFgbNtfr9 LXxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kje1fxePklyTYdwuahnUd7jrh3kjOYPr65ooSYjVE44=; b=FlDsZigN3MXysJ66pGfD4K1P7V6RW5MT4AsEStGZO5PkAS3k0fEsr9ePLWNXBWedRx u5bywjVri27tlmLxEW7gJaQ+BHhxpt30gXBwy/2OPvRu8fiVcw6b3yqRn6YOrheRg4ub pdZAsDtv5MBwkyK/KegI50RO4bMztSEWOwz9EznOBngYcYM7N72VYLPmwuBjJi4zJNuQ eG5TrX1g3KemUoo5H2AjHa0OIkXI0nf3fk/SPszH3+vkjy0x+0Ry6lak/99gXUtbjn9u ayRcT7GSRAbJXlV2sKN5mIN1HSq8ZZVrUQREZD4ak+3QEVTWzEwRQ6jLENaxif5XPs6J NMkg== X-Gm-Message-State: AOAM530GyO9q5bvoXvXxyvhrzExZlL8y6p3YnLmo1eQI7AEts5q833eX olMTY8L8eMfbw5lKjJt7ff/+M9Q7B5utuTJuyEdMVw== X-Received: by 2002:a17:906:6a10:b0:6f5:5e4:9d5 with SMTP id qw16-20020a1709066a1000b006f505e409d5mr21615657ejc.122.1652830241187; Tue, 17 May 2022 16:30:41 -0700 (PDT) MIME-Version: 1.0 References: <20220510235653.933868-1-tjmercier@google.com> <3365cd1d750e84fedc8e75d646a77ffd85619d35.camel@ndufresne.ca> <81026ef07c1ce20f8673b75b17bab79a2b39c548.camel@ndufresne.ca> In-Reply-To: From: "T.J. Mercier" Date: Tue, 17 May 2022 16:30:29 -0700 Message-ID: Subject: Re: [PATCH v7 0/6] Proposal for a GPU cgroup controller To: Tejun Heo Cc: Nicolas Dufresne , Zefan Li , Johannes Weiner , Jonathan Corbet , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Hridya Valsaraju , Suren Baghdasaryan , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Benjamin Gaignard , Liam Mark , Laura Abbott , Brian Starkey , John Stultz , Shuah Khan , Daniel Vetter , John Stultz , Carlos Llamas , Kalesh Singh , Kenny.Ho@amd.com, =?UTF-8?Q?Michal_Koutn=C3=BD?= , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 On Fri, May 13, 2022 at 9:13 AM Tejun Heo wrote: > > 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. > Yes, and I would still be happy to collaborate. > For your use case, would it make sense to just > add dmabuf as a key to the misc controller? > Thanks for your suggestion. This almost works. "dmabuf" as a key could work, but I'd actually like to account for each heap. Since heaps can be dynamically added, I can't accommodate every potential heap name by hardcoding registrations in 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