Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1173853

Re: [PATCH 07/36] HMM: add per mirror page table v3.

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Jerome Glisse <j.glisse@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 07/36] HMM: add per mirror page table v3.
Date Mon, 29 Jun 2015 17:00:02 +0200
Message-ID <pGIHo-683-13@gated-at.bofh.it> (permalink)
References <psEtX-7Li-7@gated-at.bofh.it> <psEtZ-7Li-55@gated-at.bofh.it> <pForo-69U-13@gated-at.bofh.it> <pFEZd-4pz-21@gated-at.bofh.it> <pFOFb-1Gl-7@gated-at.bofh.it>
X-Original-To Mark Hairgrove <mhairgrove@nvidia.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=lEfKfW5z1qY+IwtUq6z/bXtPj7EytJ2lnXuAEtq5MtE=; b=j4bRgIfzNcw6Lj+ZVQx6z8tnFW5qYKEv2wIaYW59pqRtkVecphMjsWFMZhNSXVZK0H fnOlk92x6tvFnBXeZ7apOukEYeA6OMwkmA1xmblJSiqxWonevAaCG/S8l5Gw6RMHoZns LTmNPKbaCY8H6YbNlKE6KQMmT8jDv4Y3sMRqp+Zcq5AkFLyQEOQ7yP7QCyRByz7aibPH pUluMpDI/RH5XeX3bJ7Z6ibZEOXKrKKwKj448eFyZQm7/jNe7+EglvVTEcmcmce0joCI XDs0fKxldZceSznODbnc8bK167HJ2l78V+Mm645CYRFrspasFVosHBqGqQs3JX+NqLUP RPxA==
X-Received by 10.140.128.206 with SMTP id 197mr20791731qha.23.1435589459905; Mon, 29 Jun 2015 07:50:59 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-1
Content-Disposition inline
Content-Transfer-Encoding 8bit
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 54
Organization linux.* mail to news gateway
X-Original-Cc "akpm@linux-foundation.org" <akpm@linux-foundation.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, Linus Torvalds <torvalds@linux-foundation.org>, "joro@8bytes.org" <joro@8bytes.org>, Mel Gorman <mgorman@suse.de>, "H. Peter Anvin" <hpa@zytor.com>, Peter Zijlstra <peterz@infradead.org>, Andrea Arcangeli <aarcange@redhat.com>, Johannes Weiner <jweiner@redhat.com>, Larry Woodman <lwoodman@redhat.com>, Rik van Riel <riel@redhat.com>, Dave Airlie <airlied@redhat.com>, Brendan Conoboy <blc@redhat.com>, Joe Donohue <jdonohue@redhat.com>, Duncan Poole <dpoole@nvidia.com>, Sherry Cheung <SCheung@nvidia.com>, Subhash Gutti <sgutti@nvidia.com>, John Hubbard <jhubbard@nvidia.com>, Lucien Dunning <ldunning@nvidia.com>, Cameron Buschardt <cabuschardt@nvidia.com>, Arvind Gopalakrishnan <arvindg@nvidia.com>, Haggai Eran <haggaie@mellanox.com>, Shachar Raindel <raindel@mellanox.com>, Liran Liss <liranl@mellanox.com>, Roland Dreier <roland@purestorage.com>, Ben Sander <ben.sander@amd.com>, Greg Stoner <Greg.Stoner@amd.com>, John Bridgman <John.Bridgman@amd.com>, Michael Mantor <Michael.Mantor@amd.com>, Paul Blinzer <Paul.Blinzer@amd.com>, Laurent Morichetti <Laurent.Morichetti@amd.com>, Alexander Deucher <Alexander.Deucher@amd.com>, Oded Gabbay <Oded.Gabbay@amd.com>, Jérôme Glisse <jglisse@redhat.com>, Jatin Kumar <jakumar@nvidia.com>
X-Original-Date Mon, 29 Jun 2015 10:50:54 -0400
X-Original-Message-ID <20150629145053.GB2173@gmail.com>
X-Original-References <1432236705-4209-1-git-send-email-j.glisse@gmail.com> <1432236705-4209-8-git-send-email-j.glisse@gmail.com> <alpine.DEB.2.00.1506251557480.28614@mdh-linux64-2.nvidia.com> <20150626164338.GB3748@gmail.com> <alpine.DEB.2.00.1506261958010.22464@mdh-linux64-2.nvidia.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1173853

Show key headers only | View raw


On Fri, Jun 26, 2015 at 08:02:03PM -0700, Mark Hairgrove wrote:
> On Fri, 26 Jun 2015, Jerome Glisse wrote:
> > On Thu, Jun 25, 2015 at 04:05:48PM -0700, Mark Hairgrove wrote:
> > > On Thu, 21 May 2015, j.glisse@gmail.com wrote:
> > > > From: Jérôme Glisse <jglisse@redhat.com>
> > > > [...]
> > > >  
> > > > +	/* update() - update device mmu following an event.
> > > > +	 *
> > > > +	 * @mirror: The mirror that link process address space with the device.
> > > > +	 * @event: The event that triggered the update.
> > > > +	 * Returns: 0 on success or error code {-EIO, -ENOMEM}.
> > > > +	 *
> > > > +	 * Called to update device page table for a range of address.
> > > > +	 * The event type provide the nature of the update :
> > > > +	 *   - Range is no longer valid (munmap).
> > > > +	 *   - Range protection changes (mprotect, COW, ...).
> > > > +	 *   - Range is unmapped (swap, reclaim, page migration, ...).
> > > > +	 *   - Device page fault.
> > > > +	 *   - ...
> > > > +	 *
> > > > +	 * Thought most device driver only need to use pte_mask as it reflects
> > > > +	 * change that will happen to the HMM page table ie :
> > > > +	 *   new_pte = old_pte & event->pte_mask;
> > > 
> > > Documentation request: It would be useful to break down exactly what is 
> > > required from the driver for each event type here, and what extra 
> > > information is provided by the type that isn't provided by the pte_mask.
> > 
> > Mostly event tell you if you need to free or not the device page table for
> > the range, which is not something you can infer from the pte_mask reliably.
> > Difference btw migration and munmap for instance, same pte_mask but range
> > is still valid in the migration case it will just be backed by a new set of
> > pages.
> 
> Given that event->pte_mask and event->type provide redundant information, 
> are they both necessary?

Like said, you can not infer event->type from pte_mask but you can infer
pte_mask from event->type. The idea is behind providing pte_mask is that
simple driver can just use that with the iter walk and simply mask the HMM
page table entry they read ((*ptep) & pte_mask) to repopulate the device
page table.

So yes pte_mask is redundant but i think it will be useful for a range of
device driver.

Cheers,
Jérôme
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 07/36] HMM: add per mirror page table v3. Mark Hairgrove <mhairgrove@nvidia.com> - 2015-06-26 01:10 +0200
  Re: [PATCH 07/36] HMM: add per mirror page table v3. Jerome Glisse <j.glisse@gmail.com> - 2015-06-29 17:00 +0200

csiph-web