Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3428510pxp; Tue, 22 Mar 2022 20:37:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV0KnKCYqpAxocXBpdAXdRohBCYdINhXGz9Ed8kq0G+gqaAQBm3bVSsYD9nLJtwYZd4oF1 X-Received: by 2002:a17:90a:de98:b0:1c7:1bed:67f7 with SMTP id n24-20020a17090ade9800b001c71bed67f7mr9098019pjv.199.1648006673704; Tue, 22 Mar 2022 20:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648006673; cv=none; d=google.com; s=arc-20160816; b=myjlu5H5mL5bRt7f/av9orJlnvM/hPxFYQuchrzi4L90i/4IhYlM/yWwqt4tHsvMfk Li2EbJBPu1IH9VQtk8lbKJZxYB1frZHJFuX09hKVaeO2VT9QPMs/z+h2xtTNy2+Vgxg1 0EWxMdR/wf11fRHJLYDucdMch6kxeSQ57YossKtNKtOxxj/3CtZl8B2hDCT25BZF1CMJ oVD9sauEmFrX+yVT5B4I+vBDkCjy102MdeHmyqmN69PFGaH49GqfF+Co1Q1rTPgvoIkZ RYWMJzA1LfAaDoFfkV74R21oFdfsoOF18KIv+bommq5fw8W2wjmWT1y50ODRV4gA0gN6 QE7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=nlDmFglz7whj/r0GBRKFJ24ATNTxPzzUgtpMW7485f4=; b=pyTdqyfh/xoX7iiUGKh9wLhMvL+PWLb1jsvj7Ik4EMogmUUu0urj5ef2bjJg8/doJ4 FiIu1E7zzAa1jL66y4qt2hiCjhgJBMfDv4GsmVzanH83S/hfpGDiYnS8s25x4IbC9Kql HnKG+TNdZnHFzPCg1sh2F2ApTuJPGbaFtQ0lk6nBMwkAiBi5Db6f4pxC2WsBd1m7AcYv AB+apIwuz392jps7I2HqwhZyta8BGLsBPvTyaRe/md95W/KM39ZLmFeh1FxUIJsZVg/Z ea0DTkDVMcKan2o5mMOElRzWe7H8ZhMKhBLztZScGAAL9V8/ocXXFEJ4h8ck0/A+4kk/ okqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=CND1Tv8y; 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 10-20020a170902e9ca00b00153b2d16472si13875025plk.122.2022.03.22.20.37.37; Tue, 22 Mar 2022 20:37:53 -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=CND1Tv8y; 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 S238702AbiCVPnj (ORCPT + 99 others); Tue, 22 Mar 2022 11:43:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238704AbiCVPnh (ORCPT ); Tue, 22 Mar 2022 11:43:37 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D17638BF71 for ; Tue, 22 Mar 2022 08:42:08 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id t1so22159461edc.3 for ; Tue, 22 Mar 2022 08:42:08 -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:content-transfer-encoding; bh=nlDmFglz7whj/r0GBRKFJ24ATNTxPzzUgtpMW7485f4=; b=CND1Tv8y6h1wN3nXUQIKzu8LJkbk/862t1GsMuYd+VkdxovrTkb3al98dhDbupbe12 QXuRoX6v14abx56NU7QF+9NGYzOFXPjIFilEb5iGh5vpslTno0fzKgvJfg5koKbmHz5d vYj7LoRwC6XkP+3DLboyZVHpk8OUGbhumdqo9fqMS2jco8PbB4d+WrP5GBaK+jgACVjc H3mKuCT2WW6HfHHoK5gzbP10+klCOPRsnAr11BVA7ZEnncpigY41CsoHDPS8S3Dlr0Ns iZHZ/WcuewTT+kVQ6KA2kKz4zO/JxPoHq3uYjMYs2gCqp960E+gWubc8R1ajqLYXIZYY OQZg== 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:content-transfer-encoding; bh=nlDmFglz7whj/r0GBRKFJ24ATNTxPzzUgtpMW7485f4=; b=vdreATs52rQ11cMJBCFxfO/bBbw48AelLQthFVADKRhJpqHJg5Ytcoj3l4PWelT5i1 vwlwy6FZw7k6U/AkuQqw6NpTOWUMrA1WUrg1/bfwhaukh5RjcjlHAQtj+5hvqxSlu0RM 1E1N5PJCnbtkPq+A3uj8DaJnW7Z6fL7MidF23yol+HiEuDE7WDS0FAw9H3BzFwHKv47V 8w8tAKkyRIa/5aH4J3uI19W3zp4YQu7j8OOU23P/1RQrOJvsqLp6HSwpxiksTQBkZsh2 8B/ZAWwfLfedZ/YR8DNj9xwjNEdHcNj+wUz/sJJJ9o2UyPvxGpyh4PbZgtiZinrUvATb yARA== X-Gm-Message-State: AOAM532ZYKJ+mW95dYjXRYqpW7waAXRW6RJA0UTvay6V1OObK+XLcdb/ ikWjhGV1e3ljfA4Fft88fNqVNGqcuoAxe3WkKyDYPQ== X-Received: by 2002:a05:6402:1e96:b0:418:ff57:ada2 with SMTP id f22-20020a0564021e9600b00418ff57ada2mr27039663edf.197.1647963727136; Tue, 22 Mar 2022 08:42:07 -0700 (PDT) MIME-Version: 1.0 References: <20220309165222.2843651-1-tjmercier@google.com> <20220309165222.2843651-2-tjmercier@google.com> <20220321173726.GA9640@blackbody.suse.cz> In-Reply-To: <20220321173726.GA9640@blackbody.suse.cz> From: "T.J. Mercier" Date: Tue, 22 Mar 2022 08:41:55 -0700 Message-ID: Subject: Re: [RFC v3 1/8] gpu: rfc: Proposal for a GPU cgroup controller To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , 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 , Tejun Heo , Zefan Li , Johannes Weiner , Shuah Khan , Kalesh Singh , Kenny.Ho@amd.com, dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=unavailable 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 Mon, Mar 21, 2022 at 10:37 AM Michal Koutn=C3=BD wrot= e: > > Hello. > > On Wed, Mar 09, 2022 at 04:52:11PM +0000, "T.J. Mercier" wrote: > > +The new cgroup controller would: > > + > > +* Allow setting per-cgroup limits on the total size of buffers charged= to it. > > What is the meaning of the total? (I only have very na=C3=AFve > understanding of the device buffers.) So "total" is used twice here in two different contexts. The first one is the global "GPU" cgroup context. As in any buffer that any exporter claims is a GPU buffer, regardless of where/how it is allocated. So this refers to the sum of all gpu buffers of any type/source. An exporter contributes to this total by registering a corresponding gpucg_device and making charges against that device when it exports. The second one is in a per device context. This allows us to make a distinction between different types of GPU memory based on who exported the buffer. A single process can make use of several different types of dma buffers (for example cached and uncached versions of the same type of memory), and it would be useful to have different limits for each. These are distinguished by the device name string chosen when the gpucg_device is first registered. > > Is it like a) there's global pool of memory that is partitioned among > individual devices or b) each device has its own specific type of memory > and adding across two devices is adding apples and oranges or c) there > can be various devices both of a) and b) type? So I guess the most correct answer to this question is c. > > (Apologies not replying to previous versions and possibly missing > anything.) > > Thanks, > Michal >