Received: by 10.223.164.202 with SMTP id h10csp1455232wrb; Wed, 15 Nov 2017 21:14:29 -0800 (PST) X-Google-Smtp-Source: AGs4zMYrFCuB/KAamIGxy5V+0qGQW/bFQHN62yT4rxoJd96fsOCv2iWoREUVbv3OFY9CuErJVsic X-Received: by 10.98.149.72 with SMTP id p69mr573278pfd.76.1510809269775; Wed, 15 Nov 2017 21:14:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510809269; cv=none; d=google.com; s=arc-20160816; b=ZuK0Xfb5WhRdGkWRUXaDR2wcaivRF1tQ8iBizCKVpScl9Pqaut0ndE0mPJopSnDLHY N6Sk+dQUhvX2x+Pgd9u/XotIr5BU18rhaTZx5phSFGV5T3pKTg8traCE/1EJx8pto9vi 46r2DGnmjvv5g5JKe7rd7lOkjX0IYMUFr+P2KGMuzHJORENEB18JRNb7fa6hpk8KQuBh gzim9dOhSXN4KiIeHv5TaLO7UblDS7W6MpY8DUNI9xgKzabLRq6n+/gT3SH9pmA3dfj3 +qdjAYscNkDCTnUKONZ8fT7aUU1AgYdAsr4LsfuxtpnlW1rA/bOu2fC6lS3hi8OQIxHJ vFQg== 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=Qwp4FFhL4qfp3oj8QwFxifp0ncqK7X1vz/E/1kMVPMw=; b=xWe3UjFd3CyDenXegulmucCTmAi5iV8e6S6XUzAAPVkaZ4sZvmuh/CP6ALDI/udPG7 GsWWAWN1MVnmm5GcZXCWJEgZeI2C/kFA/FQqL5N3JBxGqRFfWjmq2xgP/t/PQ25qcj5E lJUKnQXV+serU2ZUnST5mbpKVXDmzFek0VkugLnmpmdM2ctf7bz5kaUdDeEWcobbS6j4 vaeGiQkSWvzejxrJllhdc+6k5O0YPf13ugIkrw8F8HvQaXapR+7/xCeFs+UyDB7eDITW GKPsT0eTeU1TxvoN0XHWv57ZwIQKMOneQXGTuOd+4/U0lsLejPwTkSiGr87xXLu+xyHC csdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=abG8kuZn; 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 n27si252347pgf.117.2017.11.15.21.14.17; Wed, 15 Nov 2017 21:14:29 -0800 (PST) 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=abG8kuZn; 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 S1758657AbdKPDXc (ORCPT + 89 others); Wed, 15 Nov 2017 22:23:32 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:43626 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753159AbdKPDX0 (ORCPT ); Wed, 15 Nov 2017 22:23:26 -0500 Received: by mail-wm0-f66.google.com with SMTP id x63so98217wmf.2; Wed, 15 Nov 2017 19:23:26 -0800 (PST) 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=Qwp4FFhL4qfp3oj8QwFxifp0ncqK7X1vz/E/1kMVPMw=; b=abG8kuZn7sMs2U7J4/VLjQTKsUqUHptWcxmgbhtASP9uVMLb0wMmBzTmQUocQX70dk RjvsLPIRHh5/53Btv4uF/zUkcCvXGLxHxFim9lQr1TeGuNx6VI92mO1twFt1Pl1stzYV sXpSk4W68jZwZb7rZbZrgAnQDUcQHxcjCN/O9civWJflKN4IIVaZwQPkfG9Li34y6P/A MuuKG8sEK/upED3kekJgng0/AfHJI9u5asqWQPdsKGR+gw9aJj5x7bTsepVqD4h3B6Sq WnsCGcXVFioBdvWBWNrUeyxhU+sJB0h8062jhu1ZIA4dHSfT0IkLHYtVfqNHfsJwF32T Akow== 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=Qwp4FFhL4qfp3oj8QwFxifp0ncqK7X1vz/E/1kMVPMw=; b=O2nL8SlyxFd71/Z6/y3iGZ+fzCxIBWPx5HxJ05AAffdrOXnilMQ7E/edXYA/BlAY1C +wGk9ysdfh/vIuadzyXjf04gxDI+Gin/3JJKdwOBaKrSoGDien6t1CCjPnrE3lCofT4J /en6wGXI77g649B4fnX7SyW2Ik0lfjpZck5yaA3nHpQy6ziliYoYbp3akGDLkvw/lC1T EooUet17DiMB8EnMm1Zj+O+qw8yd1ET+Gt+3VQy99Q10TFfr37BgGVUWUxILAmKwKTBa pBDDPWbZMH3eb6nhql+Y4mV8qU3ONmLtpZ2tlhJeZp38l6P670S2SCE2fZP2TtJqiSQI qE5Q== X-Gm-Message-State: AJaThX63s4cF2K1KGp22yvtKDEVwuM09C//26l+xg9KPuM3F81HZX9nb 2d7nOjk4JrAG9JUq6GLB0I2sD6D3xpk363X6Fyo= X-Received: by 10.28.166.216 with SMTP id p207mr339928wme.147.1510802605187; Wed, 15 Nov 2017 19:23:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.197.14 with HTTP; Wed, 15 Nov 2017 19:23:24 -0800 (PST) In-Reply-To: <20171116024425.GC2934@redhat.com> References: <20170905193644.GD19397@redhat.com> <20170911233649.GA4892@redhat.com> <20170926161635.GA3216@redhat.com> <0d7273c3-181c-6d68-3c5f-fa518e782374@huawei.com> <20170930224927.GC6775@redhat.com> <20171012153721.GA2986@redhat.com> <20171116024425.GC2934@redhat.com> From: chetan L Date: Wed, 15 Nov 2017 19:23:24 -0800 Message-ID: Subject: Re: [PATCH 0/6] Cache coherent device memory (CDM) with HMM v5 To: Jerome Glisse Cc: Bob Liu , Bob Liu , Dan Williams , "linux-kernel@vger.kernel.org" , Linux MM , John Hubbard , David Nellans , Balbir Singh , Michal Hocko , Andrew Morton , linux-accelerators@vger.kernel.org, Jonathan.Cameron@huawei.com 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 CC'ing : linux-accelerators@vger.kernel.org On Wed, Nov 15, 2017 at 6:44 PM, Jerome Glisse wrote: > On Wed, Nov 15, 2017 at 06:10:08PM -0800, chet l wrote: >> >> 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. >> > >> > I suggest you rely on the device driver userspace API to do a migration after malloc >> > then. Something like: >> > ptr = malloc(size); >> > my_device_migrate(ptr, size); >> > >> > Which would call an ioctl of the device driver which itself would migrate memory or >> > allocate device memory for the range if pointer return by malloc is not yet back by >> > any pages. >> > >> >> So for CCIX, I don't think there is going to be an inline device >> driver that would allocate any memory for you. The expansion memory >> will become part of the system memory as part of the boot process. So, >> if the host DDR is 256GB and the CCIX expansion memory is 4GB, the >> total system mem will be 260GB. >> >> Assume that the 'mm' is taught to mark/anoint the ZONE_DEVICE(or >> ZONE_XXX) range from 256 to 260 GB. Then, for kmalloc it(mm) won't use >> the ZONE_DEV range. But for a malloc, it will/can use that range. > > HMM zone device memory would work with that, you just need to teach the > platform to identify this memory zone and not hotplug it. Again you > should rely on specific device driver API to allocate this memory. > @Jerome - a new linux-accelerator's list has just been created. I have CC'd that list since we have overlapping interests w.r.t CCIX. I cannot comment on surprise add/remove as of now ... will cross the bridge later. >> > There has been several discussions already about madvise/mbind/set_mempolicy/ >> > move_pages and at this time i don't think we want to add or change any of them to >> > understand device memory. My personal opinion is that we first need to have enough >> >> We will visit these APIs when we are more closer to building exotic >> CCIX devices. And the plan is to present/express the CCIX proximity >> attributes just like a NUMA node-proximity attribute today. That way >> there would be minimal disruptions to the existing OS ecosystem. > > NUMA have been rejected previously see CDM/CAPI threads. So i don't see > it being accepted for CCIX either. My belief is that we want to hide this > inside device driver and only once we see multiple devices all doing the > same kind of thing we should move toward building something generic that > catter to CCIX devices. Thanks for pointing out the NUMA thingy. I will visit the CDM/CAPI threads to understand what was discussed before commenting further. Chetan From 1584194914595783230@xxx Thu Nov 16 04:20:02 +0000 2017 X-GM-THRID: 1572843623662560165 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread