linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Andrea Arcangeli <andrea@qumranet.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	kvm-devel@lists.sourceforge.net, steiner@sgi.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Robin Holt <holt@sgi.com>,
	general@lists.openfabrics.org
Subject: [ofa-general] [patch 00/10] [RFC] EMM Notifier V3
Date: Fri, 04 Apr 2008 15:30:48 -0700	[thread overview]
Message-ID: <20080404223048.374852899@sgi.com> (raw)

V2->V3:
- Fix rcu issues
- Fix emm_referenced handling
- Use Andrea's mm_lock/unlock to prevent registration races.
- Keep simple API since there does not seem to be a need to add additional
  callbacks (mm_lock does not require callbacks like emm_start/stop that
  I envisioned).
- Reduce CC list (the volume we are producing here must be annoying...).

V1->V2:
- Additional optimizations in the VM
- Convert vm spinlocks to rw sems.
- Add XPMEM driver (requires sleeping in callbacks)
- Add XPMEM example

This patch implements a simple callback for device drivers that establish
their own references to pages (KVM, GRU, XPmem, RDMA/Infiniband, DMA engines
etc). These references are unknown to the VM (therefore external).

With these callbacks it is possible for the device driver to release external
references when the VM requests it. This enables swapping, page migration and
allows support of remapping, permission changes etc etc for the externally
mapped memory.

With this functionality it becomes also possible to avoid pinning or mlocking
pages (commonly done to stop the VM from unmapping device mapped pages).

A device driver must subscribe to a process using

        emm_register_notifier(struct emm_notifier *, struct mm_struct *)


The VM will then perform callbacks for operations that unmap or change
permissions of pages in that address space. When the process terminates
the callback function is called with emm_release.

Callbacks are performed before and after the unmapping action of the VM.

        emm_invalidate_start    before

        emm_invalidate_end      after

The device driver must hold off establishing new references to pages
in the range specified between a callback with emm_invalidate_start and
the subsequent call with emm_invalidate_end set. This allows the VM to
ensure that no concurrent driver actions are performed on an address
range while performing remapping or unmapping operations.


This patchset contains additional modifications needed to ensure
that the callbacks can sleep. For that purpose two key locks in the vm
need to be converted to rw_sems. These patches are brand new, invasive
and need extensive discussion and evaluation.

The first patch alone may be applied if callbacks in atomic context are
sufficient for a device driver (likely the case for KVM and GRU and simple
DMA drivers).

Following the VM modifications is the XPMEM device driver that allows sharing
of memory between processes running on different instances of Linux. This is
also a prototype. It is known to run trivial sample programs included as the last
patch.


-- 

             reply	other threads:[~2008-04-04 22:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-04 22:30 Christoph Lameter [this message]
2008-04-04 22:30 ` [ofa-general] [patch 01/10] emm: mm_lock: Lock a process against reclaim Christoph Lameter
2008-04-04 23:12   ` [ofa-general] " Jeremy Fitzhardinge
2008-04-05  0:41     ` Andrea Arcangeli
2008-04-07 13:55       ` Peter Zijlstra
2008-04-07 19:02       ` Jeremy Fitzhardinge
2008-04-07 19:35         ` Andrea Arcangeli
2008-04-04 22:30 ` [patch 02/10] emm: notifier logic Christoph Lameter
2008-04-05  0:57   ` [ofa-general] " Andrea Arcangeli
2008-04-07  5:48     ` Christoph Lameter
2008-04-07  6:06       ` Andrea Arcangeli
2008-04-07  6:20         ` Christoph Lameter
2008-04-07  7:13           ` [ofa-general] " Andrea Arcangeli
2008-04-08 20:23             ` Christoph Lameter
2008-04-09 14:29               ` Andrea Arcangeli
2008-04-04 22:30 ` [patch 03/10] emm: Move tlb flushing into free_pgtables Christoph Lameter
2008-04-04 22:30 ` [ofa-general] [patch 04/10] emm: Convert i_mmap_lock to i_mmap_sem Christoph Lameter
2008-04-04 22:30 ` [patch 05/10] emm: Remove tlb pointer from the parameters of unmap vmas Christoph Lameter
2008-04-04 22:30 ` [ofa-general] [patch 06/10] emm: Convert anon_vma lock to rw_sem and refcount Christoph Lameter
2008-04-04 22:30 ` [patch 07/10] xpmem: This patch exports zap_page_range as it is needed by XPMEM Christoph Lameter
2008-04-04 22:30 ` [patch 08/10] xpmem: Locking rules for taking multiple mmap_sem locks Christoph Lameter
2008-04-04 22:30 ` [patch 09/10] xpmem: The device driver Christoph Lameter
2008-04-04 22:30 ` [ofa-general] [patch 10/10] xpmem: Simple example Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080404223048.374852899@sgi.com \
    --to=clameter@sgi.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andrea@qumranet.com \
    --cc=general@lists.openfabrics.org \
    --cc=holt@sgi.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=steiner@sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox