From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752772AbbJWDyT (ORCPT ); Thu, 22 Oct 2015 23:54:19 -0400 Received: from mail-qk0-f182.google.com ([209.85.220.182]:32807 "EHLO mail-qk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255AbbJWDyS (ORCPT ); Thu, 22 Oct 2015 23:54:18 -0400 Date: Thu, 22 Oct 2015 23:54:10 -0400 From: Jerome Glisse To: Hillf Danton Cc: "'Jerome Glisse'" , linux-mm@kvack.org, "'linux-kernel'" Subject: Re: [PATCH v11 02/14] HMM: add special swap filetype for memory migrated to device v2. Message-ID: <20151023035409.GA4404@gmail.com> References: <05ec01d10c9b$4df7ba80$e9e72f80$@alibaba-inc.com> <05f501d10c9e$a8562900$f9027b00$@alibaba-inc.com> <20151022142144.GB2914@redhat.com> <070501d10d42$2ec35190$8c49f4b0$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <070501d10d42$2ec35190$8c49f4b0$@alibaba-inc.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 23, 2015 at 11:23:26AM +0800, Hillf Danton wrote: > > > > + if (cnt_hmm_entry) { > > > > + int ret; > > > > + > > > > + ret = hmm_mm_fork(src_mm, dst_mm, dst_vma, > > > > + dst_pmd, start, end); > > > > > > Given start, s/end/addr/, no? > > > > No, end is the right upper limit here. > > > Then in the first loop, hmm_mm_fork is invoked for > the _entire_ range, from input addr to end. > In subsequent loops(if necessary), start is updated to > addr, and hmm_mm_fork is also invoked for remaining > range, from start to end. > > Is the above overlap in range making sense? Well yes and no, hmm_mm_fork() will do nothing for address >= addr i feel like end is easier to understand. Cheers, Jérôme