Received: by 10.223.185.116 with SMTP id b49csp7899927wrg; Thu, 1 Mar 2018 13:11:40 -0800 (PST) X-Google-Smtp-Source: AG47ELvYFDgSn8c8CRjeWrO9UM3IHeIOtJUk+AtD9iI5rxoIJ0PKvhuetpGB+OTgKXTCv6mSLE9R X-Received: by 2002:a17:902:bd93:: with SMTP id q19-v6mr3187936pls.322.1519938700015; Thu, 01 Mar 2018 13:11:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519938699; cv=none; d=google.com; s=arc-20160816; b=0reoS7c7rxPqnC7gA/5VkxMv0XYHhhX2wEPqJ1zDY0w4bP72rvAerwl7B7aQYdHkbq SAlmJAHiQQYbV66AOOCScqvyEe7ceYfbkGcaUxFop0JdKr3gTdozEzzy7Lisr+6LkoEw vgSHT8m5dci0eegKQfb1oZlEqeq7LrJtCqLhwVUiUGWSDBC2nOZPe1KUDjZhEb+4cs67 HfUJu07GlgbKCH1mgOQKeYiaRPXAZZ7UMtrOv57FNx4yoW5JR6voFuYhQtF8/aYYPWDd wi19FtBDWRNnm46Z4EwLEzje2UgY9R77Hia6i0naaaC+J4fWsdmeyrp9o/ZCbkS03MB4 v5eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=oGceTW5x6OxPlKImfJ7hm5FQM72QO9kAvbbZD0L/uYg=; b=HTsToBXG683qZRHDjs7B2CCQdOx1YArGJb/VG48nbx/GQ54q9yvD1Ny3rxU91PguiZ yFVI5SemAnrX+uKlp85PoM2DZXboOs1QKwKFyzCCsdvuNSKkShh35X7E+uf6nhmO3MGp sJDuUnt5djmhmEzVNAnIeXeoKHyHeC1i0wj6FQwrNi1DfpDDMvwN004GDfbM9wIawkTk lP0vzJKL66gOKHbUkGQnvjQfWa1MyRL7dMsRs4dHJ+GB4XNZexw5c3JhOPFcT2ytcO3L KsUk7ABSyt8/f5KdFUMR4B1m4abGbP2oII0lbkl8DDcPq2GzYHF8lHp40OXv0ITlU45w M//g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19si3535401pfh.326.2018.03.01.13.11.25; Thu, 01 Mar 2018 13:11:39 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161861AbeCAVKo (ORCPT + 99 others); Thu, 1 Mar 2018 16:10:44 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44486 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1161764AbeCAVKm (ORCPT ); Thu, 1 Mar 2018 16:10:42 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C922813F6FF; Thu, 1 Mar 2018 21:10:41 +0000 (UTC) Received: from redhat.com (ovpn-124-164.rdu2.redhat.com [10.10.124.164]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3201B10B0F24; Thu, 1 Mar 2018 21:10:38 +0000 (UTC) Date: Thu, 1 Mar 2018 16:10:36 -0500 From: Jerome Glisse To: Logan Gunthorpe Cc: Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-block@vger.kernel.org, Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , Alex Williamson , Oliver OHalloran Subject: Re: [PATCH v2 00/10] Copy Offload in NVMe Fabrics with P2P PCI Memory Message-ID: <20180301211036.GB6742@redhat.com> References: <20180228234006.21093-1-logang@deltatee.com> <1519876489.4592.3.camel@kernel.crashing.org> <1519876569.4592.4.camel@au1.ibm.com> <8e808448-fc01-5da0-51e7-1a6657d5a23a@deltatee.com> <1519936195.4592.18.camel@au1.ibm.com> <20180301205548.GA6742@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 01 Mar 2018 21:10:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 01 Mar 2018 21:10:41 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jglisse@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 01, 2018 at 02:03:26PM -0700, Logan Gunthorpe wrote: > > > On 01/03/18 01:55 PM, Jerome Glisse wrote: > > Well this again a new user of struct page for device memory just for > > one usecase. I wanted HMM to be more versatile so that it could be use > > for this kind of thing too. I guess the message didn't go through. I > > will take some cycles tomorrow to look into this patchset to ascertain > > how struct page is use in this context. > > We looked at it but didn't see how any of it was applicable to our needs. > It seems people miss-understand HMM :( you do not have to use all of its features. If all you care about is having struct page then just use that for instance in your case only use those following 3 functions: hmm_devmem_add() or hmm_devmem_add_resource() and hmm_devmem_remove() for cleanup. You can set the fault callback to an empty stub that always do return VM_SIGBUS or a patch to allow NULL callback inside HMM. You don't have to use the free callback if you don't care and if there is something that doesn't quite match what you want HMM can always be ajusted to address this. The intention of HMM is to be useful for all device memory that wish to have struct page for various reasons. Cheers, J?r?me