Skip to contentSkip to conversation

EAGAIN in do_mmap_pgoff() [2.6.7-rc1]

DISCUSSION Herbert Poetzl 2 participants 2 messages May 24, 2004

lore
Share & tools
lore
#0 lore raw

just a short question:

is -EAGAIN here really intentional? wouldn't -ENOMEM be better?

mm/mmap.c ~780 do_mmap_pgoff()

        /* mlock MCL_FUTURE? */
        if (vm_flags & VM_LOCKED) {
                unsigned long locked = mm->locked_vm << PAGE_SHIFT;
                locked += len;
                if (locked > current->rlim[RLIMIT_MEMLOCK].rlim_cur)
                        return -EAGAIN;
        }

TIA,
Herbert

#1 lore raw
Quoted 7 lines · * Herbert Poetzl ([email protected]) wrote:

just a short question:

is -EAGAIN here really intentional? wouldn't -ENOMEM be better?

mm/mmap.c ~780 do_mmap_pgoff()

Quoted 7 lines
        /* mlock MCL_FUTURE? */
        if (vm_flags & VM_LOCKED) {
                unsigned long locked = mm->locked_vm << PAGE_SHIFT;
                locked += len;
                if (locked > current->rlim[RLIMIT_MEMLOCK].rlim_cur)
                        return -EAGAIN;
        }

Standards require this one:

[EAGAIN]
[ML] The mapping could not be locked in memory, if required by
mlockall(), due to a lack of resources.

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net