All of lore.kernel.org
 help / color / mirror / Atom feed
* (no subject)
@ 2004-02-10 23:36 Bloch, Jack
  2004-02-11  1:09 ` your mail Maciej Zenczykowski
  0 siblings, 1 reply; 2+ messages in thread
From: Bloch, Jack @ 2004-02-10 23:36 UTC (permalink / raw)
  To: linux-kernel

I have a system with 2GB of memory. One of my processes calls mmap to try to
map a 100MB file into memory. This calls fails with -ENOMEM. I rebuilt the
kernel with a few debug printk statements in mmap.c to see where the failure
was occurring it occurred in the function arch_get_unmapped_area. the code
is as follows:

for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
		/* At this point:  (!vma || addr < vma->vm_end). */
		unsigned long __heap_stack_gap;
		if (TASK_SIZE - len < addr)
                { 
                        printk("%d TASK SIZE - LEN LESS THAN
ADDR\n",__LINE__);
			return -ENOMEM;
                } 
		if (!found_hole && (!vma || addr < vma->vm_start)) {
			mm->free_area_cache = addr;
			found_hole = 1;
		}
		if (!vma)
			return addr;
		__heap_stack_gap = 0;
		if (vma->vm_flags & VM_GROWSDOWN)
			__heap_stack_gap = heap_stack_gap << PAGE_SHIFT;
		if (addr + len + __heap_stack_gap <= vma->vm_start)
			return addr;
		addr = vma->vm_end;
	}

The printk is mine. What exactly is meant by the fact that TASK_SIZE - len <
addr?

Regards,


Jack Bloch 
Siemens ICN
phone                (561) 923-6550
e-mail                jack.bloch@icn.siemens.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-02-11  1:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-10 23:36 Bloch, Jack
2004-02-11  1:09 ` your mail Maciej Zenczykowski

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.