Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1244969

Re: [Linux] Linux PID algorithm is BRAINDEAD!

Path csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!nntpspool01.opticnetworks.net!aioe.org!bofh.it!news.nic.it!robomod
From Dave Goel <deego3@gmail.com>
Newsgroups linux.kernel
Subject Re: [Linux] Linux PID algorithm is BRAINDEAD!
Date Mon, 12 Oct 2015 20:00:03 +0200
Message-ID <qiPyb-6fF-35@gated-at.bofh.it> (permalink)
References <qhRLI-3BY-9@gated-at.bofh.it> <qialk-5a5-3@gated-at.bofh.it> <qisUW-71l-15@gated-at.bofh.it> <qiMTD-2Aw-15@gated-at.bofh.it>
X-Original-To "Theodore Ts'o" <tytso@mit.edu>, Dave Goel <deego3@gmail.com>, linux-kernel@vger.kernel.org
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=l9hAOeqE/mZl078gRsraeQH9MLsN0tdTkkCwQISrIgI=; b=n31DSznPndrypXPCVPd3xMB4zJxRfKRG1d5X0q5hfLnoWW8g/jArhNSV/JkemFPzIW 02nEKzRs7ZWlEG/Zlg+BBAJbGcUkcG0pl6M4GAto2cdgrKcOrH7ACIrYrWuuEzobAdfg ubap4EdruFnT7SSNWcp3d7BJ4YTtLXO4TLIWOj/wij6F4XklVJEiYKP2Axw22na2cHKc xz1X4aYtTB02ohItse4CQkv+vKrTNkOX1SE1ByIXGTKEdxGDDuPcgxFGPyYsgrgx9yBN eT5ImKjEhYkRAP06B/eQAra1NjVTSOjzjk9I4sVIOLSxzGPA7sCuv92YdMYw0EhfFWaZ 1uCQ==
MIME-Version 1.0
X-Received by 10.194.91.193 with SMTP id cg1mr37424452wjb.88.1444672199193; Mon, 12 Oct 2015 10:49:59 -0700 (PDT)
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 44
Organization linux.* mail to news gateway
X-Original-Date Mon, 12 Oct 2015 13:49:59 -0400
X-Original-Message-ID <CAOCW0DhWKeOh75BGQtMAif7WVZAs5JXw=vgu99sm3egrimTE4g@mail.gmail.com>
X-Original-References <CAOCW0DjRfb7mUC2kDck_DLHySKkkNVLoDtWoaSsbECnnoqiXPQ@mail.gmail.com> <20151010215849.GG24678@thunk.org> <CAOCW0Dgi_qbCth6jjOaDSEK_YizaihB4mjEubqTqe=FN=xtvzA@mail.gmail.com> <20151012150438.GA32396@thunk.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1244969

Show key headers only | View raw


Ted,

Thanks for your patience with me.

I thought I had this down, and I thought that the only real
problem is *immediate* re-use and the race conditions it causes
and that for all other cases, scripts can find a way to work
around things. But:

But truly, your example stumps me atm.

Completely understood your point that the "real" solution is to
properly use trap in all scripts. What that also entails in practice is
working with every debian package and program .. .  If A calls B
that calls C which then calls D, and they are all programs
written in different languages, some of which don't even allow
arguments, etc.  But, indeed, that's not the kernel's "problem."


In the meanwhile, if deep inside D, I am generating files that A
needs to be aware of (again, A through D are in different
languages, with their own broken utilities), I can always add
additional information and make it unique.  I can use random
strings to make it unique enough, or if I need deterministic, I
can add pid + start time (jiffies of the proc) + linux start
time (btime from /proc/stat) to make it unique enough.  If I
truly have a unique PID, I never have to worry about any of this,
I guess.



OTOH, I guess if one has to write cleaner/other meta scripts without
proper traps, the cleaner can simply check if linux's PID counter
is too close to the current PID, and if so, refrain from drastic
actions. For the latter, I wonder if there's a way to
get "current PID counter."

Thanks again,
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-10 04:10 +0200
  Re: [Linux] Linux PID algorithm is BRAINDEAD! yalin wang <yalin.wang2010@gmail.com> - 2015-10-10 05:30 +0200
  Re: [Linux] Linux PID algorithm is BRAINDEAD! Theodore Ts'o <tytso@mit.edu> - 2015-10-11 00:00 +0200
    Re: [Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-11 06:00 +0200
    Re: [Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-11 19:50 +0200
      Re: [Linux] Linux PID algorithm is BRAINDEAD! Theodore Ts'o <tytso@mit.edu> - 2015-10-12 17:10 +0200
        Re: [Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-12 20:00 +0200
          Re: [Linux] Linux PID algorithm is BRAINDEAD! Theodore Ts'o <tytso@mit.edu> - 2015-10-12 20:20 +0200

csiph-web