From: Paulo Marques <pmarques@grupopie.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>, Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] fix TASK_STOPPED vs TASK_NONINTERACTIVE interaction
Date: Thu, 29 Sep 2005 17:25:41 +0100 [thread overview]
Message-ID: <433C1585.6080800@grupopie.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0509290901060.3308@g5.osdl.org>
Linus Torvalds wrote:
>
> On Thu, 29 Sep 2005, Oleg Nesterov wrote:
>
>>[...]
>>However, TASK_NONINTERACTIVE > TASK_STOPPED, so this loop will not
>>count TASK_INTERRUPTIBLE | TASK_NONINTERACTIVE threads.
>
> [...]
> Using ">" for task states is wrong. It's a bitmask, and if you want to
> check multiple states, then we should just do so with
>
> if (t->state & (TASK_xxx | TASK_yyy | ...))
>
> Oh, well. The inequality comparisons are shorter, and historical, so I
> guess it's debatable whether we should remove them all.
I did a quick grep through 2.6.14-rc2 to see how many "them all" were,
and the only two places I could find, where a inequality operator was
being used on a task state, were this one in kernel/signal.c and another
in kernel/exit.c:
./kernel/exit.c:1194: unlikely(p->state > TASK_STOPPED)
So maybe it is not so bad to just change these to a bit mask and
disallow inequality comparisons in the future, if you guys feel that is
the way to go...
--
Paulo Marques - www.grupopie.com
The rule is perfect: in all matters of opinion our
adversaries are insane.
Mark Twain
next prev parent reply other threads:[~2005-09-29 16:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-29 15:58 [PATCH] fix TASK_STOPPED vs TASK_NONINTERACTIVE interaction Oleg Nesterov
2005-09-29 16:02 ` Linus Torvalds
2005-09-29 16:25 ` Paulo Marques [this message]
2005-10-03 2:54 ` Coywolf Qi Hunt
2005-10-03 3:24 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2005-09-29 21:54 Roland McGrath
2005-09-29 22:15 ` Linus Torvalds
2005-09-30 16:51 ` Oleg Nesterov
2005-09-30 17:18 ` Linus Torvalds
2005-10-01 11:32 ` Oleg Nesterov
2005-10-02 1:12 ` Roland McGrath
2005-10-03 23:49 linux
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=433C1585.6080800@grupopie.com \
--to=pmarques@grupopie.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
--cc=torvalds@osdl.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.