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


Groups > linux.kernel > #1253852

Re: [PATCH v11 15/15] HMM: add documentation explaining HMM internals and how to use it.

From Jerome Glisse <jglisse@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v11 15/15] HMM: add documentation explaining HMM internals and how to use it.
Date 2015-10-22 16:20 +0200
Message-ID <qmoSK-4U2-17@gated-at.bofh.it> (permalink)
References <qm7RT-54Y-3@gated-at.bofh.it> <qm7RU-54Y-23@gated-at.bofh.it> <qmeJH-6HD-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Oct 21, 2015 at 08:23:41PM -0700, Randy Dunlap wrote:
> Hi,
> 
> Some corrections and a few questions...

Thanks for the corrections. Answer below.

> On 10/21/15 14:00, Jérôme Glisse wrote:
> > This add documentation on how HMM works and a more in depth view of how it
> > should be use by device driver writers.
> > 
> > Signed-off-by: Jérôme Glisse <jglisse@redhat.com>

[...]

> > +synchronizing device page table for range that the device driver explicitly ask
> 
>                                        ranges                                  asks
> 
> or is only one range supported?

Several ranges are supported.


[...]

> > +  /* Mirror memory (in read mode) between addressA and addressB */
> > +  your_hmm_event->hmm_event.start = addressA;
> > +  your_hmm_event->hmm_event.end = addressB;
> 
> Multiple events (ranges) can be specified?

Device driver have to make one call per range but multiple threads can make
concurrent call for different ranges.

> Is hmm_event.end (addressB) included or excluded from the range?

Forgot to copy comment from header file, start is inclusive, end is exclusive.


[...]

> > +  struct hmm_pt_iter iter;
> > +  hmm_pt_iter_init(&iter, &mirror->pt)
> > +
> > +  /* Get pointer to HMM page table entry for a given address. */
> > +  dma_addr_t *hmm_pte;
> > +  hmm_pte = hmm_pt_iter_walk(&iter, &addr, &next);
> 
> what are 'addr' and 'next'? (types)

unsigned long will add then to the doc, good point.

[...]


> > +  /* Migrate system memory between addressA and addressB to device memory. */
> > +  your_hmm_event->hmm_event.start = addressA;
> > +  your_hmm_event->hmm_event.end = addressB;
> 
> is hmm_event.end (addressB) inclusive and exclusive?
> i.e., is it end_of_copy + 1?
> i.e., is the size of the copy addressB - addressA or
>       addressB - addressA + 1?
> i.e., is addressB = addressA + size
> or is    addressB = addressA + size - 1

Exclusive last one.


> In my experience it is usually better to have a start_address and size
> instead of start_address and end_address.

I switched several time btw the 2 offer differents version of the patchset,
it is something that can be change down the road unless you have strong
feeling about it.

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 | Next in thread | Find similar | Unroll thread


Thread

[PATCH v11 00/15] HMM (Heterogeneous Memory Management) Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
  [PATCH v11 03/15] mmu_notifier: pass page pointer to mmu_notifier_invalidate_page() v2 Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
  [PATCH v11 06/15] HMM: add HMM page table v4. Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
  [PATCH v11 07/15] HMM: add per mirror page table v4. Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
  [PATCH v11 15/15] HMM: add documentation explaining HMM internals and how to use it. Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
    Re: [PATCH v11 15/15] HMM: add documentation explaining HMM internals  and how to use it. Randy Dunlap <rdunlap@infradead.org> - 2015-10-22 05:30 +0200
      Re: [PATCH v11 15/15] HMM: add documentation explaining HMM  internals and how to use it. Jerome Glisse <jglisse@redhat.com> - 2015-10-22 16:20 +0200
      Re: [PATCH v11 15/15] HMM: add documentation explaining HMM  internals and how to use it. David Woodhouse <dwmw2@infradead.org> - 2015-10-28 02:20 +0100
        Re: [PATCH v11 15/15] HMM: add documentation explaining HMM internals  and how to use it. Randy Dunlap <rdunlap@infradead.org> - 2015-10-28 18:20 +0100
  [PATCH v11 04/15] mmu_notifier: allow range invalidation to exclude a specific mmu_notifier Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
  [PATCH v11 05/15] HMM: introduce heterogeneous memory management v5. Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
    Re: [PATCH v11 05/15] HMM: introduce heterogeneous memory management  v5. Randy Dunlap <rdunlap@infradead.org> - 2015-10-21 22:20 +0200
  [PATCH v11 11/15] HMM: add discard range helper (to clear and free resources for a range). Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
  [PATCH v11 14/15] HMM: Add support for hugetlb. Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
  [PATCH v11 13/15] HMM: DMA map memory on behalf of device driver v2. Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
  [PATCH v11 09/15] HMM: add mm page table iterator helpers. Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200
  [PATCH v11 08/15] HMM: add device page fault support v6. Jérôme Glisse <jglisse@redhat.com> - 2015-10-21 22:10 +0200

csiph-web