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=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 2C094C433B4 for ; Fri, 7 May 2021 16:31:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4B0F61474 for ; Fri, 7 May 2021 16:31:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238189AbhEGQcN (ORCPT ); Fri, 7 May 2021 12:32:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238182AbhEGQcN (ORCPT ); Fri, 7 May 2021 12:32:13 -0400 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56EC3C061761; Fri, 7 May 2021 09:31:12 -0700 (PDT) Received: by mail-ot1-x32c.google.com with SMTP id g15-20020a9d128f0000b02902a7d7a7bb6eso8383272otg.9; Fri, 07 May 2021 09:31:12 -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=hx5tna4nzB7jKuF4FCr0NopoQzyi09okT96ojHt20zo=; b=mKpdHWNfr1Dd8mEbwdRXjXKjQ9ZnQcm37bzty/pAVsU56+wCG+c1E0fWrWuhjJMff4 dEEH/vSrxuvcHIVBiHl3OidHkIkpOEWdWnV33NqB1LBKNuCpj4ATMc2gT0FL9krWhbiC HgjVAudPrHcGs1FXgP0/oqpwJZtXj1FB0XWhJyFwtZzjNf0HRBruUENbSB+oatZNUIjK i079Q4DG1UM4/MHstW2P9ohn+qZ1bJlCkxyC6Ow81bmcCTa7pyavlMqg6Oa+kTs5Xgmb GRVuEpUGXdbrqzgtRhmimyp09xGm5QDSRNteqv0P0nebXllLNsxjdTJHW8GFBUelBJFG oZww== 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=hx5tna4nzB7jKuF4FCr0NopoQzyi09okT96ojHt20zo=; b=YEjLDw1/j5Iwih8F5sEZAlZk5zcMIyuc8NcoWJy4Tkv8HZoSnTvIewdohUUNZUTivD LtM2WjkkdjudQuzseG0ZjFoW4fPSroIVpq+OkjVs1HMhhdt/aKxdEqfEn+qVlT2cJPL9 l1FKJ3JKrtiRN77yvBpeCgsLd89/55FsdiOQP+EduADB8UwS9HL9Pi9pE9Gl2FNkANUo +yXcUUP6NRI267cyzL+5ocHMsMcXj8XF/SdSZYLiIxLa9zN7fFdxRAcJCRteVJ53lzXI 9SfrqmH9MeleKiJoBoe3eVYYvfjJnURiOEUSBc4enpKR/bB2fWqPQV1EZ92STe1Ggiol KLpg== X-Gm-Message-State: AOAM5321mrjybnpuTcOZLasuM7KqRYYIo3+wk0GNjiuTWZJx6yjEMz7O 93+Xm7SwPMGprvvkKb2ZLam+b3FD6y/v7eHL9gHDzyjM X-Google-Smtp-Source: ABdhPJzHk3GvNki3GqrXmIUWmsJPojMKQonM7rWvTKf53122oNu+q8OIZOtMkI9rlfFnSo0oh3X+wI09VxIUTyB5r0c= X-Received: by 2002:a05:6830:1f12:: with SMTP id u18mr9247853otg.132.1620405071706; Fri, 07 May 2021 09:31:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alex Deucher Date: Fri, 7 May 2021 12:31:00 -0400 Message-ID: Subject: Re: [RFC] Add BPF_PROG_TYPE_CGROUP_IOCTL To: Daniel Vetter Cc: Kenny Ho , Song Liu , Andrii Nakryiko , DRI Development , Daniel Borkmann , Kenny Ho , "open list:CONTROL GROUP (CGROUP)" , Brian Welty , John Fastabend , Alexei Starovoitov , amd-gfx list , Martin KaFai Lau , Linux-Fsdevel , Alexander Viro , Network Development , KP Singh , Yonghong Song , bpf , Dave Airlie , Alexei Starovoitov , Alex Deucher Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Fri, May 7, 2021 at 12:26 PM Daniel Vetter wrote: > > On Fri, May 07, 2021 at 12:19:13PM -0400, Alex Deucher wrote: > > On Fri, May 7, 2021 at 12:13 PM Daniel Vetter wrote: > > > > > > On Fri, May 07, 2021 at 11:33:46AM -0400, Kenny Ho wrote: > > > > On Fri, May 7, 2021 at 4:59 AM Daniel Vetter wrote: > > > > > > > > > > Hm I missed that. I feel like time-sliced-of-a-whole gpu is the easier gpu > > > > > cgroups controler to get started, since it's much closer to other cgroups > > > > > that control bandwidth of some kind. Whether it's i/o bandwidth or compute > > > > > bandwidht is kinda a wash. > > > > sriov/time-sliced-of-a-whole gpu does not really need a cgroup > > > > interface since each slice appears as a stand alone device. This is > > > > already in production (not using cgroup) with users. The cgroup > > > > proposal has always been parallel to that in many sense: 1) spatial > > > > partitioning as an independent but equally valid use case as time > > > > sharing, 2) sub-device resource control as opposed to full device > > > > control motivated by the workload characterization paper. It was > > > > never about time vs space in terms of use cases but having new API for > > > > users to be able to do spatial subdevice partitioning. > > > > > > > > > CU mask feels a lot more like an isolation/guaranteed forward progress > > > > > kind of thing, and I suspect that's always going to be a lot more gpu hw > > > > > specific than anything we can reasonably put into a general cgroups > > > > > controller. > > > > The first half is correct but I disagree with the conclusion. The > > > > analogy I would use is multi-core CPU. The capability of individual > > > > CPU cores, core count and core arrangement may be hw specific but > > > > there are general interfaces to support selection of these cores. CU > > > > mask may be hw specific but spatial partitioning as an idea is not. > > > > Most gpu vendors have the concept of sub-device compute units (EU, SE, > > > > etc.); OpenCL has the concept of subdevice in the language. I don't > > > > see any obstacle for vendors to implement spatial partitioning just > > > > like many CPU vendors support the idea of multi-core. > > > > > > > > > Also for the time slice cgroups thing, can you pls give me pointers to > > > > > these old patches that had it, and how it's done? I very obviously missed > > > > > that part. > > > > I think you misunderstood what I wrote earlier. The original proposal > > > > was about spatial partitioning of subdevice resources not time sharing > > > > using cgroup (since time sharing is already supported elsewhere.) > > > > > > Well SRIOV time-sharing is for virtualization. cgroups is for > > > containerization, which is just virtualization but with less overhead and > > > more security bugs. > > > > > > More or less. > > > > > > So either I get things still wrong, or we'll get time-sharing for > > > virtualization, and partitioning of CU for containerization. That doesn't > > > make that much sense to me. > > > > You could still potentially do SR-IOV for containerization. You'd > > just pass one of the PCI VFs (virtual functions) to the container and > > you'd automatically get the time slice. I don't see why cgroups would > > be a factor there. > > Standard interface to manage that time-slicing. I guess for SRIOV it's all > vendor sauce (intel as guilty as anyone else from what I can see), but for > cgroups that feels like it's falling a bit short of what we should aim > for. > > But dunno, maybe I'm just dreaming too much :-) I don't disagree, I'm just not sure how it would apply to SR-IOV. Once you've created the virtual functions, you've already created the partitioning (regardless of whether it's spatial or temporal) so where would cgroups come into play? Alex > -Daniel > > > Alex > > > > > > > > Since time-sharing is the first thing that's done for virtualization I > > > think it's probably also the most reasonable to start with for containers. > > > -Daniel > > > -- > > > Daniel Vetter > > > Software Engineer, Intel Corporation > > > http://blog.ffwll.ch > > > _______________________________________________ > > > amd-gfx mailing list > > > amd-gfx@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch 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.5 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, URIBL_BLOCKED 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 96E2AC43461 for ; Fri, 7 May 2021 16:31:15 +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 42E4061468 for ; Fri, 7 May 2021 16:31:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 42E4061468 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 5C7176EE70; Fri, 7 May 2021 16:31:14 +0000 (UTC) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A7CA6E2A3; Fri, 7 May 2021 16:31:12 +0000 (UTC) Received: by mail-ot1-x330.google.com with SMTP id u19-20020a0568302493b02902d61b0d29adso7607048ots.10; Fri, 07 May 2021 09:31:12 -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=hx5tna4nzB7jKuF4FCr0NopoQzyi09okT96ojHt20zo=; b=mKpdHWNfr1Dd8mEbwdRXjXKjQ9ZnQcm37bzty/pAVsU56+wCG+c1E0fWrWuhjJMff4 dEEH/vSrxuvcHIVBiHl3OidHkIkpOEWdWnV33NqB1LBKNuCpj4ATMc2gT0FL9krWhbiC HgjVAudPrHcGs1FXgP0/oqpwJZtXj1FB0XWhJyFwtZzjNf0HRBruUENbSB+oatZNUIjK i079Q4DG1UM4/MHstW2P9ohn+qZ1bJlCkxyC6Ow81bmcCTa7pyavlMqg6Oa+kTs5Xgmb GRVuEpUGXdbrqzgtRhmimyp09xGm5QDSRNteqv0P0nebXllLNsxjdTJHW8GFBUelBJFG oZww== 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=hx5tna4nzB7jKuF4FCr0NopoQzyi09okT96ojHt20zo=; b=tzcwXTs1TGXIruyNcvWDKdMIc3OdbmCjmKKPoCv2rJBQNQYxgQi6pylfKVEGsSJ6tU N31yVC3eJitCYv+95b4y1aoJfS9pkq5ErEkuOAycser4JHTVOP2kgZuxfQqlGmTStLcX ib2QdywyQ/0HRzsMVwa2gqZquzm+QeRES9GyGT94paD4EntEA2ZkUgaTYSYhrjONqI4Y 7x4rtNNb1jW/Rqa027cmWkAcPRskJBtVe6NsVHiUftBS7xJT1p2qBBAE8ptSsvr6mgeF snkzo1sg5f+YYMA2syx6fUx9l0rUyfO/ogaDSIreH9BllLTiGK2oGyjwzNqvbqs5xtsP ePXA== X-Gm-Message-State: AOAM531aP5WAsntOR8BB9HeWv6gGp+JzDfReqQmJeQoed/JeVq5tdzn0 SArsKBp68Z0PHnUI6leJcleOQUCeETI5IrFjpig= X-Google-Smtp-Source: ABdhPJzHk3GvNki3GqrXmIUWmsJPojMKQonM7rWvTKf53122oNu+q8OIZOtMkI9rlfFnSo0oh3X+wI09VxIUTyB5r0c= X-Received: by 2002:a05:6830:1f12:: with SMTP id u18mr9247853otg.132.1620405071706; Fri, 07 May 2021 09:31:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alex Deucher Date: Fri, 7 May 2021 12:31:00 -0400 Message-ID: Subject: Re: [RFC] Add BPF_PROG_TYPE_CGROUP_IOCTL To: Daniel Vetter 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 , Daniel Borkmann , Kenny Ho , Brian Welty , John Fastabend , Alexei Starovoitov , DRI Development , Alexei Starovoitov , Yonghong Song , KP Singh , Kenny Ho , amd-gfx list , Network Development , Linux-Fsdevel , "open list:CONTROL GROUP \(CGROUP\)" , bpf , Andrii Nakryiko , Martin KaFai Lau , Alex Deucher , Alexander Viro Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, May 7, 2021 at 12:26 PM Daniel Vetter wrote: > > On Fri, May 07, 2021 at 12:19:13PM -0400, Alex Deucher wrote: > > On Fri, May 7, 2021 at 12:13 PM Daniel Vetter wrote: > > > > > > On Fri, May 07, 2021 at 11:33:46AM -0400, Kenny Ho wrote: > > > > On Fri, May 7, 2021 at 4:59 AM Daniel Vetter wrote: > > > > > > > > > > Hm I missed that. I feel like time-sliced-of-a-whole gpu is the easier gpu > > > > > cgroups controler to get started, since it's much closer to other cgroups > > > > > that control bandwidth of some kind. Whether it's i/o bandwidth or compute > > > > > bandwidht is kinda a wash. > > > > sriov/time-sliced-of-a-whole gpu does not really need a cgroup > > > > interface since each slice appears as a stand alone device. This is > > > > already in production (not using cgroup) with users. The cgroup > > > > proposal has always been parallel to that in many sense: 1) spatial > > > > partitioning as an independent but equally valid use case as time > > > > sharing, 2) sub-device resource control as opposed to full device > > > > control motivated by the workload characterization paper. It was > > > > never about time vs space in terms of use cases but having new API for > > > > users to be able to do spatial subdevice partitioning. > > > > > > > > > CU mask feels a lot more like an isolation/guaranteed forward progress > > > > > kind of thing, and I suspect that's always going to be a lot more gpu hw > > > > > specific than anything we can reasonably put into a general cgroups > > > > > controller. > > > > The first half is correct but I disagree with the conclusion. The > > > > analogy I would use is multi-core CPU. The capability of individual > > > > CPU cores, core count and core arrangement may be hw specific but > > > > there are general interfaces to support selection of these cores. CU > > > > mask may be hw specific but spatial partitioning as an idea is not. > > > > Most gpu vendors have the concept of sub-device compute units (EU, SE, > > > > etc.); OpenCL has the concept of subdevice in the language. I don't > > > > see any obstacle for vendors to implement spatial partitioning just > > > > like many CPU vendors support the idea of multi-core. > > > > > > > > > Also for the time slice cgroups thing, can you pls give me pointers to > > > > > these old patches that had it, and how it's done? I very obviously missed > > > > > that part. > > > > I think you misunderstood what I wrote earlier. The original proposal > > > > was about spatial partitioning of subdevice resources not time sharing > > > > using cgroup (since time sharing is already supported elsewhere.) > > > > > > Well SRIOV time-sharing is for virtualization. cgroups is for > > > containerization, which is just virtualization but with less overhead and > > > more security bugs. > > > > > > More or less. > > > > > > So either I get things still wrong, or we'll get time-sharing for > > > virtualization, and partitioning of CU for containerization. That doesn't > > > make that much sense to me. > > > > You could still potentially do SR-IOV for containerization. You'd > > just pass one of the PCI VFs (virtual functions) to the container and > > you'd automatically get the time slice. I don't see why cgroups would > > be a factor there. > > Standard interface to manage that time-slicing. I guess for SRIOV it's all > vendor sauce (intel as guilty as anyone else from what I can see), but for > cgroups that feels like it's falling a bit short of what we should aim > for. > > But dunno, maybe I'm just dreaming too much :-) I don't disagree, I'm just not sure how it would apply to SR-IOV. Once you've created the virtual functions, you've already created the partitioning (regardless of whether it's spatial or temporal) so where would cgroups come into play? Alex > -Daniel > > > Alex > > > > > > > > Since time-sharing is the first thing that's done for virtualization I > > > think it's probably also the most reasonable to start with for containers. > > > -Daniel > > > -- > > > Daniel Vetter > > > Software Engineer, Intel Corporation > > > http://blog.ffwll.ch > > > _______________________________________________ > > > amd-gfx mailing list > > > amd-gfx@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch 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.5 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, URIBL_BLOCKED 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 345DDC43460 for ; Fri, 7 May 2021 16:31:15 +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 CCF4C61468 for ; Fri, 7 May 2021 16:31:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCF4C61468 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 26DF86E2A3; Fri, 7 May 2021 16:31:14 +0000 (UTC) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A7CA6E2A3; Fri, 7 May 2021 16:31:12 +0000 (UTC) Received: by mail-ot1-x330.google.com with SMTP id u19-20020a0568302493b02902d61b0d29adso7607048ots.10; Fri, 07 May 2021 09:31:12 -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=hx5tna4nzB7jKuF4FCr0NopoQzyi09okT96ojHt20zo=; b=mKpdHWNfr1Dd8mEbwdRXjXKjQ9ZnQcm37bzty/pAVsU56+wCG+c1E0fWrWuhjJMff4 dEEH/vSrxuvcHIVBiHl3OidHkIkpOEWdWnV33NqB1LBKNuCpj4ATMc2gT0FL9krWhbiC HgjVAudPrHcGs1FXgP0/oqpwJZtXj1FB0XWhJyFwtZzjNf0HRBruUENbSB+oatZNUIjK i079Q4DG1UM4/MHstW2P9ohn+qZ1bJlCkxyC6Ow81bmcCTa7pyavlMqg6Oa+kTs5Xgmb GRVuEpUGXdbrqzgtRhmimyp09xGm5QDSRNteqv0P0nebXllLNsxjdTJHW8GFBUelBJFG oZww== 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=hx5tna4nzB7jKuF4FCr0NopoQzyi09okT96ojHt20zo=; b=tzcwXTs1TGXIruyNcvWDKdMIc3OdbmCjmKKPoCv2rJBQNQYxgQi6pylfKVEGsSJ6tU N31yVC3eJitCYv+95b4y1aoJfS9pkq5ErEkuOAycser4JHTVOP2kgZuxfQqlGmTStLcX ib2QdywyQ/0HRzsMVwa2gqZquzm+QeRES9GyGT94paD4EntEA2ZkUgaTYSYhrjONqI4Y 7x4rtNNb1jW/Rqa027cmWkAcPRskJBtVe6NsVHiUftBS7xJT1p2qBBAE8ptSsvr6mgeF snkzo1sg5f+YYMA2syx6fUx9l0rUyfO/ogaDSIreH9BllLTiGK2oGyjwzNqvbqs5xtsP ePXA== X-Gm-Message-State: AOAM531aP5WAsntOR8BB9HeWv6gGp+JzDfReqQmJeQoed/JeVq5tdzn0 SArsKBp68Z0PHnUI6leJcleOQUCeETI5IrFjpig= X-Google-Smtp-Source: ABdhPJzHk3GvNki3GqrXmIUWmsJPojMKQonM7rWvTKf53122oNu+q8OIZOtMkI9rlfFnSo0oh3X+wI09VxIUTyB5r0c= X-Received: by 2002:a05:6830:1f12:: with SMTP id u18mr9247853otg.132.1620405071706; Fri, 07 May 2021 09:31:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alex Deucher Date: Fri, 7 May 2021 12:31:00 -0400 Message-ID: Subject: Re: [RFC] Add BPF_PROG_TYPE_CGROUP_IOCTL To: Daniel Vetter X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Song Liu , Daniel Borkmann , Kenny Ho , Brian Welty , John Fastabend , Alexei Starovoitov , DRI Development , Alexei Starovoitov , Yonghong Song , KP Singh , Kenny Ho , amd-gfx list , Dave Airlie , Network Development , Linux-Fsdevel , "open list:CONTROL GROUP \(CGROUP\)" , bpf , Andrii Nakryiko , Martin KaFai Lau , Alex Deucher , Alexander Viro Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Fri, May 7, 2021 at 12:26 PM Daniel Vetter wrote: > > On Fri, May 07, 2021 at 12:19:13PM -0400, Alex Deucher wrote: > > On Fri, May 7, 2021 at 12:13 PM Daniel Vetter wrote: > > > > > > On Fri, May 07, 2021 at 11:33:46AM -0400, Kenny Ho wrote: > > > > On Fri, May 7, 2021 at 4:59 AM Daniel Vetter wrote: > > > > > > > > > > Hm I missed that. I feel like time-sliced-of-a-whole gpu is the easier gpu > > > > > cgroups controler to get started, since it's much closer to other cgroups > > > > > that control bandwidth of some kind. Whether it's i/o bandwidth or compute > > > > > bandwidht is kinda a wash. > > > > sriov/time-sliced-of-a-whole gpu does not really need a cgroup > > > > interface since each slice appears as a stand alone device. This is > > > > already in production (not using cgroup) with users. The cgroup > > > > proposal has always been parallel to that in many sense: 1) spatial > > > > partitioning as an independent but equally valid use case as time > > > > sharing, 2) sub-device resource control as opposed to full device > > > > control motivated by the workload characterization paper. It was > > > > never about time vs space in terms of use cases but having new API for > > > > users to be able to do spatial subdevice partitioning. > > > > > > > > > CU mask feels a lot more like an isolation/guaranteed forward progress > > > > > kind of thing, and I suspect that's always going to be a lot more gpu hw > > > > > specific than anything we can reasonably put into a general cgroups > > > > > controller. > > > > The first half is correct but I disagree with the conclusion. The > > > > analogy I would use is multi-core CPU. The capability of individual > > > > CPU cores, core count and core arrangement may be hw specific but > > > > there are general interfaces to support selection of these cores. CU > > > > mask may be hw specific but spatial partitioning as an idea is not. > > > > Most gpu vendors have the concept of sub-device compute units (EU, SE, > > > > etc.); OpenCL has the concept of subdevice in the language. I don't > > > > see any obstacle for vendors to implement spatial partitioning just > > > > like many CPU vendors support the idea of multi-core. > > > > > > > > > Also for the time slice cgroups thing, can you pls give me pointers to > > > > > these old patches that had it, and how it's done? I very obviously missed > > > > > that part. > > > > I think you misunderstood what I wrote earlier. The original proposal > > > > was about spatial partitioning of subdevice resources not time sharing > > > > using cgroup (since time sharing is already supported elsewhere.) > > > > > > Well SRIOV time-sharing is for virtualization. cgroups is for > > > containerization, which is just virtualization but with less overhead and > > > more security bugs. > > > > > > More or less. > > > > > > So either I get things still wrong, or we'll get time-sharing for > > > virtualization, and partitioning of CU for containerization. That doesn't > > > make that much sense to me. > > > > You could still potentially do SR-IOV for containerization. You'd > > just pass one of the PCI VFs (virtual functions) to the container and > > you'd automatically get the time slice. I don't see why cgroups would > > be a factor there. > > Standard interface to manage that time-slicing. I guess for SRIOV it's all > vendor sauce (intel as guilty as anyone else from what I can see), but for > cgroups that feels like it's falling a bit short of what we should aim > for. > > But dunno, maybe I'm just dreaming too much :-) I don't disagree, I'm just not sure how it would apply to SR-IOV. Once you've created the virtual functions, you've already created the partitioning (regardless of whether it's spatial or temporal) so where would cgroups come into play? Alex > -Daniel > > > Alex > > > > > > > > Since time-sharing is the first thing that's done for virtualization I > > > think it's probably also the most reasonable to start with for containers. > > > -Daniel > > > -- > > > Daniel Vetter > > > Software Engineer, Intel Corporation > > > http://blog.ffwll.ch > > > _______________________________________________ > > > amd-gfx mailing list > > > amd-gfx@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Deucher Subject: Re: [RFC] Add BPF_PROG_TYPE_CGROUP_IOCTL Date: Fri, 7 May 2021 12:31:00 -0400 Message-ID: References: Mime-Version: 1.0 Return-path: 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=hx5tna4nzB7jKuF4FCr0NopoQzyi09okT96ojHt20zo=; b=mKpdHWNfr1Dd8mEbwdRXjXKjQ9ZnQcm37bzty/pAVsU56+wCG+c1E0fWrWuhjJMff4 dEEH/vSrxuvcHIVBiHl3OidHkIkpOEWdWnV33NqB1LBKNuCpj4ATMc2gT0FL9krWhbiC HgjVAudPrHcGs1FXgP0/oqpwJZtXj1FB0XWhJyFwtZzjNf0HRBruUENbSB+oatZNUIjK i079Q4DG1UM4/MHstW2P9ohn+qZ1bJlCkxyC6Ow81bmcCTa7pyavlMqg6Oa+kTs5Xgmb GRVuEpUGXdbrqzgtRhmimyp09xGm5QDSRNteqv0P0nebXllLNsxjdTJHW8GFBUelBJFG oZww== In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Daniel Vetter Cc: Kenny Ho , Song Liu , Andrii Nakryiko , DRI Development , Daniel Borkmann , Kenny Ho , "open list:CONTROL GROUP (CGROUP)" , Brian Welty , John Fastabend , Alexei Starovoitov , amd-gfx list , Martin KaFai Lau , Linux-Fsdevel , Alexander Viro , Network Development , KP Singh , Yonghong Song , bpf , Dave Airlie , Alexei Starovoitov On Fri, May 7, 2021 at 12:26 PM Daniel Vetter wrote: > > On Fri, May 07, 2021 at 12:19:13PM -0400, Alex Deucher wrote: > > On Fri, May 7, 2021 at 12:13 PM Daniel Vetter wrote: > > > > > > On Fri, May 07, 2021 at 11:33:46AM -0400, Kenny Ho wrote: > > > > On Fri, May 7, 2021 at 4:59 AM Daniel Vetter wrote: > > > > > > > > > > Hm I missed that. I feel like time-sliced-of-a-whole gpu is the easier gpu > > > > > cgroups controler to get started, since it's much closer to other cgroups > > > > > that control bandwidth of some kind. Whether it's i/o bandwidth or compute > > > > > bandwidht is kinda a wash. > > > > sriov/time-sliced-of-a-whole gpu does not really need a cgroup > > > > interface since each slice appears as a stand alone device. This is > > > > already in production (not using cgroup) with users. The cgroup > > > > proposal has always been parallel to that in many sense: 1) spatial > > > > partitioning as an independent but equally valid use case as time > > > > sharing, 2) sub-device resource control as opposed to full device > > > > control motivated by the workload characterization paper. It was > > > > never about time vs space in terms of use cases but having new API for > > > > users to be able to do spatial subdevice partitioning. > > > > > > > > > CU mask feels a lot more like an isolation/guaranteed forward progress > > > > > kind of thing, and I suspect that's always going to be a lot more gpu hw > > > > > specific than anything we can reasonably put into a general cgroups > > > > > controller. > > > > The first half is correct but I disagree with the conclusion. The > > > > analogy I would use is multi-core CPU. The capability of individual > > > > CPU cores, core count and core arrangement may be hw specific but > > > > there are general interfaces to support selection of these cores. CU > > > > mask may be hw specific but spatial partitioning as an idea is not. > > > > Most gpu vendors have the concept of sub-device compute units (EU, SE, > > > > etc.); OpenCL has the concept of subdevice in the language. I don't > > > > see any obstacle for vendors to implement spatial partitioning just > > > > like many CPU vendors support the idea of multi-core. > > > > > > > > > Also for the time slice cgroups thing, can you pls give me pointers to > > > > > these old patches that had it, and how it's done? I very obviously missed > > > > > that part. > > > > I think you misunderstood what I wrote earlier. The original proposal > > > > was about spatial partitioning of subdevice resources not time sharing > > > > using cgroup (since time sharing is already supported elsewhere.) > > > > > > Well SRIOV time-sharing is for virtualization. cgroups is for > > > containerization, which is just virtualization but with less overhead and > > > more security bugs. > > > > > > More or less. > > > > > > So either I get things still wrong, or we'll get time-sharing for > > > virtualization, and partitioning of CU for containerization. That doesn't > > > make that much sense to me. > > > > You could still potentially do SR-IOV for containerization. You'd > > just pass one of the PCI VFs (virtual functions) to the container and > > you'd automatically get the time slice. I don't see why cgroups would > > be a factor there. > > Standard interface to manage that time-slicing. I guess for SRIOV it's all > vendor sauce (intel as guilty as anyone else from what I can see), but for > cgroups that feels like it's falling a bit short of what we should aim > for. > > But dunno, maybe I'm just dreaming too much :-) I don't disagree, I'm just not sure how it would apply to SR-IOV. Once you've created the virtual functions, you've already created the partitioning (regardless of whether it's spatial or temporal) so where would cgroups come into play? Alex > -Daniel > > > Alex > > > > > > > > Since time-sharing is the first thing that's done for virtualization I > > > think it's probably also the most reasonable to start with for containers. > > > -Daniel > > > -- > > > Daniel Vetter > > > Software Engineer, Intel Corporation > > > http://blog.ffwll.ch > > > _______________________________________________ > > > amd-gfx mailing list > > > amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch