Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp712381iog; Wed, 15 Jun 2022 10:35:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vQphACcDHxVgolOyRD8jOnlIBIGD/zyttLm1bWKX2uEVOMVcNyZfBDCeMxp1+pYlQaZv/R X-Received: by 2002:a17:907:160f:b0:70f:cceb:d78c with SMTP id hb15-20020a170907160f00b0070fccebd78cmr821057ejc.247.1655314538311; Wed, 15 Jun 2022 10:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655314538; cv=none; d=google.com; s=arc-20160816; b=dEaMsl9n5fgeWI7iTDzZDyse7Jr6nfPLj3uePvddfke0w7vNRBHNqc+d36dLfCjqvm K4s480VLQ5+BRKtVrRUoGd+3SnPR+OYsOfLbr0rAZotr3RwaEbGbUAHR7jey5Hqwgbe1 IFmGKRHnFAWiVBBambrdZUlaOm2Qj/VlDkG0Lsg8TQay/w8BEYCd3a4br0ofEiZtrrS6 Xt230T0LuhaAfwObVqOA+3wdcZBP1bj45ms0sbxEhNi5oq7Vlbqb/QTvjHRAKW4HaswO Wv2FnqVQX7XXoF9kay4hDwI8rCQ4oNp1uNKff0D2nyTcMxA8UTN4JLy9/MbeC0dPKvFY P/cg== 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=w3YUx2QLwqjC4yt6Na4HDX+YOsTdcO8b9CpzZpDW+SU=; b=ydiIEFbk7raEm41W7qH0ugAObTwxPO8omcypYSDtJGWk5bTtTTxx3yzS1y3uSIWmoz FJy0kOWJUGQNGL32tvo8/723vWtaoyD/a1SmVW/U2pV4g+Eofr9jepi53emfmDUK+R8W IWirdDV6cjLdVonDpOYWI6RqswnehR8xQUghDPP7qAKvWfg+b+6Cy7us91NUPWfHVGyP w6gDklD8NuaMqpKdu/zdJr/oiP0b6O3p4uX43GPMZ71HB/S2JGtIPNZ7mbuAK+gJ2z4c FA+K1rrK1Y7ezmGM7iwt5CiPOy/trvtjrvsIZJrwBd0H1pxxsmQB18WKR1WdDsVlJwyb v1HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=SumGg4ML; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f25-20020a056402005900b0042aae0c55c3si13723029edu.224.2022.06.15.10.35.12; Wed, 15 Jun 2022 10:35:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=SumGg4ML; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346681AbiFORcT (ORCPT + 99 others); Wed, 15 Jun 2022 13:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356452AbiFORb4 (ORCPT ); Wed, 15 Jun 2022 13:31:56 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4AB253A43 for ; Wed, 15 Jun 2022 10:31:34 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id c2so17214236edf.5 for ; Wed, 15 Jun 2022 10:31:34 -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=w3YUx2QLwqjC4yt6Na4HDX+YOsTdcO8b9CpzZpDW+SU=; b=SumGg4ML2+ipUmc7XA+lq9lEeAMN0G+c1nkIb8xlQdeSVIXK7p8gchHLt4JMr6H2DB oay1lq5P2vRcbJXDcviUhEXtOuH0wnMLPDb9TSVPWMFmqsCzv/3C5/PS3UIUNxLhWLFF stiOnXVgBnI1zKc+m2gV4bh+ZP9jm2By0atDyoqFmq9V6owXGPdCIBexAyREiyN/lqWP sE0WUW66Z3ial6A4UoLjgKhJjd15EU91IEkibIDuhAx6QDoDtHXsAnahe4K9HdlDUCRk bV02tDWRCArcwrkIhFBPyvdeAp0V7KDoiMmXTmMmQR0oyvjc0mW2aORSBPxsiKFydKXZ joRQ== 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=w3YUx2QLwqjC4yt6Na4HDX+YOsTdcO8b9CpzZpDW+SU=; b=z/bUYWfqghRFRo4LKPNr9lSfFO2il7ve91+2z0dETAJidUujxF6uWxPttIjvHEK/NA oCtRgvWMIogAR59JdsR2U5ECDB1nnujZGLzTPt3fg0fqhtkmMxX9oJSUVxPBhFDTAR2e owqz9rG20+Hb+c6eoTlQHIks8qrr1SA/qBRoX6QLhfZ2dUPZL1Y3StER2AEUXa+uxQlh dSsVLfrJIocQIOQHnx/VqGvOK6LBDCpQGCTi23SwgnafzH5nvXST9P6cCv1gE/5kK7K1 uokvdl+FHfAPTGnl+AWEURYScRUYZlqtK2Ja9UvjyeCwZ6JyCfy3l/zUWwsQMliD1EI1 Errw== X-Gm-Message-State: AJIora9iLAtGkbj8Vk11w/qvuOYi6EG9iNkvWTj4OqUt2AN05k/UeX+d EmPsKLZasHRR6nw+rfHw5c7DHdqSwsmBYvda3/BTAw== X-Received: by 2002:a05:6402:3325:b0:42d:e1d8:99e9 with SMTP id e37-20020a056402332500b0042de1d899e9mr1033464eda.87.1655314293062; Wed, 15 Jun 2022 10:31:33 -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: Wed, 15 Jun 2022 10:31:21 -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=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 20, 2022 at 9:25 AM T.J. Mercier wrote: > > On Fri, May 20, 2022 at 12:47 AM Tejun Heo wrote: > > > > Hello, > > > > On Tue, May 17, 2022 at 04:30:29PM -0700, T.J. Mercier wrote: > > > 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. > > > > On its own, that's a pretty weak reason to be adding a separate gpu > > controller especially given that it doesn't really seem to be one with > > proper abstractions for gpu resources. We don't want to keep adding random > > keys to misc controller but can definitely add limited flexibility. What > > kind of keys do you need? > > > Well the dmabuf-from-heaps component of this is the initial use case. > I was envisioning we'd have additional keys as discussed here: > https://lore.kernel.org/lkml/20220328035951.1817417-1-tjmercier@google.com/T/#m82e5fe9d8674bb60160701e52dae4356fea2ddfa > So we'd end up with a well-defined core set of keys like "system", and > then drivers would be free to use their own keys for their own unique > purposes which could be complementary or orthogonal to the core set. > Yesterday I was talking with someone who is interested in limiting gpu > cores and bus IDs in addition to gpu memory. How to define core keys > is the part where it looks like there's trouble. > > For my use case it would be sufficient to have current and maximum > values for an arbitrary number of keys - one per heap. So the only > part missing from the misc controller (for my use case) is the ability > to register a new key at runtime as heaps are added. Instead of > keeping track of resources with enum misc_res_type, requesting a > resource handle/ID from the misc controller at runtime is what I think > would be required instead. > Quick update: I'm going to make an attempt to modify the misc controller to support a limited amount of dynamic resource registration/tracking in place of the new controller in this series. Thanks everyone for the feedback. -T.J. > > Thanks. > > > > -- > > tejun