Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jul 2003 21:57:27 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        silby@FreeBSD.org
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern subr_param.c sys_pipe.c src/sys/sys   pipe.h
Message-ID:  <200307080457.h684vRM7009343@gw.catspoiler.org>
In-Reply-To: <200307080402.h6842VtT064702@repoman.freebsd.org>

index | next in thread | previous in thread | raw e-mail

On  7 Jul, Mike Silbersack wrote:
> silby       2003/07/07 21:02:31 PDT
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/kern             subr_param.c sys_pipe.c 
>     sys/sys              pipe.h 
>   Log:
>   Put some concrete limits on pipe memory consumption:
>   
>   - Limit the total number of pipes so that we do not
>     exhaust all vm objects in the kernel map.  When
>     this limit is reached, a ratelimited message will
>     be printed to the console.
>   
>   - Put a soft limit on the amount of memory consumable
>     by pipes.  Once the limit has been reached, all new
>     pipes will be limited to 4K in size, rather than the
>     default of 16K.
>   
>   - Put a limit on the number of pages that may be used
>     for high speed page flipping in order to reduce the
>     amount of wired memory.  Pipe writes that occur
>     while this limit is exceeded will fall back to
>     non-page flipping mode.
>   
>   The above values are auto-tuned in subr_param.c and
>   are scaled to take into account both the size of
>   physical memory and the size of the kernel map.
>   
>   These limits help to reduce the "kernel resources exhausted"
>   panics that could be caused by opening a large
>   number of pipes.  (Pipes alone are no longer able
>   to exhaust all resources, but other kernel memory hogs
>   in league with pipes may still be able to do so.)

There should probably be a per-user limit(s) as well.  At a minimum, the
number of pipes per user should be limited.  The limit should be stored
in struct plimit, and the current usage should be tracked in struct
uidinfo.


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307080457.h684vRM7009343>