From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6209DC43470 for ; Tue, 11 May 2021 15:48:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0BF87611BE for ; Tue, 11 May 2021 15:48:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BF87611BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D28A6EA6D; Tue, 11 May 2021 15:48:23 +0000 (UTC) Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 03E4B6EA6C; Tue, 11 May 2021 15:48:21 +0000 (UTC) Received: by mail-oo1-xc2d.google.com with SMTP id o202-20020a4a2cd30000b02901fcaada0306so4288470ooo.7; Tue, 11 May 2021 08:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5G3X0SsMYoBRSudd4/RxfVXt3YIGObL1pFXwXeHxFjA=; b=ergBPEMz0eajaLPXgWUA6rjor17KYhfwTmK2sOuzzDbXqsPIWtVRKjfxbIfzY9OkIc q0L2k0bcDQHmQnOLvySuWkGTMFVDa41heYsNZzJu0POZhOZPPGT8MDgenaetDOwBDhCO JZWEsqDG+G1ALmEIReIrhqYUxm/ZrRY7aAZPIYjXQJCm15gyHomQlJ2mOncSfwLSnUUn x2ltw4rw0iutyooHA0z3ND6QaxqyQb28rLR3pop34okjpBS4V5vtmt+PSopxAYHRWt8h +pljNqMcTsAXw3aWT6x7hsB4OHac8L/kKUSbwPj5bGCzHiu9F6Sx1u0g/8NXmUgau1Xk QhAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5G3X0SsMYoBRSudd4/RxfVXt3YIGObL1pFXwXeHxFjA=; b=nQIoXC1Rzi5AFpCx3YLXePcxyc+L9m0YMcDuR+3/N0d8fz8tfYRKJV7Shmq4mBhtWh nf/DT7CUjTNj9Q5QnUPYzsd2LWsLEXnQX5PcdGaYB8xYRUVHbnGlc6ST2TtOzsSoWBSl YkcT8+yz5Rq9ELQX43zsSBqZRes8nT0XgOnwA/uM22uklw5KL9c8YcS8jPDlwWXlblOc IrRXw5sX6p2PkHEkUcCwkHwxjqvJZF1+PMLTUs70P9pfD+OvQSw7TrJN69mbFsua+FHL uKs1lUIsgi9Jsi6pqzEIEP56yjMnjVZyLIe+iPJ53+9LXfBqZMJ1ED6pqGBNSmjb/cff swyQ== X-Gm-Message-State: AOAM532iglRIPO9RztUjjNdz37/bj5G7/+vYU+yw5zijTWI+7v3Y50YX Z7Lmt5lPGreAOei9hjlDPp8CmsTitSpgd2dqEVc= X-Google-Smtp-Source: ABdhPJzACYbQ8TvRjv21GKdTUAKZG5wgcKKCL8UftacLyBzooNVzwknDRupMyFB2bQaOxgOZJU1/+G22G6kfIOv1RJs= X-Received: by 2002:a4a:d085:: with SMTP id i5mr23978147oor.61.1620748101287; Tue, 11 May 2021 08:48:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alex Deucher Date: Tue, 11 May 2021 11:48:10 -0400 Message-ID: Subject: Re: [RFC] Add BPF_PROG_TYPE_CGROUP_IOCTL To: Tejun Heo Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Song Liu , Alexei Starovoitov , DRI Development , Alexei Starovoitov , Daniel Borkmann , Brian Welty , John Fastabend , amd-gfx list , Yonghong Song , Andrii Nakryiko , Linux-Fsdevel , Kenny Ho , Alexander Viro , KP Singh , "open list:CONTROL GROUP \(CGROUP\)" , Kenny Ho , Network Development , Alex Deucher , bpf , Martin KaFai Lau Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, May 7, 2021 at 7:45 PM Tejun Heo wrote: > > Hello, > > On Fri, May 07, 2021 at 06:30:56PM -0400, Alex Deucher wrote: > > Maybe we are speaking past each other. I'm not following. We got > > here because a device specific cgroup didn't make sense. With my > > Linux user hat on, that makes sense. I don't want to write code to a > > bunch of device specific interfaces if I can avoid it. But as for > > temporal vs spatial partitioning of the GPU, the argument seems to be > > a sort of hand-wavy one that both spatial and temporal partitioning > > make sense on CPUs, but only temporal partitioning makes sense on > > GPUs. I'm trying to understand that assertion. There are some GPUs > > Spatial partitioning as implemented in cpuset isn't a desirable model. It's > there partly because it has historically been there. It doesn't really > require dynamic hierarchical distribution of anything and is more of a way > to batch-update per-task configuration, which is how it's actually > implemented. It's broken too in that it interferes with per-task affinity > settings. So, not exactly a good example to follow. In addition, this sort > of partitioning requires more hardware knowledge and GPUs are worse than > CPUs in that hardwares differ more. > > Features like this are trivial to implement from userland side by making > per-process settings inheritable and restricting who can update the > settings. > > > that can more easily be temporally partitioned and some that can be > > more easily spatially partitioned. It doesn't seem any different than > > CPUs. > > Right, it doesn't really matter how the resource is distributed. What > matters is how granular and generic the distribution can be. If gpus can > implement work-conserving proportional distribution, that's something which > is widely useful and inherently requires dynamic scheduling from kernel > side. If it's about setting per-vendor affinities, this is way too much > cgroup interface for a feature which can be easily implemented outside > cgroup. Just do per-process (or whatever handles gpus use) and confine their > configurations from cgroup side however way. > > While the specific theme changes a bit, we're basically having the same > discussion with the same conclusion over the past however many months. > Hopefully, the point is clear by now. Thanks, that helps a lot. Alex