From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: Stack & policy References: From: James Antill Reply-To: Mime-Version: 1.0 (generated by tm-edit 1.5) Content-Type: text/plain; charset=US-ASCII Date: 12 Apr 2000 11:05:25 -0400 In-Reply-To: Stelios Xanthakis's message of "Wed, 12 Apr 2000 17:45:59 +0300 (EEST)" Message-ID: Sender: owner-linux-mm@kvack.org Return-Path: To: axanth@tee.gr Cc: linux-mm@kvack.org List-ID: > Hi > > Some time ago I posted a message about a kernel feature where the > application can request the vma->vm_start of its stack virtual memory area > in order to unmap part of the unused stack (esp - vma->vm_start). > > Such a feature is very useful for an alternative programming technique. Have you seen jamie and chuck talking about madvise() flags ? Just doing madvise(cur_stack, MADV_DONTNEED, cur_stack - end_stack)[1] after a function that uses alloca() or has a large auto should be a pretty simple addition to gcc (although you might not want to put it there). Those seem like a much better idea to me, as they can also be used in pthreads (much as I hate pthreads) and other bits of memory that has similar usage patterns. This would also be much more likely to work on other OSes. [1] I think I have the API correct but I don't have access to it atm. -- James Antill -- james@and.org "If we can't keep this sort of thing out of the kernel, we might as well pack it up and go run Solaris." -- Larry McVoy. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/