mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Coywolf Qi Hunt <coywolf@gmail.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: Mon, 3 Oct 2005 10:54:28 +0800	[thread overview]
Message-ID: <2cd57c900510021954l20488718n20b06f2cbc6c567d@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0509290901060.3308@g5.osdl.org>

On 9/30/05, Linus Torvalds <torvalds@osdl.org> wrote:
>
>
> On Thu, 29 Sep 2005, Oleg Nesterov wrote:
> >
> > do_signal_stop:
> >
> >       for_each_thread(t) {
> >               if (t->state < TASK_STOPPED)
> >                       ++sig->group_stop_count;
> >       }
> >
> > However, TASK_NONINTERACTIVE > TASK_STOPPED, so this loop will not
> > count TASK_INTERRUPTIBLE | TASK_NONINTERACTIVE threads.
>
> Ok, I think your patch is correct (we really do try to keep an order to
> those task flags), but the _real_ issue is that the comparisons are bogus.
>
> 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

The inequality comparisons are faster or faster on some CPU.
We should use it if we can keep the order IMHO.

> guess it's debatable whether we should remove them all.
>
>                 Linus

--
Coywolf Qi Hunt
http://sosdg.org/~coywolf/

  parent reply	other threads:[~2005-10-03  2:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-29 15:58 Oleg Nesterov
2005-09-29 16:02 ` Linus Torvalds
2005-09-29 16:25   ` Paulo Marques
2005-10-03  2:54   ` Coywolf Qi Hunt [this message]
2005-10-03  3:24     ` Linus Torvalds
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=2cd57c900510021954l20488718n20b06f2cbc6c567d@mail.gmail.com \
    --to=coywolf@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®