public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@linux.intel.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"lkml, " <linux-kernel@vger.kernel.org>
Subject: futex requeue_pi breakage
Date: Mon, 08 Nov 2010 14:58:06 -0800	[thread overview]
Message-ID: <4CD8807E.90306@linux.intel.com> (raw)

Steven,

As we've discussed, the following changes break the futex_requeue_pi 
testcase I use to validate the futex_requeue_pi feature introduced in 
2.6.32(ish).

	commit 43fa5460fe60dea5c610490a1d263415419c60f6
	    sched: Try not to migrate higher priority RT tasks

	commit b3bc211cfe7d5fe94b310480d78e00bea96fbf2a
	    sched: Give CPU bound RT tasks preference

The source to this test is here:

http://git.kernel.org/?p=linux/kernel/git/dvhart/futextest.git;a=summary
branch: futex-lock
file: futextest/functional/futex_requeue_pi.c

The futex_requeue_pi test main loop runs as sched_other while all the 
child threads are spawned as sched_fifo 1. This scenario results in the 
parent thread spinning in futex_wait_queue_me (most likely on the hash 
bucket spinlock) while attempting a pthread_join() on the rt child 
threads. However, if I run with chrt, forcing the parent thread to fifo 
1, it completes reliably:

$ sudo chrt -f 1 ./futex_requeue_pi
futex_requeue_pi: Test requeue functionality
         Arguments: broadcast=0 locked=0 owner=0 timeout=0ns
Result:  PASS

Whereas as sched_other:
$ sudo ./futex_requeue_pi
futex_requeue_pi: Test requeue functionality
         Arguments: broadcast=0 locked=0 owner=0 timeout=0ns
<hang>

$ ps -eLo tid,rtprio,wchan:20,comm | grep futex
  1987      - futex_wait_queue_me  auditd
  1988      - futex_wait_queue_me  audispd
  5533      - futex_wait_queue_me  rsyslogd
  5547      - futex_wait_queue_me  futex_requeue_p
  5549      1 futex_wait_queue_me  futex_requeue_p
  5550      1 futex_wait_queue_me  futex_requeue_p
  5551      1 futex_wait_queue_me  futex_requeue_p
  5552      1 futex_wait_queue_me  futex_requeue_p
  5553      1 futex_wait_queue_me  futex_requeue_p
  5554      1 futex_wait_queue_me  futex_requeue_p
  5555      1 futex_wait_queue_me  futex_requeue_p
  5556      1 futex_wait_queue_me  futex_requeue_p
  5557      1 futex_wait_queue_me  futex_requeue_p
  5558      1 ?                    futex_requeue_p
  5559      1 ?                    futex_requeue_p

I'm still thinking through how your changes would impact this, and if 
there could be some assumption in the futex code that fails with those 
changes. I wanted to get the information out there in case it triggers 
any insight from you.

This suggests that somehow an rt task blocked while holding a spinlock 
(without issuing a warning to the console) or that somehow a SCHED_OTHER 
task preempted an RT task which is not getting scheduled on another CPU. 
Neither of these seem likely.

Thanks,

-- 
Darren Hart
Embedded Linux Kernel

                 reply	other threads:[~2010-11-08 22:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4CD8807E.90306@linux.intel.com \
    --to=dvhart@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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