From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] set VM_RESERVED for remapped mem
Date: Sun, 26 Feb 2006 20:47:15 +0100 [thread overview]
Message-ID: <440205C3.80900@domain.hid> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 508 bytes --]
Hi,
while reviewing my own rtdm_mmap-code again, I noticed that the wrapped
remap_pfn_range() sets VM_RESERVED (+ some other bits) on the passed vma
while the compatibility function remap_page_range() doesn't do this.
This flag seems to exclude the vma from swapping considerations.
Adding the bit to the wrapper appears to me as the best way to catch
this on older kernels. And this should also make the VM_LOCKED setting
obsolete in nucleus/heap.c.
Feel free to correct/enlighten me.
Jan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: set-VM_RESERVED.patch --]
[-- Type: text/x-patch; name="set-VM_RESERVED.patch", Size: 1772 bytes --]
Index: include/asm-generic/wrappers.h
===================================================================
--- include/asm-generic/wrappers.h (Revision 600)
+++ include/asm-generic/wrappers.h (Arbeitskopie)
@@ -46,8 +46,10 @@
#define module_param_named(name,var,type,mode) module_param(var,type,mode)
/* VM */
-#define wrap_remap_page_range(vma,from,to,size,prot) \
- remap_page_range(from,to,size,prot)
+#define wrap_remap_page_range(vma,from,to,size,prot) do { \
+ vma->flags |= VM_RESERVED; \
+ remap_page_range(from,to,size,prot); \
+} while (0)
#define wrap_switch_mm(prev,next,task) \
switch_mm(prev,next,task,(task)->processor)
#define wrap_enter_lazy_tlb(mm,task) \
@@ -145,8 +147,10 @@
#define wrap_remap_page_range(vma,from,to,size,prot) \
remap_pfn_range(vma,from,(to) >> PAGE_SHIFT,size,prot)
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) */
-#define wrap_remap_page_range(vma,from,to,size,prot) \
- remap_page_range(vma,from,to,size,prot)
+#define wrap_remap_page_range(vma,from,to,size,prot) do { \
+ vma->flags |= VM_RESERVED; \
+ remap_page_range(vma,from,to,size,prot); \
+} while (0)
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10) */
#define wrap_switch_mm(prev,next,task) \
switch_mm(prev,next,task)
Index: ksrc/nucleus/heap.c
===================================================================
--- ksrc/nucleus/heap.c (Revision 600)
+++ ksrc/nucleus/heap.c (Arbeitskopie)
@@ -948,7 +948,6 @@
return -ENXIO; /* Doesn't match the heap size. */
vma->vm_ops = &xnheap_vmops;
- vma->vm_flags |= VM_LOCKED; /* Don't swap this out. */
vma->vm_private_data = file->private_data;
vaddr = (unsigned long)heap->archdep.heapbase;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next reply other threads:[~2006-02-26 19:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-26 19:47 Jan Kiszka [this message]
2006-02-27 1:23 ` [Xenomai-core] [PATCH] set VM_RESERVED for remapped mem Philippe Gerum
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=440205C3.80900@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=xenomai@xenomai.org \
/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 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.