lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070819201012.GA113@tv-sign.ru>
Date:	Mon, 20 Aug 2007 00:10:12 +0400
From:	Oleg Nesterov <oleg@...sign.ru>
To:	Roland McGrath <roland@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Gautham R Shenoy <ego@...ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC,PATCH 5/5] exec: RT sub-thread can livelock and monopolize CPU on exec

On 08/19, Roland McGrath wrote:
>
> > The group_leader can sleep before it enters exit_notify(). In that case
> > wait_task_inactive() returns, and we still need some polling to wait for
> > EXIT_ZOMBIE.
> 
> It could be a loop as now with yield.  It's still polling, but only one
> poll per wakeup of the target.

I guess I misunderstand you. Do you mean

	de_thread:

		/*
		 * Wait for the thread group leader to be a zombie.
		 * It should already be zombie at this point, most
		 * of the time.
		 */
		while (leader->exit_state != EXIT_ZOMBIE)
			wait_task_inactive(leader);

? This becomes a busy-wait loop if the leader sleeps, wait_task_inactive()
doesn't sleep/yield in this case. Not good.

> > Yes sure. But in any case I think we should avoid polling, we need some
> > notification from exit_notify().
>
> Indeed.

This means we should put something in exit_notify(), like this patch does.
It could be simplified a bit, we don't in fact need a negative ->notify_count,
we can tolerate a false wakeup. We can even skip the "thread_group_leader()"
check for the same reason.

(Of course, we can also add wait_queue_head_t to ->signal, but I don't think
 you have this in mind).

Oleg.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ