Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp527642imm; Fri, 3 Aug 2018 07:22:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcayHToaAXlefM27v7tcQOxDMjdQoCSFK557TRGDGZaIhoQj8ihIvetjhZkcObzhbiBXndc X-Received: by 2002:a17:902:7106:: with SMTP id a6-v6mr3919570pll.28.1533306164623; Fri, 03 Aug 2018 07:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533306164; cv=none; d=google.com; s=arc-20160816; b=zgfHnIWA8Yd1sRppGgzrbZcijNdP7x40KmcM73pizaeaLAGg2Nh7S5pRiIPu8grrN7 H8drfsOftDt+ISThuL95QC7nuECQvCnQBJySKxGSMsPvG7hntw1PsD4AYX7mvEiG4Bg9 UAsUZiNmH3VvyCMtcKSOcjSLTKm13xGYTjSslB8MQgNdQT8mc2c3SZQqfJ+25ZUXMr7W mRcrOp11Vis9/+wRofOVI1JNP5kbvnG0y7d/EkAeWa1Vlrx9pjdvtQW5jZzDZdpgVYTh dxvfdqOELpnnw99sV7WQtm4dipAuYqwCR8JwmKgyVv3Q/FY6whThrk6OLZ+2w1u5PJ1L hvvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=76gCfkF79EEF1AaXciIsb9pnJEjnpYLyVOJNbcoBsP0=; b=TGA9JROL/RPQ83YMHwY+hJ73zADe0QPdT9uYwmViCAXNQpIj0FBjbRF8fLMuw5ieiU 87eCwbOZ3WeldiUxjnB4ePvmolBKG5qrX26lh0sNMxMXQDyMoh6REvdouIzZy0SUXYSm 0sBWiTn1mUdQnj48hwA78/deqC3dT9ZQZ86muET6LEURDHlhZJdqzfj0mDWjinJeZGqv kWveF+3VdvPIEjTEwHwTYmuRvk7pIq3HtsNIyDVh9VE/Sjz+8erGiBqRfJUSf9HylwqW 8wQJn4ycN5VWN2AVhRA4DvZuLmQ+N0MGwox4dk+o2fY04FLXkLJ5hn5UrzMzEQ0XPiqY OtfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m18-v6si5165001pgg.693.2018.08.03.07.22.30; Fri, 03 Aug 2018 07:22:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732352AbeHCQSC (ORCPT + 99 others); Fri, 3 Aug 2018 12:18:02 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:53020 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732074AbeHCQSC (ORCPT ); Fri, 3 Aug 2018 12:18:02 -0400 Received: from alans-desktop (82-70-14-226.dsl.in-addr.zen.co.uk [82.70.14.226]) by fuzix.org (8.15.2/8.15.2) with ESMTP id w73EKh5P020485; Fri, 3 Aug 2018 15:20:43 +0100 Date: Fri, 3 Aug 2018 15:20:43 +0100 From: Alan Cox To: Jerome Glisse Cc: "Tian, Kevin" , Kenneth Lee , Hao Fang , Herbert Xu , "kvm@vger.kernel.org" , Jonathan Corbet , Greg Kroah-Hartman , "linux-doc@vger.kernel.org" , "Kumar, Sanjay K" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linuxarm@huawei.com" , Alex Williamson , Thomas Gleixner , "linux-crypto@vger.kernel.org" , Philippe Ombredanne , Zaibo Xu , Kenneth Lee , "David S . Miller" , Ross Zwisler Subject: Re: [RFC PATCH 0/7] A General Accelerator Framework, WarpDrive Message-ID: <20180803152043.40f88947@alans-desktop> In-Reply-To: <20180802144627.GB3481@redhat.com> References: <20180801102221.5308-1-nek.in.cn@gmail.com> <20180801165644.GA3820@redhat.com> <20180802111000.4649d9ed@alans-desktop> <20180802144627.GB3481@redhat.com> Organization: Intel Corporation X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > If we are going to have any kind of general purpose accelerator API then > > it has to be able to implement things like > > Why is the existing driver model not good enough ? So you want > a device with function X you look into /dev/X (for instance > for GPU you look in /dev/dri) Except when my GPU is in an FPGA in which case it might be somewhere else or it's a general purpose accelerator that happens to be usable as a GPU. Unusual today in big computer space but you'll find it in microcontrollers. > Each of those device need a userspace driver and thus this > user space driver can easily knows where to look. I do not > expect that every application will reimplement those drivers > but instead use some kind of library that provide a high > level API for each of those devices. Think about it from the user level. You have a pipeline of things you wish to execute, you need to get the right accelerator combinations and they need to fit together to meet system constraints like number of IOMMU ids the accelerator supports, where they are connected. > Now you have a hierarchy of memory for the CPU (HBM, local > node main memory aka you DDR dimm, persistent memory) each It's not a heirarchy, it's a graph. There's no fundamental reason two accelerators can't be close to two different CPU cores but have shared HBM that is far from each processor. There are physical reasons it tends to look more like a heirarchy today. > Anyway i think finding devices and finding relation between > devices and memory is 2 separate problems and as such should > be handled separatly. At a certain level they are deeply intertwined because you need a common API. It's not good if I want a particular accelerator and need to then see which API its under on this machine and which interface I have to use, and maybe have a mix of FPGA, WarpDrive and Google ASIC interfaces all different. The job of the kernel is to impose some kind of sanity and unity on this lot. All of it in the end comes down to 'Somehow glue some chunk of memory into my address space and find any supporting driver I need' plus virtualization of the above. That bit's easy - but making it usable is a different story. Alan