Re: [ANN] unionfs patchset-13 release

2006-06-10 Thread Hiroo Ono
At Wed, 31 May 2006 13:38:14 +0200,
Alexander Leidinger wrote:
> He's not a src-committer and he prefers to let a src-committer do it.  
> I offered to commit it, but so far either the man-page was missing  
> (what's the status of this?) or a bug showed up.

Daichi and ozawa do not have enough time to write the manual page.
I talked with daichi that I will write the manpage update to
mount_unionfs.8.

My english is not so good, so I think the patch to the manual page
I am going to make should be intensively reviewed.  I will send it
to -fs and -current for review in a few days.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


valid VMA ranges and mincore()

2006-06-10 Thread Bruno Haible
Hi memory management hackers,

The mincore(2) system call is, on FreeBSD, not usable for some purposes
for which it can be used on other platforms. Let me explain the purpose,
the problem and two proposed solutions.


The purpose
===

The task at hand is to enumerate the VMAs of the current process.
In other words, determine which address ranges are mapped and which aren't.
If the /proc filesystem is available, the /proc/curproc/map file
can be opened and parsed; it contains the necessary information.
But I'm being told that /proc is not mounted by default, and as an
application developer I have no control over that. So, I must look for
a solution that works also when /proc is not mounted.

The purpose of this task can be
  a) To detect whether a SIGSEGV is actually a stack overflow, a
 write access to a read-only memory page, or simply a bug in
 the program. If the fault address is near to the stack segment,
 it's likely a stack overflow; if it's nearer to a data segment,
 it's more likely a bug.
  b) To choose optimal addresses for mmap with MAP_FIXED that obey
 some constraints about lengths and bit patterns.

Ideally the OS would have a system call that allows to iterate over
the VMAs of the current process (corresponding to the lines of
/proc/curproc/map), or to retrieve the list of VMAs as a big array.

Lacking such a system call, on platforms other than FreeBSD, for example
NetBSD, I can use mincore() instead.


The problem
===

On NetBSD, Linux, Solaris, mincore() applied to a range of addresses that
is partially not mapped, returns -1 with errno set to ENOMEM. See

  NetBSD:  
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/sys/mincore.2?rev=1.19&content-type=text/plain
  Linux:http://linux.about.com/library/cmd/blcmdl2_mincore.htm
  Solaris:  http://docs.sun.com/app/docs/doc/816-5167/6mbb2jaib?a=view

This is consistent with mprotect(), which also fails with errno = ENOMEM
if the address range is not fully mapped.

FreeBSD doesn't work this way: it fills 0 values into the array passed
as argument instead, a 0 for each unmapped page. This makes it impossible
to distinguish
   a page which is valid address range but currently swapped out
from
   a page which is unmapped.

As a consequence, mincore() does not help for the aforementioned purpose.


Proposals
=

Alternatively:

Proposal 1: Change mincore() to behave like the one on NetBSD, Linux,
Solaris.

Proposal 2: Define a new constant MINCORE_MAPPED != 0, and change mincore()
to set the per-page value to
   - MINCORE_MAPPED for a page that is mapped but swapped out,
   - 0 for a page which is unmapped address range.

Proposal 1 would have the advantage to lead to the same code across
platforms.

Proposal 2 would have the advantage to be backward compatible.


Can you do something about this?

   Bruno  (an application programmer, not a FreeBSD kernel hacker)
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Jail-Aware Scheduling

2006-06-10 Thread Chris Jones


Hi, folks --- as some of you might know, FreeBSD has a Summer of Code  
project to bring resource limits to jails, and one part of that is to  
permit an administrator to put limits on a jail's CPU usage.  That's  
where I come in: I'm the guy doing the project, and I've been  
spending the last two weeks coming up to speed on scheduling and the  
like.


What I'd like from freebsd-hackers is the following:

  - are there any good references on scheduling that you know of  
which I should read?  I've already got Design & Implementation of  
FreeBSD and the Petrou / Milford / Gibson and Waldspurger / Weihl  
papers on lottery scheduling.


  - what're your thoughts on making the existing scheduler jail- 
aware as opposed to writing a sort of 'meta-scheduler' that would  
schedule between jails, and then delegate to a scheduler per jail  
(which could be very similar, if not identical, to the existing  
scheduler)?  I've got some very preliminary thoughts on this, but I'd  
like to hear what you've got to say, as I'm aware that this is  
rather ... complex.


Thanks,

Chris
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"