Re: Memory lock problem in Linux

Wolfram Gloger (wmglo@dent.med.uni-muenchen.de)
16 Oct 1997 13:40:28 -0000


> You should get a seg fault. I've only tested this on Alpha, but I'm
> sure it's there for all architectures. Can someone fix this? It's
> keeping me from developing real-time apps in Linux. Richard Henderson,
> and others have a patch for this, (which works) but it's not in the
> production source tree yet. :-( Can someone create (or get) the patch
> and submit it to Linus?

I've done this two days ago, so Linus has the patch (I append it below
for completeness). I haven't heard back yet.

Regards,
Wolfram.

-- 
`Surf the sea, not double-u three...'
wmglo@dent.med.uni-muenchen.de

--- mm/mlock.c.orig Wed Aug 13 11:32:30 1997 +++ mm/mlock.c Mon Oct 13 15:24:10 1997 @@ -124,10 +124,12 @@ pages = -pages; vma->vm_mm->locked_vm += pages; - if (newflags & VM_LOCKED) + if ((newflags & VM_LOCKED) && (newflags & VM_READ)) while (start < end) { - char c = get_user((char *) start); + int c = get_user((int *) start); __asm__ __volatile__("": :"r" (c)); + if (newflags & VM_WRITE) + put_user(c, (int *) start); start += PAGE_SIZE; } }