All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: "Hanumanthu. H" <hanumanthu.hanok@wipro.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pid_max hang again...
Date: Sat, 07 Sep 2002 11:06:29 +0200	[thread overview]
Message-ID: <3D79C195.90004@colorfullife.com> (raw)

> As Manfred pointed out, pid allocation and inserting it into task
> list should be atomic. But going by the range of pids available
> in 2.5.33 (Linux made it 30-bits), it is unlikely that same pid
> will be given to two processes, since last_pid is protected by
> single lock. 
Right now there is quite a lot of code between get_pid and the insertion 
into the task list: copy mm, files, etc.

And just before the endless loop in get_pid(), there is only one pid 
left --> probability of getting the same pid again is high. If you fix 
the hang, you should fix the atomicity, too.

> If last_pid is within PID_MAX and max_pid_cross is set, this
> pid might have been given to another process. So, goto the
> corresponding hashlist and check for its existence. If no task
> with given pid found, then get_pid is free to return pid as the
> available pid.

Doesn't work: find_task_by_pid() only checks task->pid. But the result 
of get_pid mustn't be in use as a session or tgid value either

--
	Manfred


             reply	other threads:[~2002-09-07  9:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-07  9:06 Manfred Spraul [this message]
2002-09-09 14:22 ` [PATCH] pid_max hang again Hanumanthu. H
2002-09-09 15:07   ` Martin J. Bligh
2002-09-09 22:39     ` jw schultz
2002-09-10  9:54       ` Andries Brouwer
2002-09-10 19:29         ` jw schultz
  -- strict thread matches above, loose matches on Subject: below --
2002-09-11  8:59 Hanumanthu. H
2002-09-11 17:19 ` Andries Brouwer
2002-09-11 20:23   ` jw schultz
2002-09-12  1:11   ` Rik van Riel
2002-09-12  1:54   ` Andrew Morton
2002-09-12 20:23     ` Andries Brouwer
2002-09-12 21:17       ` Rik van Riel
2002-09-12 21:21         ` yodaiken
2002-09-13  5:47       ` Hanumanthu. H
2002-09-07  8:16 Hanumanthu. H
2002-09-06 21:06 Manfred Spraul
2002-09-06 15:39 Ingo Molnar
2002-09-06 17:43 ` [PATCH] " Paul Larson

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=3D79C195.90004@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=hanumanthu.hanok@wipro.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.