kern/60550: [PATCH] hitting process limits produces sub-optimal error messages

Lowell Gilbert freebsd-bugs-local at be-well.no-ip.com
Wed Dec 24 18:00:35 PST 2003


>Number:         60550
>Category:       kern
>Synopsis:       [PATCH] hitting process limits produces sub-optimal error messages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 24 18:00:31 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Lowell Gilbert
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
>Environment:
System: FreeBSD be-well.ilk.org 4.9-STABLE FreeBSD 4.9-STABLE #59: Sun Dec 21 16:00:19 EST 2003 root at be-well.ilk.org:/usr/src/sys/compile/BE-WELL i386


	
>Description:

Recent changes to the fork code (to control boot-time interrupt
storms) added some error messages for the cases where process limits
are hit.  These list the UID hitting the limit, but not a process ID,
which would be useful also.

>How-To-Repeat:

Set process limits low with ulimit, then run against the limit.
The console will show a message with your UID and no other info.

>Fix:

I have a proposed patch which just adds the current PID to the printf
statement.  However, I wonder whether it might be even better to
remove the printf completely for the case where process limits (as
opposed to maxproc) are being hit.  [If a task hits other process
limits, there are no comparable messages produced.]




*** kern_fork.c.ORIG    Wed Nov 12 10:40:22 2003
--- kern_fork.c Wed Dec 24 18:51:32 2003
***************
*** 239,245 ****
        uid = p1->p_cred->p_ruid;
        if ((nprocs >= maxproc - 10 && uid != 0) || nprocs >= maxproc) {
                if (ppsratecheck(&lastfail, &curfail, 1))
!                       printf("maxproc limit exceeded by uid %d, please see tuning(7) and login.conf(5).\n", uid);
                tsleep(&forksleep, PUSER, "fork", hz / 2);
                return (EAGAIN);
        }
--- 239,245 ----
        uid = p1->p_cred->p_ruid;
        if ((nprocs >= maxproc - 10 && uid != 0) || nprocs >= maxproc) {
                if (ppsratecheck(&lastfail, &curfail, 1))
!                       printf("maxproc limit exceeded by uid %d (pid %d), please see tuning(7) and login.conf(5).\n", uid, p1->p_pid);
                tsleep(&forksleep, PUSER, "fork", hz / 2);
                return (EAGAIN);
        }
***************
*** 261,267 ****
                 */
                nprocs--;
                if (ppsratecheck(&lastfail, &curfail, 1))
!                       printf("maxproc limit exceeded by uid %d, please see tuning(7) and login.conf(5).\n", uid);
                tsleep(&forksleep, PUSER, "fork", hz / 2);
                return (EAGAIN);
        }
--- 261,267 ----
                 */
                nprocs--;
                if (ppsratecheck(&lastfail, &curfail, 1))
!                       printf("maxproc limit exceeded by uid %d (pid %d), please see tuning(7) and login.conf(5).\n", uid, p1->p_pid);
                tsleep(&forksleep, PUSER, "fork", hz / 2);
                return (EAGAIN);
        }


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list