From: "Chris Friesen" <cfriesen@nortel.com>
To: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Ulrich Drepper <drepper@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH] make setpriority POSIX compliant; introduce PRIO_THREAD extension
Date: Tue, 09 Sep 2008 10:42:50 -0600 [thread overview]
Message-ID: <48C6A78A.8090401@nortel.com> (raw)
In-Reply-To: <517f3f820809090845o5dc772f8r2308a6c010f69561@mail.gmail.com>
Michael Kerrisk wrote:
> On 9/1/08, Denys Vlasenko <dvlasenk@redhat.com> wrote:
>> Since there may be programs which use the fact that
>>
>> setpriority(PRIO_PROCESS, tid, value)
>>
>> prior to this patch was setting priority for selected thread,
>> this behavior is retained in case when tid != pid.
>>
>> IOW: with PRIO_PROCESS, if pid specifies a thread group leader,
>> all threads' prios are set. Otherwise, only selected thread's priority
>> is set. (Alternative can be to just fail with ESRCH).
> I would expect
> setpriority(PRIO_PROCESS, getpid())
> and
> setpriority(PRIO_PROCESS, 0)
> to have the same affect (because: which == PRIO_PRCESS, who == 0
> conventionally means "the calling process").
>
> But they do not: the latter call only changes the priority of the
> calling thread. Is this intended?
The patch interprets 0 as the current pid rather than the current tgid.
It's up for discussion whether we should preserve old behaviour when
specifying 0, or use a new and arguably more logical behaviour but
possibly break old apps.
Chris
next prev parent reply other threads:[~2008-09-09 16:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-01 14:12 [PATCH] make setpriority POSIX compliant; introduce PRIO_THREAD extension Denys Vlasenko
2008-09-01 14:17 ` Denys Vlasenko
2008-09-01 14:42 ` Denys Vlasenko
2008-09-01 15:08 ` Peter Zijlstra
2008-09-01 15:19 ` Peter Zijlstra
2008-09-01 15:20 ` Denys Vlasenko
2008-09-01 17:58 ` Ulrich Drepper
2008-09-09 15:45 ` Michael Kerrisk
2008-09-09 16:42 ` Chris Friesen [this message]
2008-09-09 18:45 ` Michael Kerrisk
2008-09-10 9:28 ` Denys Vlasenko
2008-09-10 11:57 ` Michael Kerrisk
2008-09-10 12:08 ` Christoph Hellwig
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=48C6A78A.8090401@nortel.com \
--to=cfriesen@nortel.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=drepper@redhat.com \
--cc=dvlasenk@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mtk.manpages@gmail.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