* [PATCH] sg: do not set VM_IO flag on mmap-ed pages
@ 2005-09-09 7:18 Douglas Gilbert
0 siblings, 0 replies; only message in thread
From: Douglas Gilbert @ 2005-09-09 7:18 UTC (permalink / raw)
To: linux-scsi; +Cc: James.Bottomley, ahmed.teirelbar
[-- Attachment #1: Type: text/plain, Size: 981 bytes --]
Further to the problem discussed in this post:
http://marc.theaimsgroup.com/?l=linux-scsi&m=112540053711489&w=2
It seems that the sg driver does not need to set the VM_IO flag
on pages that it memory maps to the user space since they are
not from the IO space. Ahmed Teirelbar <ahmed.teirelbar@adic.com>
wants the facility and has tested this patch as I have without
adverse effects.
Patch is against lk 2.6.13 with this "[PATCH] sg direct io/mmap
oops, st sync" applied.
The oops protection is still important. Some users really did
try and use dio transfers from the sg driver to memory mapped
IO space (on a video capture card if my memory serves) during the
lk 2.4 series. I'm not sure how successful it was but that will
now be politely refused in lk 2.6.13+ .
Changelog:
- set the page flags for sg's reserved buffer mmap-ed
to the user space to VM_RESERVED (rather than
VM_RESERVED | VM_IO )
Signed-off-by: Douglas Gilbert <dougg@torque.net>
Doug Gilbert
[-- Attachment #2: sg_lk2613kai_vmio.diff --]
[-- Type: text/x-patch, Size: 645 bytes --]
--- linux/drivers/scsi/sg.c 2005-09-01 21:30:39.000000000 +1000
+++ linux/drivers/scsi/sg.c2613kai_vmio 2005-09-08 20:36:39.000000000 +1000
@@ -61,7 +61,7 @@
#ifdef CONFIG_SCSI_PROC_FS
#include <linux/proc_fs.h>
-static char *sg_version_date = "20050901";
+static char *sg_version_date = "20050908";
static int sg_proc_init(void);
static void sg_proc_cleanup(void);
@@ -1300,7 +1300,7 @@
sg_rb_correct4mmap(rsv_schp, 1); /* do only once per fd lifetime */
sfp->mmap_called = 1;
}
- vma->vm_flags |= (VM_RESERVED | VM_IO);
+ vma->vm_flags |= VM_RESERVED;
vma->vm_private_data = sfp;
vma->vm_ops = &sg_mmap_vm_ops;
return 0;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-09-09 7:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-09 7:18 [PATCH] sg: do not set VM_IO flag on mmap-ed pages Douglas Gilbert
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.