mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Kirill Korotaev <dev@sw.ru>, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Jeff Dike <jdike@addtoit.com>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 2/3] pidhash: don't use zero pids
Date: Tue, 31 Jan 2006 08:02:12 -0700	[thread overview]
Message-ID: <m1lkww4f0r.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <43DF3BB7.B423AC08@tv-sign.ru> (Oleg Nesterov's message of "Tue, 31 Jan 2006 13:28:07 +0300")

Oleg Nesterov <oleg@tv-sign.ru> writes:

> Hello Kirill,
>
> Kirill Korotaev wrote:
>> 
>> Hello Oleg,
>> 
>> I had quite the same comment, but had no time to check it.
>> I can't understand what problem do you solve, or just making code
>> cleaner (from your point of view)?
>
> Please look at http://marc.theaimsgroup.com/?t=113851660700001
>
>> For me it was quite natural that pid=0 is used by idle, and I'm very
>> suspicuos about such changes.
>
> This patch does not change idle's pid, it is still 0. It changes ->pgrp
> and ->session only from 0 to 1. Currently kernel threads run with 0,0
> unless they call daemonize() which does set_special_pids(1, 1).


daemonize consuming pids (1,1) then consumes pgrp 1.  So that when
/sbin/init calls setsid() it thinks /sbin/init is a process group
leader and setsid() fails.  So /sbin/init wants pgrp 1 session 1
but doesn't get it.  I am pretty certain daemonize did not exist so
/sbin/init got pgrp 1 session 1 in 2.4.

That is the bug that is being fixed.

This patch takes things one step farther and essentially calls
setsid() for pid == 1 before init is execed.  That is new behavior
but it cleans up the kernel as we now do not need to support the
case of a process without a process group or a session.

The only process that could have possibly cared was /sbin/init
and it already calls setsid() because it doesn't want that.

If this was going to break anything noticeable the change in behavior
from 2.4 to 2.6 would have already done that.

Hopefully that is sufficiently comprehensible to everyone.

Eric







  reply	other threads:[~2006-01-31 15:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-30 11:06 Oleg Nesterov
2006-01-30 20:36 ` Eric W. Biederman
2006-01-31  6:12   ` Kirill Korotaev
2006-01-31 10:28     ` Oleg Nesterov
2006-01-31 15:02       ` Eric W. Biederman [this message]
2006-01-30 22:43 ` Eric W. Biederman

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=m1lkww4f0r.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@osdl.org \
    --cc=dev@sw.ru \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    /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