mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-13 16:40:22 +00:00
[PATCH] spufs: fix local store page refcounting
With the new rules for reserved pages, the spufs now needs working page reference counting. I should probably look into converting to vm_insert_page, but for now this patch makes spufs work again. Signed-off-by: Arnd Bergmann <arndb@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
39c73c332c
commit
d88cfffac0
@ -114,7 +114,7 @@ static void __init cell_spuprop_present(struct device_node *spe,
|
|||||||
for (pfn = start_pfn; pfn < end_pfn; pfn++) {
|
for (pfn = start_pfn; pfn < end_pfn; pfn++) {
|
||||||
struct page *page = pfn_to_page(pfn);
|
struct page *page = pfn_to_page(pfn);
|
||||||
set_page_links(page, ZONE_DMA, node_id, pfn);
|
set_page_links(page, ZONE_DMA, node_id, pfn);
|
||||||
set_page_count(page, 0);
|
set_page_count(page, 1);
|
||||||
reset_page_mapcount(page);
|
reset_page_mapcount(page);
|
||||||
SetPageReserved(page);
|
SetPageReserved(page);
|
||||||
INIT_LIST_HEAD(&page->lru);
|
INIT_LIST_HEAD(&page->lru);
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/ioctl.h>
|
#include <linux/ioctl.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
#include <linux/pagemap.h>
|
||||||
#include <linux/poll.h>
|
#include <linux/poll.h>
|
||||||
|
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
@ -106,6 +107,7 @@ spufs_mem_mmap_nopage(struct vm_area_struct *vma,
|
|||||||
if (type)
|
if (type)
|
||||||
*type = VM_FAULT_MINOR;
|
*type = VM_FAULT_MINOR;
|
||||||
|
|
||||||
|
page_cache_get(page);
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,7 +122,6 @@ spufs_mem_mmap(struct file *file, struct vm_area_struct *vma)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* FIXME: */
|
/* FIXME: */
|
||||||
vma->vm_flags |= VM_RESERVED;
|
|
||||||
vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
|
vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
|
||||||
| _PAGE_NO_CACHE);
|
| _PAGE_NO_CACHE);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user