mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Cyrill Gorcunov <gorcunov@openvz.org>,
	John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	Michal Hocko <mhocko@suse.com>,
	Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>,
	Mateusz Guzik <mguzik@redhat.com>,
	linux-kernel@vger.kernel.org,
	Pavel Emelyanov <xemul@virtuozzo.com>,
	Konstantin Khorenko <khorenko@virtuozzo.com>,
	Lennart Poettering <lennart@poettering.net>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kay Sievers <kay.sievers@vrfy.org>
Subject: Re: [PATCH v2 2/2] prctl: propagate has_child_subreaper flag to every descendant
Date: Mon, 30 Jan 2017 15:01:15 +0100	[thread overview]
Message-ID: <20170130140114.GB24718@redhat.com> (raw)
In-Reply-To: <0eb16bca-eb0d-edd1-de6a-524f155b492b@virtuozzo.com>

On 01/30, Pavel Tikhomirov wrote:
>
> On 01/30/2017 03:51 PM, Oleg Nesterov wrote:
> >>+			/*
> >>+			 * Inherit has_child_subreaper flag under the same
> >>+			 * tasklist_lock with adding child to the process tree
> >>+			 * for propagate_has_child_subreaper optimization.
> >>+			 */
> >>+			p->signal->has_child_subreaper = current->signal->has_child_subreaper ||
> >>+							 current->signal->is_child_subreaper;
> >
> >Ah yes, we need this change too...
> >
> >And perhaps it would be more correct to do
> >
> >			p->signal->has_child_subreaper =
> >				p->real_parent->signal->has_child_subreaper ||
> >				p->real_parent->signal->is_child_subreaper;
> >
> >the current code is not exactly right if CLONE_PARENT...
>
> I'm fine with inheriting 'has' flag from real_parent, because if real_parent
> does not have 'has' flag set but parent has 'has' set, we inherited the flag
> in vain.
>
> But I don't actually think that inheritance from parent not real_parent
> breaks my optimization: if real_parent has the flag, so does the parent.

Not sure I understand... I meant, the usage of p->real_parent instead of "current"
_looks_ more correct and clear, imo.

Say, a is_child_subreaper task does clone(CLONE_PARENT), in this case (with or
without your change) we set p->signal->has_child_subreaper = 1 and this is not
really correct even if we do not really care.

Oleg.

  reply	other threads:[~2017-01-30 14:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27 10:05 [PATCH v2 0/2] prctl: make PR_SET_CHILD_SUBREAPER deterministic Pavel Tikhomirov
2017-01-27 10:05 ` [PATCH 1/2] introduce the walk_process_tree() helper Pavel Tikhomirov
2017-01-27 10:05 ` [PATCH v2 2/2] prctl: propagate has_child_subreaper flag to every descendant Pavel Tikhomirov
2017-01-30 12:51   ` Oleg Nesterov
2017-01-30 13:15     ` Pavel Tikhomirov
2017-01-30 14:01       ` Oleg Nesterov [this message]
2017-01-27 10:11 ` [PATCH] prctl.2: Document new PR_SET_CHILD_SUBREAPER semantics Pavel Tikhomirov
2017-01-27 22:47   ` Michael Kerrisk (man-pages)
2017-01-28  6:38     ` Pavel Tikhomirov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170130140114.GB24718@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=gorcunov@openvz.org \
    --cc=john.stultz@linaro.org \
    --cc=kay.sievers@vrfy.org \
    --cc=khorenko@virtuozzo.com \
    --cc=lennart@poettering.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mguzik@redhat.com \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=nicolas.pitre@linaro.org \
    --cc=peterz@infradead.org \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=skinsbursky@virtuozzo.com \
    --cc=tglx@linutronix.de \
    --cc=xemul@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome