lkml.org 
[lkml]   [2018]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2] kernel/signal: Signal-based pre-coredump notification
    On 10/23, Enke Chen wrote:
    >
    > >> + /*
    > >> + * Send the pre-coredump signal to the parent if requested.
    > >> + */
    > >> + read_lock(&tasklist_lock);
    > >> + notify = do_notify_parent_predump(current);
    > >> + read_unlock(&tasklist_lock);
    > >> + if (notify)
    > >> + cond_resched();
    > >
    > > Hmm. I do not understand why do we need cond_resched(). And even if we need it,
    > > why we can't call it unconditionally?
    >
    > Remember the goal is to allow the parent (e.g., a process manager) to take early
    > action. The "yield" before doing coredump will help.

    I don't see how can it actually help...

    cond_resched() is nop if CONFIG_PREEMPT or should_resched() == 0.

    and the coredumping thread will certainly need to sleep/wait anyway.

    > > And once again, SIGCHLD/SIGUSR do not queue, this means that PR_SET_PREDUMP_SIG
    > > is pointless if you have 2 or more children.
    >
    > Hmm, could you point me to the code where SIGCHLD/SIGUSR is treated differently
    > w.r.t. queuing? That does not sound right to me.

    see the legacy_queue() check. Any signal < SIGRTMIN do not queue. IOW, if SIGCHLD
    is already pending, then next SIGCHLD is simply ignored.

    Oleg.

    \
     
     \ /
      Last update: 2018-10-24 15:53    [W:2.157 / U:0.336 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site