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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 C52ECC43462 for ; Fri, 7 May 2021 16:13:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 444EA61445 for ; Fri, 7 May 2021 16:13:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237992AbhEGQOy (ORCPT ); Fri, 7 May 2021 12:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236233AbhEGQOx (ORCPT ); Fri, 7 May 2021 12:14:53 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA7AFC0613ED for ; Fri, 7 May 2021 09:13:51 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 82-20020a1c01550000b0290142562ff7c9so5203630wmb.3 for ; Fri, 07 May 2021 09:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FUW3a1jiCrK1Tn1N2NaYa8UBta2jEUU1Vka07ztzquU=; b=g4WfSpbdEojj9t6SkLNDXVSN8j4goD0Y1aN3I2Imymf6okgQfMLTQILeVaPIdzjjyy rc5FgeK00c/1rW3oWDgK0rM6pqpYTXnlKBGM3lzF7JRr0lP4t2KJLEo8glyppHIXAZg5 OlL+tz1UDPB06Xitnob+iK9BxCUL/sEKyEcCU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FUW3a1jiCrK1Tn1N2NaYa8UBta2jEUU1Vka07ztzquU=; b=ppz0AlpAzxBPT2gsiJshnMe5ulVW3IefZd0aC+K72A77q6YphqUsYPwLXs6RKfeFNr IvUZ6aomiYCxxYbyF5JIA3efSNpIXSmQem1l3nMp9yubhhuFHSUs04n25LXfVYGa94wY SvwU6bKbhg5oVcHHy0QjE7jzQyk89+vjnktiy9U6bLkZ6hA6RFyPYVpKVhwHlQh9g9Yi H/yrcC5fa1kcyTMJvOG5yJLz0tPz5Xm5EzYFb+XdLYFmX6mtlLSOD1W/MqFEsTRc4Ndl KUxo+C98hrUQsM+x2TGYrighOupSAoJFzm7WzL3WwF6phSQjWyoCwJh5jD0EWFBSUE09 i5WA== X-Gm-Message-State: AOAM533O+VNMkZ1RRxVmckPvPRd/uLLAqS+3WiZ5ssyE0ax1ziEdhaB8 tK6DbB/uIIe2c6Ex5OmJSuIakQ== X-Google-Smtp-Source: ABdhPJw2OfJqYx5ZIercYhhRlQ/JLOdMXNxUQ/ODYD+AnW2ThepPqF7/0dUanJkd40jtM214KjqXYQ== X-Received: by 2002:a05:600c:2154:: with SMTP id v20mr10712151wml.86.1620404030299; Fri, 07 May 2021 09:13:50 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id l66sm7286905wmf.20.2021.05.07.09.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 09:13:49 -0700 (PDT) Date: Fri, 7 May 2021 18:13:47 +0200 From: Daniel Vetter To: Kenny Ho Cc: Daniel Vetter , Alexei Starovoitov , Dave Airlie , Kenny Ho , Alexander Viro , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , bpf , Network Development , Linux-Fsdevel , "open list:CONTROL GROUP (CGROUP)" , Alex Deucher , amd-gfx list , DRI Development , Brian Welty Subject: Re: [RFC] Add BPF_PROG_TYPE_CGROUP_IOCTL Message-ID: References: <20201103232805.6uq4zg3gdvw2iiki@ast-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.10.32scarlett+ Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. 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