The patch titled mm: incorrect VM_FAULT_OOM returns from drivers has been added to the -mm tree. Its filename is mm-incorrect-vm_fault_oom-returns-from-drivers.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: mm: incorrect VM_FAULT_OOM returns from drivers From: Nick Piggin <npiggin@xxxxxxx> Some drivers are returning OOM when it is not in response to a memory shortage. Signed-off-by: Nick Piggin <npiggin@xxxxxxx> Cc: Dave Airlie <airlied@xxxxxxxx> Cc: Jaroslav Kysela <perex@xxxxxxx> Cc: Takashi Iwai <tiwai@xxxxxxx> Cc: Greg KH <greg@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/char/drm/drm_vm.c | 8 ++++---- sound/core/pcm_native.c | 10 +++++----- sound/oss/via82cxxx_audio.c | 4 ++-- sound/usb/usx2y/usX2Yhwdep.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff -puN drivers/char/drm/drm_vm.c~mm-incorrect-vm_fault_oom-returns-from-drivers drivers/char/drm/drm_vm.c --- a/drivers/char/drm/drm_vm.c~mm-incorrect-vm_fault_oom-returns-from-drivers +++ a/drivers/char/drm/drm_vm.c @@ -147,14 +147,14 @@ static __inline__ struct page *drm_do_vm if (address > vma->vm_end) return NOPAGE_SIGBUS; /* Disallow mremap */ if (!map) - return NOPAGE_OOM; /* Nothing allocated */ + return NOPAGE_SIGBUS; /* Nothing allocated */ offset = address - vma->vm_start; i = (unsigned long)map->handle + offset; page = (map->type == _DRM_CONSISTENT) ? virt_to_page((void *)i) : vmalloc_to_page((void *)i); if (!page) - return NOPAGE_OOM; + return NOPAGE_SIGBUS; get_page(page); DRM_DEBUG("shm_nopage 0x%lx\n", address); @@ -272,7 +272,7 @@ static __inline__ struct page *drm_do_vm if (address > vma->vm_end) return NOPAGE_SIGBUS; /* Disallow mremap */ if (!dma->pagelist) - return NOPAGE_OOM; /* Nothing allocated */ + return NOPAGE_SIGBUS; /* Nothing allocated */ offset = address - vma->vm_start; /* vm_[pg]off[set] should be 0 */ page_nr = offset >> PAGE_SHIFT; @@ -310,7 +310,7 @@ static __inline__ struct page *drm_do_vm if (address > vma->vm_end) return NOPAGE_SIGBUS; /* Disallow mremap */ if (!entry->pagelist) - return NOPAGE_OOM; /* Nothing allocated */ + return NOPAGE_SIGBUS; /* Nothing allocated */ offset = address - vma->vm_start; map_offset = map->offset - (unsigned long)dev->sg->virtual; diff -puN sound/core/pcm_native.c~mm-incorrect-vm_fault_oom-returns-from-drivers sound/core/pcm_native.c --- a/sound/core/pcm_native.c~mm-incorrect-vm_fault_oom-returns-from-drivers +++ a/sound/core/pcm_native.c @@ -3025,7 +3025,7 @@ static struct page * snd_pcm_mmap_status struct page * page; if (substream == NULL) - return NOPAGE_OOM; + return NOPAGE_SIGBUS; runtime = substream->runtime; page = virt_to_page(runtime->status); get_page(page); @@ -3068,7 +3068,7 @@ static struct page * snd_pcm_mmap_contro struct page * page; if (substream == NULL) - return NOPAGE_OOM; + return NOPAGE_SIGBUS; runtime = substream->runtime; page = virt_to_page(runtime->control); get_page(page); @@ -3129,18 +3129,18 @@ static struct page *snd_pcm_mmap_data_no size_t dma_bytes; if (substream == NULL) - return NOPAGE_OOM; + return NOPAGE_SIGBUS; runtime = substream->runtime; offset = area->vm_pgoff << PAGE_SHIFT; offset += address - area->vm_start; - snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); + snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_SIGBUS); dma_bytes = PAGE_ALIGN(runtime->dma_bytes); if (offset > dma_bytes - PAGE_SIZE) return NOPAGE_SIGBUS; if (substream->ops->page) { page = substream->ops->page(substream, offset); if (! page) - return NOPAGE_OOM; + return NOPAGE_OOM; /* XXX: is this really due to OOM? */ } else { vaddr = runtime->dma_area + offset; page = virt_to_page(vaddr); diff -puN sound/oss/via82cxxx_audio.c~mm-incorrect-vm_fault_oom-returns-from-drivers sound/oss/via82cxxx_audio.c --- a/sound/oss/via82cxxx_audio.c~mm-incorrect-vm_fault_oom-returns-from-drivers +++ a/sound/oss/via82cxxx_audio.c @@ -2120,8 +2120,8 @@ static struct page * via_mm_nopage (stru return NOPAGE_SIGBUS; /* Disallow mremap */ } if (!card) { - DPRINTK ("EXIT, returning NOPAGE_OOM\n"); - return NOPAGE_OOM; /* Nothing allocated */ + DPRINTK ("EXIT, returning NOPAGE_SIGBUS\n"); + return NOPAGE_SIGBUS; /* Nothing allocated */ } pgoff = vma->vm_pgoff + ((address - vma->vm_start) >> PAGE_SHIFT); diff -puN sound/usb/usx2y/usX2Yhwdep.c~mm-incorrect-vm_fault_oom-returns-from-drivers sound/usb/usx2y/usX2Yhwdep.c --- a/sound/usb/usx2y/usX2Yhwdep.c~mm-incorrect-vm_fault_oom-returns-from-drivers +++ a/sound/usb/usx2y/usX2Yhwdep.c @@ -48,7 +48,7 @@ static struct page * snd_us428ctls_vm_no offset = area->vm_pgoff << PAGE_SHIFT; offset += address - area->vm_start; - snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); + snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_SIGBUS); vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->us428ctls_sharedmem + offset; page = virt_to_page(vaddr); get_page(page); _ Patches currently in -mm which might be from npiggin@xxxxxxx are origin.patch oom-dont-kill-unkillable-children-or-siblings.patch oom-cleanup-messages.patch oom-less-memdie.patch mm-incorrect-vm_fault_oom-returns-from-drivers.patch mm-add-arch_alloc_page.patch radix-tree-rcu-lockless-readside.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html