Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1209157pxb; Thu, 4 Mar 2021 06:12:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCvHfmmqV1BWv64svOmm6fsKPzsZETZ6Wnqu3svzBsd8U+xfRCn0c8RuyNTSur3sK0y1N3 X-Received: by 2002:a17:906:fa0e:: with SMTP id lo14mr4380543ejb.263.1614867173123; Thu, 04 Mar 2021 06:12:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614867173; cv=none; d=google.com; s=arc-20160816; b=QugoF9QddOva2iOqDprWfBNspAJk9zSPxhA2cPDuw9oyAmF7OmpUlwsGoCAS1N8guI bVDJqH42ZJOzqKznshLZ9XW6ldm5j6uYBzaLO6ng1H+r4VxwwRzzMUHwNcCQos8qwM3B ugUty/YgiSkIVDAjrmoMEpx+jxLQkANTi5snLxbP/mUuojdy1D6u1wDaxsex66f0AeEb tv4gmGiLrNcY2vsJEWOVHije/101urHx5zSy8X5i9oMdbG7BfjdjO+MgHsyRkFYhCaN2 ZGWKO4X4Dw/xqeOnxw5bAXJZKA9bpAxMxzPMLzzog2dhWhm/G8lhcJZL3IXx7hu2Incm nGRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:ironport-sdr:ironport-sdr; bh=G1mgNTN9Xly6FXuUBUHTEmNtymGsMkzjFsPElsR5efI=; b=VFgaPnZqSRSe+pLW4u0/CNR6f8R8Kjd1c9agecW9cpeE78QoAz96Zml/Elc6DtRVVh ej8NXJpusUzR+3o39+m5KbXPllTYbVe7RRm1o/EVXUV9mz0Nlp+NxrZG4FVphufP1V6+ xM3d8D3bJhmhcByTHUknTdkt3FANWt+CpXXLF59VlKhhDk6OFs2JIZ8BJq7x/ys+iyu9 qDkkR/ik1+H7WTm7x0hTxnAe6qIjJ2tJ3S39n6/3n9ucbkMbHT+5rkAN4KyL37q37Fqo mU67IdT4gc9XJP+yLUdbjXmUE8GGmBpIkl/nUfLoBT6hlnAVqnZHVwSVKL3SqwlJLX8H 9dcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b65si13776187edf.391.2021.03.04.06.12.29; Thu, 04 Mar 2021 06:12:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356992AbhCDBF0 (ORCPT + 99 others); Wed, 3 Mar 2021 20:05:26 -0500 Received: from mga01.intel.com ([192.55.52.88]:47696 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1452876AbhCDAi7 (ORCPT ); Wed, 3 Mar 2021 19:38:59 -0500 IronPort-SDR: r/+4kTZ10ybl6ojVDgReLQmZX9Pv0I6DfZ+aSzz64MPqwpzK4oL8qfbVjqgNa27u3zr56ng078 QFMOBflaTFFQ== X-IronPort-AV: E=McAfee;i="6000,8403,9912"; a="207000391" X-IronPort-AV: E=Sophos;i="5.81,220,1610438400"; d="scan'208";a="207000391" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2021 15:59:49 -0800 IronPort-SDR: +vxitPST2B82Q3t1Wscr0o0o+AAEVJudR9cF6VlNUJofp/U3LMOqwUGZhjDEiq/KHp0TECf9+y t8/bPNCml/tQ== X-IronPort-AV: E=Sophos;i="5.81,220,1610438400"; d="scan'208";a="445479939" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2021 15:59:49 -0800 Date: Wed, 3 Mar 2021 16:02:05 -0800 From: Jacob Pan To: Tejun Heo Cc: LKML , Joerg Roedel , Lu Baolu , David Woodhouse , iommu@lists.linux-foundation.org, cgroups@vger.kernel.org, Johannes Weiner , Jean-Philippe Brucker , Alex Williamson , Eric Auger , Jason Gunthorpe , Jonathan Corbet , Raj Ashok , "Tian, Kevin" , Yi Liu , Wu Hao , Dave Jiang , jacob.jun.pan@linux.intel.com Subject: Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller Message-ID: <20210303160205.151d114e@jacob-builder> In-Reply-To: <20210303131726.7a8cb169@jacob-builder> References: <1614463286-97618-1-git-send-email-jacob.jun.pan@linux.intel.com> <1614463286-97618-16-git-send-email-jacob.jun.pan@linux.intel.com> <20210303131726.7a8cb169@jacob-builder> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacob, On Wed, 3 Mar 2021 13:17:26 -0800, Jacob Pan wrote: > Hi Tejun, > > On Wed, 3 Mar 2021 10:44:28 -0500, Tejun Heo wrote: > > > On Sat, Feb 27, 2021 at 02:01:23PM -0800, Jacob Pan wrote: > > > IOASIDs are used to associate DMA requests with virtual address > > > spaces. They are a system-wide limited resource made available to the > > > userspace applications. Let it be VMs or user-space device drivers. > > > > > > This RFC patch introduces a cgroup controller to address the following > > > problems: > > > 1. Some user applications exhaust all the available IOASIDs thus > > > depriving others of the same host. > > > 2. System admins need to provision VMs based on their needs for > > > IOASIDs, e.g. the number of VMs with assigned devices that perform > > > DMA requests with PASID. > > > > Please take a look at the proposed misc controller: > > > > http://lkml.kernel.org/r/20210302081705.1990283-2-vipinsh@google.com > > > > Would that fit your bill? > The interface definitely can be reused. But IOASID has a different > behavior in terms of migration and ownership checking. I guess SEV key > IDs are not tied to a process whereas IOASIDs are. Perhaps this can be > solved by adding > + .can_attach = ioasids_can_attach, > + .cancel_attach = ioasids_cancel_attach, > Let me give it a try and come back. > While I am trying to fit the IOASIDs cgroup in to the misc cgroup proposal. I'd like to have a direction check on whether this idea of using cgroup for IOASID/PASID resource management is viable. Alex/Jason/Jean and everyone, your feedback is much appreciated. > Thanks for the pointer. > > Jacob > > > > > Thanks. > > > > > Thanks, > > Jacob Thanks, Jacob