Received: by 10.223.185.116 with SMTP id b49csp7893555wrg; Thu, 1 Mar 2018 13:04:59 -0800 (PST) X-Google-Smtp-Source: AG47ELs/xlJAluM9VotTZMmIntEHIbM5YK96+6b3s8OMaXQ6d7J5H6351nAoN1qNzL2IvGU90N0l X-Received: by 10.101.91.78 with SMTP id y14mr2608346pgr.243.1519938299370; Thu, 01 Mar 2018 13:04:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519938299; cv=none; d=google.com; s=arc-20160816; b=rKpwj0nTcyWP2ht7etqPUohHmeV0SvMieerHJGr/iLTF1YjEZCA4L7EkBrtZTYwyfB 8IVTJW5ObHbksTPopGIFFAIvNLyrjw+Jknj9RItyPwoYJBhcKXfR2EeUopvjJ5mte0XB QifRKNTY5KQoDhj5m+oS/r1yVJrAyft/HCbqkPqZlMyoSbnIXbZ2SqZUfjCL8OeYiNN8 RfEqq7sJD9JIRBq2WVau1dx4XF+hG0pSi8k0S3Ja9oSOV/yuohSb6t/w6z1Lp1+hp6/5 3gSVfPUk8Q29EoLRlDb06rfb7YCwnP/qJUIsb00VlRRQn8mxDnULIHqxVmgPY4VY66c1 IlOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:organization:references:in-reply-to:date:cc:to :reply-to:from:subject:arc-authentication-results; bh=9kyNngadxmks0OWS1OCZueQghkkoObfkfb3w6yONNfs=; b=rmD3ribXuK1UWzFVEOatlNa8yAT6jhmZBX8pxuwnX5jSu5zvoVkeSS5QR9dWb9d1vm 5to9rhXmAla5KI/PQ+iV5/GW2EBRNutzx3+YEqUtoh9BjnIlgWlksf9Dd0v2reAvPxF5 jAoGvGV3kJZ1idHOTcANKlzaQdkMMQL1Yuc0xZOopl+SUZUOXSS+YOBcMhErnYOva+O5 uqf7rO2CY8QL4f6UQ7Ke+Ya88oadEySTjNxgvI53OBMQ58O41FvcN9x2qi4QlAzhq40K 19SS05FHDIEWcfu9KnQ+JEphFpTvgRf2m0hs8yDE6jeKtr9h1DeOUBVtPL7iZOzwR9cl NCjQ== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si2894130pgt.572.2018.03.01.13.04.44; Thu, 01 Mar 2018 13:04:59 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161877AbeCAVDq (ORCPT + 99 others); Thu, 1 Mar 2018 16:03:46 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34314 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161818AbeCAVDn (ORCPT ); Thu, 1 Mar 2018 16:03:43 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w21L1VYm012342 for ; Thu, 1 Mar 2018 16:03:42 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2geqh940cd-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 01 Mar 2018 16:03:42 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Mar 2018 21:03:39 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 1 Mar 2018 21:03:34 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w21L3YVm58654972; Thu, 1 Mar 2018 21:03:34 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0349052043; Thu, 1 Mar 2018 19:55:18 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id A4B6B52041; Thu, 1 Mar 2018 19:55:17 +0000 (GMT) Received: from pasglop (unknown [9.192.160.12]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 4E715A001E; Fri, 2 Mar 2018 08:03:31 +1100 (AEDT) Subject: Re: [PATCH v2 00/10] Copy Offload in NVMe Fabrics with P2P PCI Memory From: Benjamin Herrenschmidt Reply-To: benh@au1.ibm.com To: Dan Williams Cc: Logan Gunthorpe , Linux Kernel Mailing List , linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma , linux-nvdimm , linux-block@vger.kernel.org, Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , =?ISO-8859-1?Q?J=E9r=F4me?= Glisse , Alex Williamson , Oliver OHalloran Date: Fri, 02 Mar 2018 08:03:30 +1100 In-Reply-To: References: <20180228234006.21093-1-logang@deltatee.com> <1519876489.4592.3.camel@kernel.crashing.org> <1519876569.4592.4.camel@au1.ibm.com> Organization: IBM Australia Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.5 (3.26.5-1.fc27) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18030121-0012-0000-0000-000005B79F78 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030121-0013-0000-0000-00001933A5BA Message-Id: <1519938210.4592.30.camel@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-01_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803010257 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-03-01 at 11:21 -0800, Dan Williams wrote: > > > The devm_memremap_pages() infrastructure allows placing the memmap in > "System-RAM" even if the hotplugged range is in PCI space. So, even if > it is an issue on some configurations, it's just a simple adjustment > to where the memmap is placed. Actually can you explain a bit more here ? devm_memremap_pages() doesn't take any specific argument about what to do with the memory. It does create the vmemmap sections etc... but does so by calling arch_add_memory(). So __add_memory() isn't called, which means the pages aren't added to the linear mapping. Then you manually add them to ZONE_DEVICE. Am I correct ? In that case, they indeed can't be used as normal memory pages, which is good, and if they are indeed not in the linear mapping, then there is no caching issues. However, what happens if anything calls page_address() on them ? Some DMA ops do that for example, or some devices might ... This is all quite convoluted with no documentation I can find that explains the various expectations. So the question is are those pages landing in the linear mapping, and if yes, by what code path ? The next question is if we ever want that to work on ppc64, we need a way to make this fit in our linear mapping and map it non-cachable, which will require some wrangling on how we handle that mapping. Cheers, Ben.