Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758498AbcJ1Hfq (ORCPT ); Fri, 28 Oct 2016 03:35:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36200 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752849AbcJ1Hfp (ORCPT ); Fri, 28 Oct 2016 03:35:45 -0400 From: "Aneesh Kumar K.V" To: Jerome Glisse Cc: Anshuman Khandual , linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.com, js1304@gmail.com, vbabka@suse.cz, mgorman@suse.de, minchan@kernel.org, akpm@linux-foundation.org, bsingharora@gmail.com Subject: Re: [RFC 0/8] Define coherent device memory node In-Reply-To: <20161026160721.GA13638@gmail.com> References: <1477283517-2504-1-git-send-email-khandual@linux.vnet.ibm.com> <20161024170902.GA5521@gmail.com> <87a8dtawas.fsf@linux.vnet.ibm.com> <20161025151637.GA6072@gmail.com> <87y41bcqow.fsf@linux.vnet.ibm.com> <20161026160721.GA13638@gmail.com> Date: Fri, 28 Oct 2016 10:59:52 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102807-8235-0000-0000-0000097CCA25 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005992; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000189; SDB=6.00773825; UDB=6.00371614; IPR=6.00550626; BA=6.00004837; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013125; XFM=3.00000011; UTC=2016-10-28 07:35:43 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102807-8236-0000-0000-000035FF9560 Message-Id: <878tt96nxr.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-28_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610280132 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1983 Lines: 51 Jerome Glisse writes: > On Wed, Oct 26, 2016 at 04:39:19PM +0530, Aneesh Kumar K.V wrote: >> Jerome Glisse writes: >> >> > On Tue, Oct 25, 2016 at 09:56:35AM +0530, Aneesh Kumar K.V wrote: >> >> Jerome Glisse writes: >> >> >> >> > On Mon, Oct 24, 2016 at 10:01:49AM +0530, Anshuman Khandual wrote: >> >> > >> >> I looked at the hmm-v13 w.r.t migration and I guess some form of device >> >> callback/acceleration during migration is something we should definitely >> >> have. I still haven't figured out how non addressable and coherent device >> >> memory can fit together there. I was waiting for the page cache >> >> migration support to be pushed to the repository before I start looking >> >> at this closely. >> >> >> > >> > The page cache migration does not touch the migrate code path. My issue with >> > page cache is writeback. The only difference with existing migrate code is >> > refcount check for ZONE_DEVICE page. Everything else is the same. >> >> What about the radix tree ? does file system migrate_page callback handle >> replacing normal page with ZONE_DEVICE page/exceptional entries ? >> > > It use the exact same existing code (from mm/migrate.c) so yes the radix tree > is updated and buffer_head are migrated. > I looked at the the page cache migration patches shared and I find that you are not using exceptional entries when we migrate a page cache page to device memory. But I am now not sure how a read from page cache will work with that. ie, a file system read will now find the page in page cache. But we cannot do a copy_to_user of that page because that is now backed by an unaddressable memory right ? do_generic_file_read() does page = find_get_page(mapping, index); .... ret = copy_page_to_iter(page, offset, nr, iter); which does void *kaddr = kmap_atomic(page); size_t wanted = copy_to_iter(kaddr + offset, bytes, i); kunmap_atomic(kaddr); -aneesh