[patch 1/3] drm: nopage

Previous thread: Use device mapper to redirect to cache server? by Ph. Marek on Tuesday, January 8, 2008 - 5:30 am. (1 message)

Next thread: [TOMOYO #6 02/21] Add struct vfsmount to struct task_struct. by Kentaro Takeda on Tuesday, January 8, 2008 - 5:49 am. (3 messages)
To: Andrew Morton <akpm@...>
Cc: <airlied@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, January 8, 2008 - 5:38 am

Dave, this patch is against 2.6.24-rc6-mm1. You said git-drm had rewritten this area,
but the patch didn't have any rejects and seems to run fine here (although I'm not
exactly sure how to exercise drm too well).

Anyway, please apply.

--

drm: nopage

Convert drm from nopage to fault.
Remove redundant vma range checks.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: airlied@linux.ie
Cc: linux-kernel@vger.kernel.org
---
drivers/char/drm/drm_vm.c | 131 +++++++++++++++++++++-------------------------
1 file changed, 61 insertions(+), 70 deletions(-)

Index: linux-2.6/drivers/char/drm/drm_vm.c
===================================================================
--- linux-2.6.orig/drivers/char/drm/drm_vm.c
+++ linux-2.6/drivers/char/drm/drm_vm.c
@@ -70,7 +70,7 @@ static pgprot_t drm_io_prot(uint32_t map
}

/**
- * \c nopage method for AGP virtual memory.
+ * \c fault method for AGP virtual memory.
*
* \param vma virtual memory area.
* \param address access address.
@@ -80,8 +80,8 @@ static pgprot_t drm_io_prot(uint32_t map
* map, get the page, increment the use count and return it.
*/
#if __OS_HAS_AGP
-static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma,
- unsigned long address)
+static __inline__ int drm_do_vm_fault(struct vm_area_struct *vma,
+ struct vm_fault *vmf)
{
struct drm_file *priv = vma->vm_file->private_data;
struct drm_device *dev = priv->head->dev;
@@ -93,19 +93,24 @@ static __inline__ struct page *drm_do_vm
* Find the right map
*/
if (!drm_core_has_AGP(dev))
- goto vm_nopage_error;
+ goto vm_fault_error;

if (!dev->agp || !dev->agp->cant_use_aperture)
- goto vm_nopage_error;
+ goto vm_fault_error;

if (drm_ht_find_item(&dev->map_hash, vma->vm_pgoff, &hash))
- goto vm_nopage_error;
+ goto vm_fault_error;

r_list = drm_hash_entry(hash, struct drm_map_list, hash);
map = r_list->map;

if (map && map->type == ...

To: Nick Piggin <npiggin@...>
Cc: Andrew Morton <akpm@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, January 8, 2008 - 6:25 pm

Hi Nick,

there should be a new nopage method added though which you need to
convert..

--

To: Dave Airlie <airlied@...>
Cc: Andrew Morton <akpm@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, January 8, 2008 - 6:30 pm

Well they're all gone.. ;)

There is a nopfn method which I converted in a subsequent patch I sent you.
Maybe that's what you mean?

Thanks,
--

To: Nick Piggin <npiggin@...>
Cc: Andrew Morton <akpm@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, January 8, 2008 - 6:33 pm

Ah thats what it was, we added a nopfn not a nopage..

Thanks,

--

To: Andrew Morton <akpm@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, Linux Memory Management List <linux-mm@...>
Date: Tuesday, January 8, 2008 - 5:41 am

Patch against 2.6.24-rc6-mm1... nothing in your tree appears to use nopage.
This patch should transfer without rejects upstream, so it shouldn't be too
difficult.

Would be nice to get in 2.6.25 if we can.

---

mm: remove nopage

Nothing in the tree uses nopage any more. Remove support for it in the
core mm code and documentation (and a few stray references to it in comments).

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
---
Documentation/feature-removal-schedule.txt | 9 --------
Documentation/filesystems/Locking | 3 --
drivers/media/video/vino.c | 2 -
drivers/video/vermilion/vermilion.c | 5 ++--
include/linux/mm.h | 8 -------
mm/memory.c | 32 ++++++++++-------------------
mm/mincore.c | 2 -
mm/mmap.c | 20 +++++++++---------
mm/rmap.c | 1
9 files changed, 27 insertions(+), 55 deletions(-)

Index: linux-2.6/include/linux/mm.h
===================================================================
--- linux-2.6.orig/include/linux/mm.h
+++ linux-2.6/include/linux/mm.h
@@ -166,8 +166,6 @@ struct vm_operations_struct {
void (*open)(struct vm_area_struct * area);
void (*close)(struct vm_area_struct * area);
int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
- struct page *(*nopage)(struct vm_area_struct *area,
- unsigned long address, int *type);
unsigned long (*nopfn)(struct vm_area_struct *area,
unsigned long address);

@@ -642,12 +640,6 @@ static inline int page_mapped(struct pag
}

/*
- * Error return values for the *_nopage functions
- */
-#define NOPAGE_SIGBUS (NULL)
-#define NOPAGE_OOM ((struct page *) (-1))
-
-/*
* Error return values for the *_nopfn functions
*/
#define NOPFN_SIGBUS ((unsigned long) -1)
Index: linux-2.6/mm/memory.c
===============...

Previous thread: Use device mapper to redirect to cache server? by Ph. Marek on Tuesday, January 8, 2008 - 5:30 am. (1 message)

Next thread: [TOMOYO #6 02/21] Add struct vfsmount to struct task_struct. by Kentaro Takeda on Tuesday, January 8, 2008 - 5:49 am. (3 messages)