Re: System processes recognition.

From: Bruce Evans (bde_at_zeta.org.au)
Date: 03/18/05

  • Next message: Robert Watson: "Re: Time to stop buildling named (and friends) by default in 6-current?"
    Date: Fri, 18 Mar 2005 20:41:00 +1100 (EST)
    To: David Xu <davidxu@freebsd.org>
    
    

    On Thu, 17 Mar 2005, David Xu wrote:

    > Bruce Evans wrote:
    >>
    >> P_SYSTEM for init is bogus since it breaks at least procfs for init.
    >> procfs may need to be disabled for init for security reasons, but it
    >> shouldn't be disabled unconditionally. I mainly noticed /proc/1/map
    >> not existing.
    >>
    >> There should be flags like P_KTHREAD as needed to make the properties
    >> of init independent.
    >
    > Removing P_SYSTEM for init will cause it to be swapped out under heavy
    > memory pressure, we unlikely want to swap out init, otherwise it results
    > zoombies
    > can not be recycled immediately, does anyone know that init is already be
    > locked into memory, e.g, by PHOLD ?

    As I said, there should be flags like PKTHREAD to control this
    independently. Perhaps 2 flags to control swapouts and pageouts.
    Only the stack pages are swapped out and the stack is a small part
    of the process, so for init it is more important to prevent pageouts.

    I think PHOLD() only affects swapouts. The comment about it in proc.h
    doesn't say what it does -- the comment says that PHOLD() holds the U-area
    in memory, but now there isn't even a U-area.

    There is an explicit test for init in the pageout daemon. I think this
    prevents init being paged out, so with my removal of P_SYSTEM for init,
    init has the strange property of being swappable but not being pageable.

    The test for init has the same hard-coded assumption on init's pid that
    I fixed in kern_sig.c in my previous patch in this thread, and there is
    a worse hard-coded assumptions on pids in the same expression:

    %%%
    Index: vm_pageout.c
    ===================================================================
    RCS file: /home/ncvs/src/sys/vm/vm_pageout.c,v
    retrieving revision 1.268
    diff -u -2 -r1.268 vm_pageout.c
    --- vm_pageout.c 7 Jan 2005 02:29:27 -0000 1.268
    +++ vm_pageout.c 18 Mar 2005 09:15:09 -0000
    @@ -1193,6 +1237,7 @@
                              /*
                               * If this is a system or protected process, skip it.
    + * XXX: unfixed: all style bugs, some pid magic (48).
                               */
    - if ((p->p_flag & P_SYSTEM) || (p->p_pid == 1) ||
    + if ((p->p_flag & P_SYSTEM) || (p == initproc) ||
                                  (p->p_flag & P_PROTECTED) ||
                                  ((p->p_pid < 48) && (swap_pager_avail != 0))) {
    %%%

    Bruce
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: Robert Watson: "Re: Time to stop buildling named (and friends) by default in 6-current?"

    Relevant Pages

    • Re: Inquiry: Should we remove "isolcpus= kernel boot option? (may have realtime uses)
      ... is a much more elegant solutation for this problem than hijacking init. ... I was responding to a need you noticed to isolate memory nodes (such as ... That is, it can be desirable to have multiple mechanisms, so that the ...
      (Linux-Kernel)
    • Re: [GIT PULL] scheduler fixes
      ... Would it be possible to restructure things to move kmalloc init to ... before IRQ init as well? ... Conceptually, memory should be the first thing set up in general, in ... And we already have early exception handlers to help debugging ...
      (Linux-Kernel)
    • Re: Inspecting messages
      ... kernel, pm, fs, rs, ds, tty, memory, log and last init. ... That probably means something else is bugged, because if you broke message ...
      (comp.os.minix)
    • Re: memory report discrepancy
      ... reserved, 1399k data, 312k init) ... If the available memory detected is not what is physically installed, ... Aperture too small ... This costs you 64 MB of RAM ...
      (Fedora)
    • Re: System lockup problem with 7G of memory and PAE kernel - FC7
      ... Recently I did upgrade the OS to F 7 and tried the changing the memory ... to 7 Gig again. ... but stops at the init phase. ...
      (Fedora)