Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7740714rwr; Wed, 10 May 2023 11:58:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Z+0MArfHMB8c5Yf77pBSH4a9g+9kOanXYhkbbGK0iTHMEf5hCgCf/mD4VNKJYFGEGf2zg X-Received: by 2002:a05:6a00:1902:b0:63f:4a9:679b with SMTP id y2-20020a056a00190200b0063f04a9679bmr24027811pfi.15.1683745084003; Wed, 10 May 2023 11:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683745083; cv=none; d=google.com; s=arc-20160816; b=gST1M/HWodbuznz+moWxZhShAKdGgpD8rTZFC9wgVrdmSN2YavypzG3UIMAr9+OSk1 NNPuPfvmbncLlptCRmD9UdfNcXCZurY2qcgBFJSNg7KleXdrrtVNiyv5mRi54EI7iIHw QifoAP1FWeO37k9JQDmmUgo0LG9pCyBBB7hvEN/hnRJcOMnXRntBEa7gW0Id/vwij+PV oOJum/nbhgV5ysqSdzpWD6TtP6rxNm3ZGkT9TwbArQPeS4l5sTbASOhFfKcWTwqSQPs1 jkdwdiLoaIPAgpq4hlHS+VMYneucS/o2BtY72mBS1QqvBqlDDoWrt8wAOKZgLkRweoQs 9leg== 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=5fuvzbzfAPaWz0F0qnb+ng0M3t+DRDPEy+SEvx5Zlpw=; b=h489OEj0NOW8vSMDqeST700Nsf4tUoIkx+WXcga3FnCOAaxVLuYWe5Z3dAevqfI55N bZkawmLZW/IxagJCqqZXckFF5fh2KuHj8uf8ZNKiDpWvs87Jr5cqUj+XjeoOUW74ffCr ZDhUKm6Dh94GDRCO2+Nimv79Px6jTyxV9fIdf1eUrWduG7xBFvrZSNcBk7j11e/y/zLe rD9odJJmr40/PAZbzorZPEJSqD5Iai81tSqTDaWrSsf+nu8oKRxAwE88qbx0NduMmq+v zlVjiCjHxx5H/xQkXAwIxcdm8HRDXpURmvzD0pKgLsMR656uUFtixLsaZ748mAJ66gMB RTew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="WaX/lA3Y"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020aa79f0f000000b006439d46853dsi5341436pfr.364.2023.05.10.11.57.49; Wed, 10 May 2023 11:58:03 -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=@gmail.com header.s=20221208 header.b="WaX/lA3Y"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229468AbjEJSqI (ORCPT + 99 others); Wed, 10 May 2023 14:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjEJSqG (ORCPT ); Wed, 10 May 2023 14:46:06 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17ED5E4A; Wed, 10 May 2023 11:46:03 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-643990c5319so5423419b3a.2; Wed, 10 May 2023 11:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683744362; x=1686336362; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=5fuvzbzfAPaWz0F0qnb+ng0M3t+DRDPEy+SEvx5Zlpw=; b=WaX/lA3Y5RC6vqi8Gstz4xLqZDGmFXeG7a3rgiWsDu5hUwAToAZzkqoYMo1FT7KjnA ARUu3pTtOMc7WAoU2YOH9cnEDLX7dlPp5Fk+vl639nloA3cqkDUb96asyf9ZQw15ihXz nIf9q2YeVZUyrcSMtyeAkgoRbV+oLyls91sRKUg2xusZZZ3Ihxuq/x0/E/g2898K6qQY NY2fYU0eav3eoftoQ/+ak267O1ldNVnrMhtexIpFA1GoP5llXOIGlF9JxtpQi2ToH3Sb zXx6m0I8PgYy7bI06tjMymfporVo62Z/NoPWgDzh1wszI52lSrupgJLtKhGceUulCGBv Mj0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683744362; x=1686336362; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5fuvzbzfAPaWz0F0qnb+ng0M3t+DRDPEy+SEvx5Zlpw=; b=UoLxfsrl7keY7Y8M8rv+RYcFU/QWgIEu5qr1gpAmnry9n/50dC3JYz3fDbuOzEpJzX kvE6UfiHHXphUXOrzIVR8pRHMyJmQi2CD+kX6ljgch8dlid51FpZDqtbxzISlbEBziFU Ce3aBmjeEgpsa3UgiQePQ5y4rdZp3NBHBpcRuOMYLaVY/B6XBZFpIwdm+nH5p+h7vqnK sXsMmxF4dKKQE3UnSiJ5jlJACFmCR8S1U6qbDQbn+rR16+fbxuEs0DmwB2q08usxrNGA ht0Eawm4M6PIsd+MUH//u0SPFhYgSlekhGsQ9paq24q27vkHkYZHUdkHoH2arRyzwfTH Ozgg== X-Gm-Message-State: AC+VfDyKfgwFW7pZj/9B+z4thFGtsaKbCSWezHnyQlGNGEiblfHuIGiR W0RzrOiTDgXKEd46Dss1VWY= X-Received: by 2002:a17:902:ce86:b0:1ad:c1c2:7d14 with SMTP id f6-20020a170902ce8600b001adc1c27d14mr224531plg.46.1683744362257; Wed, 10 May 2023 11:46:02 -0700 (PDT) Received: from localhost (2603-800c-1a02-1bae-a7fa-157f-969a-4cde.res6.spectrum.com. [2603:800c:1a02:1bae:a7fa:157f:969a:4cde]) by smtp.gmail.com with ESMTPSA id i3-20020a17090332c300b001ac4d3d3f72sm4130469plr.296.2023.05.10.11.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 11:46:01 -0700 (PDT) Sender: Tejun Heo Date: Wed, 10 May 2023 08:46:00 -1000 From: Tejun Heo To: Maarten Lankhorst Cc: dri-devel@lists.freedesktop.org, cgroups@vger.kernel.org, intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Zefan Li , Johannes Weiner , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, Maxime Ripard , Thomas Zimmermann , Tvrtko Ursulin Subject: Re: [RFC PATCH 0/4] Add support for DRM cgroup memory accounting. Message-ID: References: <20230503083500.645848-1-maarten.lankhorst@linux.intel.com> <4d6fbce3-a676-f648-7a09-6f6dcc4bdb46@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4d6fbce3-a676-f648-7a09-6f6dcc4bdb46@linux.intel.com> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,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 Wed, May 10, 2023 at 04:59:01PM +0200, Maarten Lankhorst wrote: > The misc controller is not granular enough. A single computer may have any number of > graphics cards, some of them with multiple regions of vram inside a single card. Extending the misc controller to support dynamic keys shouldn't be that difficult. ... > In the next version, I will move all the code for handling the resource limit to > TTM's eviction layer, because otherwise it cannot handle the resource limit correctly. > > The effect of moving the code to TTM, is that it will make the code even more generic > for drivers that have vram and use TTM. When using TTM, you only have to describe your > VRAM, update some fields in the TTM manager and (un)register your device with the > cgroup handler on (un)load. It's quite trivial to add vram accounting to amdgpu and > nouveau. [2] > > If you want to add a knob for scheduling weight for a process, it makes sense to > also add resource usage as a knob, otherwise the effect of that knob is very > limited. So even for Tvrtko's original proposed usecase, it would make sense. It does make sense but unlike Tvrtko's scheduling weights what's being proposed doesn't seem to encapsulate GPU memory resource in a generic enough manner at least to my untrained eyes. ie. w/ drm.weight, I don't need any specific knoweldge of how a specific GPU operates to say "this guy should get 2x processing power over that guy". This more or less holds for other major resources including CPU, memory and IO. What you're proposing seems a lot more tied to hardware details and users would have to know a lot more about how memory is configured on that particular GPU. Now, if this is inherent to how all, or at least most, GPUs operate, sure, but otherwise let's start small in terms of interface and not take up space which should be for something universal. If this turns out to be the way, expanding to take up the generic interface space isn't difficult. I don't know GPU space so please educate me where I'm wrong. Thanks. -- tejun