Received: by 10.223.164.221 with SMTP id h29csp610961wrb; Wed, 11 Oct 2017 06:16:53 -0700 (PDT) X-Received: by 10.101.86.9 with SMTP id l9mr14897523pgs.297.1507727813023; Wed, 11 Oct 2017 06:16:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507727812; cv=none; d=google.com; s=arc-20160816; b=rrkULRIjau+QcGNGxUJhQC5t7pc1nXyIcB0uy9wsrlE1E9Ny8PnPN84HXXIII7tKSH XJO3ehrCJCfP23BgBMga1jaovig6Ush3GMa05TwFp3TpohY4ySXODXp07OOGWBCvmCcF 1ZRZg3psuBubEzI3TFsE3NJevy2VwUH98eORTlujF9um7E8B7JTA9ifAd4SYDNyrrs2F 25jVI+IZ0sC5ZRBLPeyUEWff/cUWaF8F4444RDKN9o4MO194bE2hA+/Ce1dj0Xs+MxfQ HCQhQE1SG/Gyt0irRzPAnqd2IT5wWWq06JJZRiDha6KUc/7it9gOTFSjXLZSBBsRqpCp CvwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=+fdAhUXV1D1Kh0Yp4k54JEYKanA853IBcw1BWYS415Q=; b=HpkBwGhV9nbATuMErbkFWI4DXnWQICPlfK/B8foLfFRbdHYgD+klPP3aXeaPaicGvf WpTyPrtNXxKa966TlKlalDm0huMZm+A33LRXiR7Pg2FHkVelJAU68EbKh206zcp1VDzu 9zLvKTKbdrfI0rH3ynajLsW8OcK2VEn4k5Bc/qUrTzKaXUl5Rj+gGpcO1EYr3K3qxSnl 8sxDD/iYkSnPhZ+W+x1AI+wdfSWFuLVsceLt8udyaAYnx06ayODMd0l4NZm5dx8ahPF7 OEIpQ0E8fLPK/7IbPlBJQpM2o5yrzZSomUMq+gL+7rCoB0AjKp+isQZpDC+/8a9FMlyT 2AAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OKBqQh54; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k13si1316524pgn.761.2017.10.11.06.16.38; Wed, 11 Oct 2017 06:16:52 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OKBqQh54; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757398AbdJKNQD (ORCPT + 99 others); Wed, 11 Oct 2017 09:16:03 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:56077 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752429AbdJKNQA (ORCPT ); Wed, 11 Oct 2017 09:16:00 -0400 Received: by mail-lf0-f48.google.com with SMTP id p184so2027800lfe.12 for ; Wed, 11 Oct 2017 06:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+fdAhUXV1D1Kh0Yp4k54JEYKanA853IBcw1BWYS415Q=; b=OKBqQh54RNOBvwa9QBC3IFDKzZ7t4Drk98fSOQfuYRBW409B0FI8qx043GMaki1xkg NbMi74lTBlz9yzQqDjXDqzp/65avPxKDGSx8aFMOCmUzSzDAMAQjCE8jRzVL3MX1K530 zkh+knsqivImsU2/BZ+p+egMWS6Vt5KMW4g44yQ/wRr958N7Q/BWv9Tsr+7EiDaJ/ZIH 0fwVZRhgOANVODlAVMkCej55JhZxWIns2Q/8e3F3FbZPsJgrgd+FInypq9080aJ2fNYr K/HqiZSrP5nhPlMKZgqeeYgwHAnjUGp9uZrugEesYeVanaQZbc1HZUjSotq9SYM28P+g YI5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+fdAhUXV1D1Kh0Yp4k54JEYKanA853IBcw1BWYS415Q=; b=B3GgWy+3HyWmocARV/Xn0wOVkWBZ7i6VR8wCurispH6+S/xvPXk7gTSfy9iKm5vDlE iA+ymCYxjOk/Fqn1oZZtgtOLlWnAaRFhRvheii8T6kxowAbFL3VJZu97m7FJFisN77oj kROhJEBe/BsGsh4HN6p2SajzxRMp7cgY/v/nTaidbadIOBtDFhuTxTfNxGfXbRLNmv/J rxrtpjylGRPLPA0iyRFGN2zDqSc4YB5puCUUnA79kDzmQPlZxkk0pt2RjGAmp4XNOOls lgkiO6SwclxXdVxUz8rqX/Fw95zb8XvFCTY6g9yX62YmkpnPzRyiNoKPA31/PNrZagys bsOQ== X-Gm-Message-State: AMCzsaVEyFvXJFDiFP6sM+TB2ZeFBZvLX60WIKmdxicKJXHqiI0SLVpm I3EEUPSs+KzSUtK0gi9/yBWTUxwaOrGAX9BXoCI= X-Google-Smtp-Source: AOwi7QBBJpNLr9yNLItwBHEM0BpQZXp+6bQBlguUXNcbCJjqTCdvabCgWccjqRcu87zL8RIn+FoDzdvbImUXse5gVwY= X-Received: by 10.46.21.6 with SMTP id s6mr7508513ljd.70.1507727758649; Wed, 11 Oct 2017 06:15:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.68.1 with HTTP; Wed, 11 Oct 2017 06:15:57 -0700 (PDT) In-Reply-To: <20170930224927.GC6775@redhat.com> References: <20170720150305.GA2767@redhat.com> <20170721014106.GB25991@redhat.com> <20170905193644.GD19397@redhat.com> <20170911233649.GA4892@redhat.com> <20170926161635.GA3216@redhat.com> <0d7273c3-181c-6d68-3c5f-fa518e782374@huawei.com> <20170930224927.GC6775@redhat.com> From: Bob Liu Date: Wed, 11 Oct 2017 21:15:57 +0800 Message-ID: Subject: Re: [PATCH 0/6] Cache coherent device memory (CDM) with HMM v5 To: Jerome Glisse Cc: Bob Liu , Dan Williams , "linux-kernel@vger.kernel.org" , Linux MM , John Hubbard , David Nellans , Balbir Singh , Michal Hocko , Andrew Morton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 1, 2017 at 6:49 AM, Jerome Glisse wrote: > On Sat, Sep 30, 2017 at 10:57:38AM +0800, Bob Liu wrote: >> On 2017/9/27 0:16, Jerome Glisse wrote: >> > On Tue, Sep 26, 2017 at 05:56:26PM +0800, Bob Liu wrote: >> >> On Tue, Sep 12, 2017 at 7:36 AM, Jerome Glisse wrote: >> >>> On Sun, Sep 10, 2017 at 07:22:58AM +0800, Bob Liu wrote: >> >>>> On Wed, Sep 6, 2017 at 3:36 AM, Jerome Glisse wrote: >> >>>>> On Thu, Jul 20, 2017 at 08:48:20PM -0700, Dan Williams wrote: >> >>>>>> On Thu, Jul 20, 2017 at 6:41 PM, Jerome Glisse wrote: >> [...] >> >>>>> So i pushed a branch with WIP for nouveau to use HMM: >> >>>>> >> >>>>> https://cgit.freedesktop.org/~glisse/linux/log/?h=hmm-nouveau >> >>>>> >> >>>> >> >>>> Nice to see that. >> >>>> Btw, do you have any plan for a CDM-HMM driver? CPU can write to >> >>>> Device memory directly without extra copy. >> >>> >> >>> Yes nouveau CDM support on PPC (which is the only CDM platform commercialy >> >>> available today) is on the TODO list. Note that the driver changes for CDM >> >>> are minimal (probably less than 100 lines of code). From the driver point >> >>> of view this is memory and it doesn't matter if it is CDM or not. >> >>> >> >> >> >> It seems have to migrate/copy memory between system-memory and >> >> device-memory even in HMM-CDM solution. >> >> Because device-memory is not added into buddy system, the page fault >> >> for normal malloc() always allocate memory from system-memory!! >> >> If the device then access the same virtual address, the data is copied >> >> to device-memory. >> >> >> >> Correct me if I misunderstand something. >> >> @Balbir, how do you plan to make zero-copy work if using HMM-CDM? >> > >> > Device can access system memory so copy to device is _not_ mandatory. Copying >> > data to device is for performance only ie the device driver take hint from >> > userspace and monitor device activity to decide which memory should be migrated >> > to device memory to maximize performance. >> > >> > Moreover in some previous version of the HMM patchset we had an helper that >> >> Could you point in which version? I'd like to have a look. > > I will need to dig in. > Thank you. >> >> > allowed to directly allocate device memory on device page fault. I intend to >> > post this helper again. With that helper you can have zero copy when device >> > is the first to access the memory. >> > >> > Plan is to get what we have today work properly with the open source driver >> > and make it perform well. Once we get some experience with real workload we >> > might look into allowing CPU page fault to be directed to device memory but >> > at this time i don't think we need this. >> > >> >> For us, we need this feature that CPU page fault can be direct to device memory. >> So that don't need to copy data from system memory to device memory. >> Do you have any suggestion on the implementation? I'll try to make a prototype patch. > > Why do you need that ? What is the device and what are the requirement ? > You may think it as a CCIX device or CAPI device. The requirement is eliminate any extra copy. A typical usecase/requirement is malloc() and madvise() allocate from device memory, then CPU write data to device memory directly and trigger device to read the data/do calculation. -- Regards, --Bob From 1580006702485477720@xxx Sat Sep 30 22:50:11 +0000 2017 X-GM-THRID: 1572843623662560165 X-Gmail-Labels: Inbox,Category Forums