Attachment 'gpusync_rtss13_litmus.patch'

Download

   1 From 04f79cb08aad1373e16b7d5442f14d7276e27ec9 Mon Sep 17 00:00:00 2001
   2 From: Glenn Elliott <gelliott@cs.unc.edu>
   3 Date: Sun, 19 May 2013 23:21:29 -0400
   4 Subject: [PATCH] squash commit of GPUSync on Linux 3.0
   5 
   6 Squashed commit of the following:
   7 
   8 commit 44326648c2ea81b9a32619644fe9c665ed0d9e0b
   9 Author: Glenn Elliott <gelliott@cs.unc.edu>
  10 Date:   Mon May 14 16:51:05 2012 -0400
  11 
  12     Final GPUSync implementation.
  13 
  14 commit af6eeb156c7da47ff5df03a3da04432c8ac4460c
  15 Author: Glenn Elliott <gelliott@cs.unc.edu>
  16 Date:   Fri Apr 27 19:52:34 2012 -0400
  17 
  18     fix minor bugs. there is still a bug in GEDF PAI.
  19 
  20 commit 52056e94a94517e250f7f4e36e7470a4b002404e
  21 Author: Glenn Elliott <gelliott@cs.unc.edu>
  22 Date:   Thu Apr 26 15:20:22 2012 -0400
  23 
  24     No-op useless unlock calls.
  25 
  26 commit 040301747953ae9a2017def70e6004affe1e9aeb
  27 Author: Glenn Elliott <gelliott@cs.unc.edu>
  28 Date:   Wed Apr 25 19:30:48 2012 -0400
  29 
  30     Fix/test C-EDF for GPU RTSS12.
  31 
  32 commit 58f04ff13ac7128609ee468eb317c71817474a84
  33 Author: Glenn Elliott <gelliott@cs.unc.edu>
  34 Date:   Wed Apr 25 17:31:08 2012 -0400
  35 
  36     Port rtss12 features to C-EDF (untested)
  37 
  38 commit 4aabc4a7f68aae11c79b39fa65a9c54d3f3451e7
  39 Author: Glenn Elliott <gelliott@cs.unc.edu>
  40 Date:   Mon Apr 23 19:22:58 2012 -0400
  41 
  42     Match replica before spinlocks in ikglp_unlock()
  43 
  44 commit 3025aea8d0ed6ee4ab68281e5cbcc76ec4dab1e2
  45 Author: Glenn Elliott <gelliott@cs.unc.edu>
  46 Date:   Mon Apr 23 19:18:19 2012 -0400
  47 
  48     Fix line-endings. :P
  49 
  50 commit 6f436b63bc551bbd9f9ddcf4d8a960d7d847948e
  51 Author: Glenn Elliott <gelliott@cs.unc.edu>
  52 Date:   Mon Apr 23 19:11:32 2012 -0400
  53 
  54     Tested/Fixed IKGLP heurs. OS WORK FINALLY DONE!
  55 
  56 commit fa43d7a6bb9b0e748f23529424ac5eebd849d9d7
  57 Author: Glenn Elliott <gelliott@cs.unc.edu>
  58 Date:   Mon Apr 23 12:12:58 2012 -0400
  59 
  60     Donees cannot be amongst the top-m requests.
  61 
  62 commit 372db158e2a5c7e2b455262c0959eb13da4433b9
  63 Author: Glenn Elliott <gelliott@cs.unc.edu>
  64 Date:   Fri Apr 20 22:48:32 2012 -0400
  65 
  66     Donor dequeue heuristic for IKGLP.  Untested.
  67 
  68 commit 273e902c50ef94966815a92c2af5ab8c5b2d77ce
  69 Author: Glenn Elliott <gelliott@cs.unc.edu>
  70 Date:   Fri Apr 20 21:20:21 2012 -0400
  71 
  72     Untested donee selection heuristic for IKGLP.
  73 
  74 commit c6d04216a123f8e0b50eb78bbb1eaf646a1ca4e0
  75 Author: Glenn Elliott <gelliott@cs.unc.edu>
  76 Date:   Wed Apr 18 23:18:32 2012 -0400
  77 
  78     Added hooks for IKGLP affinity and a little logic.
  79 
  80     simple IKGLP is already done.  it does:
  81     1) auto gpu de/registration.
  82     2) distruption amongst simultanous users across queues
  83     3) calls default IKGLP routines when appropriate.
  84 
  85     Remaining work:
  86     1) FQ advisement.
  87     2) Donor stealing advisement.
  88     3) Donee selection advisement.
  89 
  90 commit 149ef3b424a49e6b928c5e23fea83380ed95ea38
  91 Author: Glenn Elliott <gelliott@cs.unc.edu>
  92 Date:   Wed Apr 18 21:33:21 2012 -0400
  93 
  94     Zap line-endings
  95 
  96 commit f916cdb8e6a9ee2c917fddb7351e6bb39f6c953e
  97 Author: Glenn Elliott <gelliott@cs.unc.edu>
  98 Date:   Wed Apr 18 21:30:36 2012 -0400
  99 
 100     Added support for simult-users in kfmlp
 101 
 102 commit 6ab36ca992441f7353840c70fc91d99a500a940e
 103 Author: Glenn Elliott <gelliott@cs.unc.edu>
 104 Date:   Wed Apr 18 16:24:56 2012 -0400
 105 
 106     Fixed and tested aff-aware KFMLP. (finally!)
 107 
 108 commit 440aa2083245b81583980e3f4177f3b4cc805556
 109 Author: Glenn Elliott <gelliott@cs.unc.edu>
 110 Date:   Mon Apr 16 20:18:07 2012 -0400
 111 
 112     make gpu registration a little more robust
 113 
 114 commit 8675824ed85d6e83a24e77dabaf3a5c02c91ef6f
 115 Author: Glenn Elliott <gelliott@cs.unc.edu>
 116 Date:   Mon Apr 16 20:09:15 2012 -0400
 117 
 118     Implement GPU-affinity-aware kfmlp (untested)
 119 
 120 commit 0b865246946a97dc03a81ccf55bf84acce923c4b
 121 Author: Glenn Elliott <gelliott@cs.unc.edu>
 122 Date:   Sun Apr 15 19:29:09 2012 -0400
 123 
 124     Infrastructure for affinity-aware k-exclusion
 125 
 126 commit bb4922c968aa1a30fddd6ad9d0f750706c7b3b29
 127 Author: Glenn Elliott <gelliott@cs.unc.edu>
 128 Date:   Sun Apr 15 18:09:59 2012 -0400
 129 
 130     PAI::change_prio(): check work before locking
 131 
 132 commit f4aef3b7d845324eb79a226d87f232dcd8867f3b
 133 Author: Glenn Elliott <gelliott@cs.unc.edu>
 134 Date:   Sun Apr 15 18:06:04 2012 -0400
 135 
 136     Update PAI to support multiGPUs (todo: klitirqd)
 137 
 138 commit 786d383a58108ad3437a38d0e2583859cb94a4ee
 139 Author: Glenn Elliott <gelliott@cs.unc.edu>
 140 Date:   Sun Apr 15 15:05:02 2012 -0400
 141 
 142     remove fifo/rm header files left over
 143 
 144 commit 3f53a88be223f484db011f0f42e843aa57be8fca
 145 Author: Glenn Elliott <gelliott@cs.unc.edu>
 146 Date:   Sun Apr 15 15:04:15 2012 -0400
 147 
 148     add kfmlp as separate file
 149 
 150 commit b3ae67412531cbc583d5697d2366fc58d6dd07e7
 151 Merge: c0667dc adeff95
 152 Author: Glenn Elliott <gelliott@cs.unc.edu>
 153 Date:   Sun Apr 15 15:03:33 2012 -0400
 154 
 155     Merge branch 'wip-gpu-interrupts' into wip-gpu-rtss12
 156 
 157     Conflicts:
 158     	include/litmus/fdso.h
 159     	include/litmus/rt_param.h
 160     	include/litmus/sched_plugin.h
 161     	include/litmus/unistd_32.h
 162     	include/litmus/unistd_64.h
 163     	litmus/Makefile
 164     	litmus/edf_common.c
 165     	litmus/litmus.c
 166     	litmus/locking.c
 167     	litmus/sched_gsn_edf.c
 168     	litmus/sched_plugin.c
 169 
 170 commit c0667dc4894e913048cf8904f0ce9a79b481b556
 171 Author: Glenn Elliott <gelliott@cs.unc.edu>
 172 Date:   Fri Apr 13 16:18:03 2012 -0400
 173 
 174     Move RSM and IKGLP imp. to own .c files
 175 
 176     Also reformated code to be slightly more
 177     standard coding practice compliant.
 178 
 179 commit 8eb55f8fa1a2c3854f0f77b9b8663178c0129f6c
 180 Author: Glenn Elliott <gelliott@cs.unc.edu>
 181 Date:   Wed Apr 11 15:57:59 2012 -0400
 182 
 183     Added support for Dynamic Group Locks (DGLs)
 184 
 185     Added support for Dynamic Group Locks.  Locks
 186     are FIFO ordered (no timestamps), so a big DGL
 187     lock is needed to enqueue for resources atomically.
 188 
 189     Unfortunatly, this requires nested inheritance to use
 190     coarse-grain locking.  Coarse-grain locking is used
 191     when DGLs are enabled.  Fine-grain locking is used
 192     when DGLs are disabled.
 193 
 194     TODO: Clean up IKGLP implementatio.  There is
 195     a lot of needless debug/TRACE work.
 196 
 197 commit 0c80d0acbbc2103a744f2b2b76cb66ddeb28ebbf
 198 Author: Glenn Elliott <gelliott@cs.unc.edu>
 199 Date:   Mon Apr 9 00:18:24 2012 -0400
 200 
 201     Fix IKGLP bugs discovered in test.
 202 
 203     Apply fixes to the IKGLP.  Also, break binheap.h
 204     into binheap.h/.c
 205 
 206 commit f5c9f29c1d17131870ec113cc357b40d2f087bc2
 207 Author: Glenn Elliott <gelliott@cs.unc.edu>
 208 Date:   Wed Apr 4 23:11:47 2012 -0400
 209 
 210     Cleanup use of binheap_entry().
 211 
 212     The entry is already casted by the macro.
 213 
 214 commit 0ccecdaf12334b2241ee5185b04eda4f91f95fe2
 215 Author: Glenn Elliott <gelliott@cs.unc.edu>
 216 Date:   Wed Apr 4 23:05:47 2012 -0400
 217 
 218     Untested implementation of IKGLP.
 219 
 220     I don't like coding so much w/o testing, but it's
 221     sort of hard to do without both lock() and unlock().
 222 
 223 commit d2f4875d7a183cc3c95c27c193af2c0cd1d1c555
 224 Author: Glenn Elliott <gelliott@cs.unc.edu>
 225 Date:   Sat Mar 31 19:56:20 2012 -0400
 226 
 227     Infrastructure of IKGLP. lock/unlock are stubs
 228 
 229 commit 62f2907f445b08f958acf1cc1a0c29736d4ba206
 230 Author: Glenn Elliott <gelliott@cs.unc.edu>
 231 Date:   Fri Mar 30 16:43:52 2012 -0400
 232 
 233     Nested inheritance with fine-grained locking.
 234 
 235     Minor hack to lockdep was required too allow
 236     the inheritance propagation locking logic to
 237     work.
 238 
 239 commit d0961e328a2a4c026c884c768b798cb882922708
 240 Merge: fb0c271 4be8ef6
 241 Author: Glenn Elliott <gelliott@cs.unc.edu>
 242 Date:   Fri Mar 23 11:16:13 2012 -0400
 243 
 244     Merge branch 'wip-binary-heap' into wip-nested-locks
 245 
 246 commit fb0c271c1e8a4d4eac440d3e47d35f19235e07ac
 247 Author: Glenn Elliott <gelliott@cs.unc.edu>
 248 Date:   Fri Mar 23 11:16:09 2012 -0400
 249 
 250     blah
 251 
 252 commit 8973214f010cf55fbf18cb88471d6c99ed6ff575
 253 Author: Glenn Elliott <gelliott@cs.unc.edu>
 254 Date:   Thu Mar 22 14:45:39 2012 -0400
 255 
 256     Introduction of basic nesting foundations.
 257 
 258 commit 4be8ef609123d4b4d281976f6bf5e65024e66b0b
 259 Author: Glenn Elliott <gelliott@cs.unc.edu>
 260 Date:   Wed Mar 21 19:25:02 2012 -0400
 261 
 262     Make C-EDF work with simplified binheap_delete
 263 
 264 commit bf57086c9aa497c016efc208a0ceb66f262ab18b
 265 Author: Glenn Elliott <gelliott@cs.unc.edu>
 266 Date:   Wed Mar 21 19:24:13 2012 -0400
 267 
 268     Make GSN-EDF work with simlified binheap_delete()
 269 
 270 commit 33f5fe82661086d27467821aaf418364774e360a
 271 Author: Glenn Elliott <gelliott@cs.unc.edu>
 272 Date:   Wed Mar 21 19:21:46 2012 -0400
 273 
 274     Simplify binheap_delete and add binheap_decrease
 275 
 276 commit ee525fe7ba4edf4da2d293629ffdff2caa9ad02b
 277 Author: Glenn Elliott <gelliott@cs.unc.edu>
 278 Date:   Wed Mar 21 16:39:26 2012 -0400
 279 
 280     C-EDF: Use binary heap instead of binomial heap.
 281 
 282     Use binary heap for ordering priority of CPUs.
 283 
 284 commit bdce67bc2babc2e5b3b2440964e9cf819ac814dc
 285 Author: Glenn Elliott <gelliott@cs.unc.edu>
 286 Date:   Wed Mar 21 16:26:27 2012 -0400
 287 
 288     GSN-EDF: Use binary heap instead of binomial heap.
 289 
 290     Use binary heap to track CPU priorities.
 291 
 292 commit 5b73afc4eb1b0303cb92eb29a2ecc59c1db69537
 293 Author: Glenn Elliott <gelliott@cs.unc.edu>
 294 Date:   Wed Mar 21 14:59:52 2012 -0400
 295 
 296     Binary heap implementation
 297 
 298     Motivation: Linux's prio_heap.h is of fixed size. Litmus's binomial
 299     heap may be overkill (and perhaps not general enough) for some applications.
 300 
 301     Implemented in the style of linked lists.
 302 
 303 commit adeff95dcdcf88789e983f20b0657f29286de8d7
 304 Author: Glenn Elliott <gelliott@cs.unc.edu>
 305 Date:   Mon Mar 5 14:59:07 2012 -0500
 306 
 307     Remove option for threading of all softirqs.
 308 
 309 commit 3e41d4826b0aa175c3f194548fa6ab20cd1cc32d
 310 Author: Glenn Elliott <gelliott@cs.unc.edu>
 311 Date:   Sun Mar 4 21:20:45 2012 -0500
 312 
 313     Clean up PAI.
 314 
 315 commit 12d312072e3f4caa6e4e500d5a23c85402494cd1
 316 Merge: 6a00f20 3d1c6d4
 317 Author: Glenn Elliott <gelliott@cs.unc.edu>
 318 Date:   Sun Mar 4 20:52:29 2012 -0500
 319 
 320     Merge branch 'wip-pai' into wip-gpu-interrupts
 321 
 322     Conflicts:
 323     	include/litmus/affinity.h
 324     	kernel/sched.c
 325     	kernel/softirq.c
 326     	litmus/Kconfig
 327     	litmus/affinity.c
 328     	litmus/litmus.c
 329     	litmus/preempt.c
 330     	litmus/sched_cedf.c
 331     	litmus/sched_gsn_edf.c
 332 
 333 commit 3d1c6d44d3f133909d1c594351c2b7c779b1d7d4
 334 Author: Glenn Elliott <gelliott@cs.unc.edu>
 335 Date:   Sun Mar 4 16:09:04 2012 -0500
 336 
 337     Some cleanup of PAI
 338 
 339 commit 6a00f206debf8a5c8899055726ad127dbeeed098
 340 Author: Jonathan Herman <hermanjl@cs.unc.edu>
 341 Date:   Thu Feb 16 19:13:16 2012 -0500
 342 
 343     Typo in macro
 344 
 345 commit 83b11ea1c6ad113519c488853cf06e626c95a64d
 346 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 347 Date:   Tue Jan 24 09:36:12 2012 +0100
 348 
 349     Feather-Trace: keep track of interrupt-related interference.
 350 
 351     Increment a processor-local counter whenever an interrupt is handled.
 352     This allows Feather-Trace to include a (truncated) counter and a flag
 353     to report interference from interrupts. This could be used to filter
 354     samples that were disturbed by interrupts.
 355 
 356 commit f5264e2cb8213dad425cb2d2db564edbc443a51a
 357 Author: Glenn Elliott <gelliott@cs.unc.edu>
 358 Date:   Fri Jan 20 11:09:15 2012 -0500
 359 
 360     Fix bugs in tracing and PAI handling
 361 
 362 commit 1a582a2c5e361e01a4c64f185bb1a23c3f70701a
 363 Author: Glenn Elliott <gelliott@cs.unc.edu>
 364 Date:   Sat Jan 14 16:56:47 2012 -0500
 365 
 366     Port PAI interrupts to GSN-EDF, C-RM/RM-SRT/FIFO.
 367 
 368 commit 53a6dbb9f5337e77fce9c2672488c1c5e0621beb
 369 Author: Glenn Elliott <gelliott@cs.unc.edu>
 370 Date:   Sat Jan 14 14:20:07 2012 -0500
 371 
 372     Completed PAI for C-EDF.
 373 
 374 commit 5d7dcfa10ea0dd283773a301e3ce610a7797d582
 375 Author: Glenn Elliott <gelliott@cs.unc.edu>
 376 Date:   Wed Jan 11 14:37:13 2012 -0500
 377 
 378     PAI implementation, C-RM, C-FIFO.
 379 
 380 commit 5bd89a34d89f252619d83fef3c9325e24311389e
 381 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 382 Date:   Thu Jul 28 01:15:58 2011 -0400
 383 
 384     Litmus core: simplify np-section protocol
 385 
 386     User a 32-bit word for all non-preemptive section flags.
 387     Set the "please yield soon" flag atomically when
 388     accessing it on remotely-scheduled tasks.
 389 
 390 commit 81b8eb2ae452c241df9b3a1fb2116fa4d5adcb75
 391 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 392 Date:   Tue Jul 26 22:03:18 2011 -0400
 393 
 394     C-EDF: rename lock -> cluster_lock
 395 
 396     The macro lock conflicts with locking protocols...
 397 
 398 commit 71083a7604e93e44536edde032706348f3a752ca
 399 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 400 Date:   Mon Jul 25 15:31:55 2011 -0400
 401 
 402     locking: use correct timestamp
 403 
 404 commit e079932a0a1aab6adbc42fedefc6caa2d9a8af2b
 405 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 406 Date:   Sat Jul 23 23:40:10 2011 -0400
 407 
 408     Feather-trace: let userspace add overhead events
 409 
 410     This is useful for measuring locking-related overheads
 411     that are partially recorded in userspace.
 412 
 413 commit 12982f31a233250c7a62b17fb4bd13594cb78777
 414 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 415 Date:   Sat Jul 23 23:38:57 2011 -0400
 416 
 417     ftdev: let bufffer-specific code handle writes from userspace
 418 
 419     This allows us to splice in information into logs from events
 420     that were recorded in userspace.
 421 
 422 commit 49e5b0c0d7c09bef5b9bfecaaac3f0ea2cf24e43
 423 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 424 Date:   Sat Jul 23 23:06:20 2011 -0400
 425 
 426     ftdev: remove event activation hack
 427 
 428     Instead of doing the hackisch 'write commands to device' thing,
 429     let's  just use a real ioctl() interface.
 430 
 431 commit 1dead199b4ae68ab98eacec4a661fd5ecb5a2704
 432 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 433 Date:   Sat Feb 5 23:15:09 2011 -0500
 434 
 435     Feather-Trace: keep track of release latency
 436 
 437 commit 4490f9ecf94e28458069a02e8cfcf4f385390499
 438 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 439 Date:   Sat Feb 5 22:57:57 2011 -0500
 440 
 441     Feather-Trace: trace locking-related suspensions
 442 
 443 commit b739b4033c0f55f9194be2793db9e6ace06047db
 444 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 445 Date:   Sat Feb 5 20:11:30 2011 -0500
 446 
 447     Feather-Trace: start with the largest permissible range
 448 
 449     MAX_ORDER is 11, but this is about number of records, not number of pages.
 450 
 451 commit fd6d753fc4e01f91427176ebfcced2c3d3f36c32
 452 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 453 Date:   Tue Feb 8 17:33:44 2011 -0500
 454 
 455     bugfix: add processors in order of increasing indices to clusters
 456 
 457     Pfair expects to look at processors in order of increasing index.
 458     Without this patch, Pfair could deadlock in certain situations.
 459 
 460 commit 2fec12d43b366b7257c602af784b172466d8d4c5
 461 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 462 Date:   Thu Nov 24 13:59:33 2011 -0500
 463 
 464     Pfair: improve robustness of suspensions
 465 
 466     This patch fixes two crash or hang bugs related to suspensions
 467     in Pfair.
 468 
 469     1) When a job was not present at the end of its last subtask, then
 470        its linked_on field was not cleared. This confused the scheduler
 471        when it later resumed. Fix: clear the field.
 472 
 473     2) Just testing for linked_on == NO_CPU is insufficient in the wake_up path
 474        to determine whether a task should be added to the ready queue. If
 475        the task remained linked and then was "preempted" at a later
 476        quantum boundary, then it already is in the ready queue and nothing
 477        is required. Fix: encode need to requeue in task_rt(t)->flags.
 478 
 479 commit d1d6e4c300d858c47b834be145f30973bc2921bf
 480 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 481 Date:   Thu Nov 24 13:42:59 2011 -0500
 482 
 483     Add option to turn off preemption state tracing
 484 
 485     Preemption state tracing is only useful when debugging preemption-
 486     and IPI-related races. Since it creates a lot of clutter in the logs,
 487     this patch turns it off unless explicitly requested.
 488 
 489 commit a7a7f71529d9a6aae02ab3cb64451e036ce9d028
 490 Author: Glenn Elliott <gelliott@cs.unc.edu>
 491 Date:   Wed Nov 2 11:33:44 2011 -0400
 492 
 493     Add unlikely() to rel master check (match pfair).
 494 
 495 commit 89174d049ea77b127fb3f8b3bbd8bc2996d0a535
 496 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 497 Date:   Sat Feb 12 16:40:43 2011 -0500
 498 
 499     bugfix: release master CPU must signal task was picked
 500 
 501 commit ec77ede8baa013138fe03ff45dd57f7bac50e5d4
 502 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 503 Date:   Tue Feb 8 12:41:10 2011 -0500
 504 
 505     Pfair: various fixes concerning release timers
 506 
 507 commit 0720416e5b1bcb825619ba4b212d9056017ffd62
 508 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 509 Date:   Sat Feb 5 21:50:36 2011 -0500
 510 
 511     Pfair: add support for true sporadic releases
 512 
 513     This patch also converts Pfair to implement early releasing such that
 514     no timer wheel is required anymore. This removes the need for a
 515     maximum period restriction.
 516 
 517 commit 399455c0e529bb07760f17e8fe0fddc342b67bc2
 518 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 519 Date:   Sat Feb 5 22:49:52 2011 -0500
 520 
 521     Pfair: add release master support.
 522 
 523     Merged in release master support for Pfair.  Some merge
 524     conflicts had to be resolved.
 525 
 526 commit b4c52e27caa701a16e120b43a0e70ca6529a58a4
 527 Author: Glenn Elliott <gelliott@cs.unc.edu>
 528 Date:   Wed Jun 22 01:30:25 2011 -0400
 529 
 530     C-EDF: Make migration affinity work with Release Master
 531 
 532     Needed to update C-EDF to handle release master.  Also
 533     updated get_nearest_available_cpu() to take NO_CPU instead
 534     of -1 to indicate that there is no release master.  While
 535     NO_CPU is 0xffffffff (-1 in two's complement), we still
 536     translate this value to -1 in case NO_CPU changes.
 537 
 538     Signed-off-by: Andrea Bastoni <bastoni@cs.unc.edu>
 539 
 540 commit b751e4e17e667f11404fc2f290416c0df050e964
 541 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 542 Date:   Thu Feb 10 18:41:38 2011 -0500
 543 
 544     C-EDF: add release master support
 545 
 546     As with GSN-EDF, do not insert release master into CPU heap.
 547 
 548 commit 17e34f413750b26aa493f1f8307f111bc5d487de
 549 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 550 Date:   Thu Feb 10 20:05:15 2011 -0500
 551 
 552     PSN-EDF: add release master support
 553 
 554     We can give up a processor under partitioning, too.
 555 
 556 commit f5bee93f09b907a302e908c3cc3381ffbe826e2b
 557 Author: Glenn Elliott <gelliott@cs.unc.edu>
 558 Date:   Tue Jun 21 02:00:52 2011 -0400
 559 
 560     COMMENT: Correct comment on precise budget enforcement
 561 
 562     Original comment said that this feature wasn't supported,
 563     though it has been since around October 2010.
 564 
 565 commit 592eaca1409e55407e980f71b2ec604ca3610ba5
 566 Author: Glenn Elliott <gelliott@cs.unc.edu>
 567 Date:   Tue Jun 21 01:29:34 2011 -0400
 568 
 569     Avoid needlessly costly migrations.  CONFIG_SCHED_CPU_AFFINITY
 570 
 571     Given a choice between several available CPUs (unlinked) on which
 572     to schedule a task, let the scheduler select the CPU closest to
 573     where that task was previously scheduled.  Hopefully, this will
 574     reduce cache migration penalties.
 575 
 576     Notes: SCHED_CPU_AFFINITY is dependent upon x86 (only x86 is
 577     supported at this time). Also PFair/PD^2 does not make use of
 578     this feature.
 579 
 580     Signed-off-by: Andrea Bastoni <bastoni@cs.unc.edu>
 581 
 582 commit fb8d6602af1cbc09115544056b872b976c6349c3
 583 Author: Andrea Bastoni <bastoni@cs.unc.edu>
 584 Date:   Wed Aug 24 17:32:21 2011 +0200
 585 
 586     Prevent Linux to send IPI and queue tasks on remote CPUs.
 587 
 588     Whether to send IPIs and enqueue tasks on remote runqueues is
 589     plugin-specific. The recent ttwu_queue() mechanism (by calling
 590     ttwu_queue_remote()) interferes with Litmus plugin decisions.
 591 
 592 commit ea62a6fe914f7463f89422dcb1812eb071cbd495
 593 Author: Andrea Bastoni <bastoni@cs.unc.edu>
 594 Date:   Wed Aug 24 12:06:42 2011 +0200
 595 
 596     Update PULL_TIMERS_VECTOR number
 597 
 598     From 2.6.39 the "0xee" vector number that we used for pull_timers
 599     low-level management is is use by invalidate_tlb_X interrupts.
 600     Move the pull_timers vector below the max size of invalidate_tlb.
 601 
 602 commit 56c5c609615322bfbda5adff94ce011eb3d28fef
 603 Author: Andrea Bastoni <bastoni@cs.unc.edu>
 604 Date:   Sat Aug 27 16:10:06 2011 +0200
 605 
 606     Fix prototype mismatching and synch syscall numbers
 607 
 608     * Update prototypes for switched_to(), prio_changed(), select_task_rq().
 609     * Fix missing pid field in printk output.
 610     * Synchronize syscall numbers for arm and x86.
 611 
 612 commit 7b1bb388bc879ffcc6c69b567816d5c354afe42b
 613 Merge: 7d75459 02f8c6a
 614 Author: Andrea Bastoni <bastoni@cs.unc.edu>
 615 Date:   Sat Aug 27 15:43:54 2011 +0200
 616 
 617     Merge 'Linux v3.0' into Litmus
 618 
 619     Some notes:
 620     * Litmus^RT scheduling class is the topmost scheduling class
 621       (above stop_sched_class).
 622     * scheduler_ipi() function (e.g., in smp_reschedule_interrupt())
 623       may increase IPI latencies.
 624     * Added path into schedule() to quickly re-evaluate scheduling
 625       decision without becoming preemptive again. This used to be
 626       a standard path before the removal of BKL.
 627 
 628     Conflicts:
 629     	Makefile
 630     	arch/arm/kernel/calls.S
 631     	arch/arm/kernel/smp.c
 632     	arch/x86/include/asm/unistd_32.h
 633     	arch/x86/kernel/smp.c
 634     	arch/x86/kernel/syscall_table_32.S
 635     	include/linux/hrtimer.h
 636     	kernel/printk.c
 637     	kernel/sched.c
 638     	kernel/sched_fair.c
 639 
 640 commit 3d5537c160c1484e8d562b9828baf679cc53f67a
 641 Author: Glenn Elliott <gelliott@cs.unc.edu>
 642 Date:   Thu Jun 2 16:06:05 2011 -0400
 643 
 644     Full patch for klitirqd with Nvidia GPU support.
 645 
 646 commit 7d754596756240fa918b94cd0c3011c77a638987
 647 Author: Christopher Kenna <cjk@cs.unc.edu>
 648 Date:   Sat Apr 16 20:12:00 2011 -0400
 649 
 650     LITMUS Core: Check for valid class in RT-param syscall.
 651 
 652 commit 6d4cc883ec2470500be6c95fd2e7c6944e89c3e8
 653 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 654 Date:   Sat Feb 12 16:40:43 2011 -0500
 655 
 656     bugfix: release master CPU must signal task was picked
 657 
 658     Otherwise, the release master CPU may try to reschedule in an infinite
 659     loop.
 660 
 661 commit 0f6a8e02773f8c23b5b6a3dbfa044e50c9d7d811
 662 Author: Glenn Elliott <gelliott@cs.unc.edu>
 663 Date:   Thu Mar 31 10:47:01 2011 -0400
 664 
 665     Improve FMLP queue management.
 666 
 667     The next owner of a FMLP-protected resource is dequeued from
 668     the FMLP FIFO queue by unlock() (when the resource is freed by
 669     the previous owner) instead of performing the dequeue by the next
 670     owner immediately after it has been woken up.
 671 
 672     This simplifies the code a little bit and also reduces potential
 673     spinlock contention.
 674 
 675 commit c05eaa8091d2cadc20363d44a85ee454262f4bc2
 676 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 677 Date:   Thu Jan 27 20:11:59 2011 -0500
 678 
 679     Pfair: remove sporadic_release flag
 680 
 681     Instead of having an extra flag, Pfair should just infer sporadic
 682     release based on deadlines like other plugins, too.
 683 
 684 commit 71efbc5459ef95ed902a6980eae646197529364e
 685 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 686 Date:   Fri Jan 7 17:37:01 2011 -0500
 687 
 688     Pfair: support clustered scheduling
 689 
 690     Just like C-EDF is a global scheduler that is split across several
 691     clusters, Pfair can be applied on a per-cluster basis. This patch
 692     changes the Pfair implementation to enable clustering based on the
 693     recently added generic clustering support.
 694 
 695 commit 343d4ead3b12992f494134114cf50e4f37c656c5
 696 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 697 Date:   Thu Jan 27 16:23:46 2011 -0500
 698 
 699     Litmus core: add generic clustering support
 700 
 701     Inspired by the existing C-EDF code, this generic version will build
 702     clusters of CPUs based on a given cache level.
 703 
 704 commit 4ce37704ec0bedb28b5708d32964fca471e793d0
 705 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 706 Date:   Wed Jan 26 20:42:49 2011 -0500
 707 
 708     Litmus core: extract userspace interface from C-EDF
 709 
 710     Make the cluster size configuration in C-EDF generic so that it can be
 711     used by other clustered schedulers.
 712 
 713 commit 963fd846e36b48d5338ef2a134d3ee8d208abc07
 714 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 715 Date:   Sat Jan 29 14:45:49 2011 -0500
 716 
 717     Feather-Trace: rename locking trace points
 718 
 719     Since we don't expect to trace more than one lock type at a time,
 720     having protocol-specific trace points is not required.
 721 
 722 commit 7f0bd4c213ff8dca0eb3bdd887f5c62c8d30fab5
 723 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 724 Date:   Sat Jan 29 15:50:52 2011 -0500
 725 
 726     fdso: pass userpsace config argument to object constructor
 727 
 728     As Glenn pointed out, it is useful for some protocols (e.g.,
 729     k-exclusion protocols) to know the userspace configuration at object
 730     creation time. This patch changes the fdso API to pass the parameter
 731     to the object constructor, which is then in turn passed to the lock
 732     allocater. The return code from the lock allocater is passed to
 733     userspace in return.
 734 
 735     This also fixes some null pointer dereferences in the FDSO code found
 736     by the test suite in liblitmus.
 737 
 738 commit fab768a4cdc49ad7886cac0d0361f8432965a817
 739 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 740 Date:   Sat Jan 29 13:38:24 2011 -0500
 741 
 742     GSN-EDF: re-implement FMLP support
 743 
 744     This introduces the global FMLP based on the generic locking layer.
 745 
 746 commit e705aa52df711112d434ccc87ee5fb5838c205a2
 747 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 748 Date:   Fri Jan 28 19:06:11 2011 -0500
 749 
 750     PSN-EDF: re-implement FMLP support
 751 
 752     Implement the partitioned FMLP with priority boosting based on the
 753     generic lock API.
 754 
 755 commit e593c9dbe858c82e284ff85e625837ae3ab32f1c
 756 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 757 Date:   Fri Jan 28 19:04:08 2011 -0500
 758 
 759     EDF: support priority boosting
 760 
 761     While we are at it, simplify edf_higher_prio() a bit.
 762 
 763 commit fc6482bb7a6a638474565c90159997bd59069297
 764 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 765 Date:   Fri Jan 28 17:30:14 2011 -0500
 766 
 767     FMLP: remove old implementation
 768 
 769 commit e1b81e70c3af9d19d639bc8bdaa5a8fc13bf17a8
 770 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 771 Date:   Fri Jan 28 17:04:58 2011 -0500
 772 
 773     SRP: port to new generic locking API
 774 
 775     This re-enables SRP support under PSN-EDF and demonstrates how the new
 776     locking API should be used.
 777 
 778 commit cc602187d4466374bca031039e145aa1b89aca96
 779 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 780 Date:   Fri Jan 28 16:41:16 2011 -0500
 781 
 782     Litmus core: replace FMLP & SRP system calls with generic syscalls
 783 
 784     This renders the FMLP and SRP unfunctional until they are ported to
 785     the new locking API.
 786 
 787 commit a3db326495d4051bddc657d3b226ad4daa7997c4
 788 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 789 Date:   Fri Jan 28 13:26:15 2011 -0500
 790 
 791     Litmus core: add generic locking API
 792 
 793     Provide a unified userspace interface for plugin-specific locking
 794     protocols.
 795 
 796 commit 2dea9d5e7727b8474981557cbf925687b8f33865
 797 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 798 Date:   Fri Jan 28 12:24:58 2011 -0500
 799 
 800     Litmus core: change plugin locking interface to generic 'allocate_lock()'
 801 
 802     As the number of supported locking protocols is expected to rise,
 803     hard-coding things like priority inheritance in the plugin interface
 804     doesn't scale. Instead, use a new generic lock-ops approach. With this
 805     approach, each plugin can define its own protocol implementation (or
 806     use a generic one), and plugins can support multiple protocols without
 807     having to change the plugin interface for each protocol.
 808 
 809 commit fd8ae31c74975c8499983c9831bff2b136b98434
 810 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 811 Date:   Fri Jan 28 11:54:38 2011 -0500
 812 
 813     fdso: supply object type to constructor and destructor methods
 814 
 815     Passing the object type explicitly will enable generic lock constructors.
 816 
 817 commit a0f243fd1d66c3499f88a690e485e94160ac1a8c
 818 Author: Jonathan Herman <hermanjl@cs.unc.edu>
 819 Date:   Sun Jan 30 15:14:20 2011 -0500
 820 
 821     Fixed is_hrt, is_srt, and is_be macros.
 822 
 823 commit 3cb35a8d90658bd8fb6f9b4f60eb7f97d0643313
 824 Author: Jonathan Herman <hermanjl@cs.unc.edu>
 825 Date:   Sun Jan 30 15:10:49 2011 -0500
 826 
 827     Added task class to feather trace param record.
 828 
 829 commit 904531a6321964579ab0972a8833616e97dbf582
 830 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 831 Date:   Sat Jan 29 20:31:57 2011 -0500
 832 
 833     bugfix: don't let children stay Litmus real-time tasks
 834 
 835     It has always been LITMUS^RT policy that children of real-time tasks
 836     may not skip the admissions test, etc. This used to be enforced, but
 837     was apparently dropped during some port. This commit re-introduces
 838     this policy.  This fixes a kernel panic that occurred when "real-time
 839     children" exited without proper initilization.
 840 
 841 commit 3d8eb93db513bd9caa982f27fee8156405fac754
 842 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 843 Date:   Wed Jan 26 20:36:49 2011 -0500
 844 
 845     Litmus core: add copy_and_chomp() helper
 846 
 847     We read in a line from userspace and remove the trailing newline in a
 848     number of places. This function extracts the common code to avoid
 849     future duplication.
 850 
 851 commit 7dbc4a842d3bcfa755ba82cae46171d0098d4c2c
 852 Author: Jonathan Herman <hermanjl@cs.unc.edu>
 853 Date:   Wed Jan 26 17:47:49 2011 -0500
 854 
 855     Added support for tracing arbitrary actions.
 856 
 857 commit d11808b5c6b032de4284281ed2ff77ae697a4ebd
 858 Author: Christopher Kenna <cjk@cs.unc.edu>
 859 Date:   Sun Jan 9 19:33:49 2011 -0500
 860 
 861     Feather-Trace: dynamic memory allocation and clean exit
 862 
 863     This patch changes Feather-Trace to allocate memory for the minor
 864     devices dynamically, which addresses a long-standing FIXME. It also
 865     provides clean module exit and error conditions for Feather-Trace.
 866 
 867 commit 37eb46be881dde4b405d3d8b48e76b4a8d62ae2c
 868 Author: Christopher Kenna <cjk@cs.unc.edu>
 869 Date:   Fri Jan 7 20:46:25 2011 -0500
 870 
 871     Feather-Trace: register devices with sysfs
 872 
 873     This patch implements support for Feather-Trace devices to use the sysfs
 874     file system and, consequently, udev support.
 875 
 876     This allows us to allocate major/minor numbers for Feather-Trace
 877     devices dynamically, which is desirable because our old static
 878     allocations tend to create conflicts on modern distributions and/or
 879     when there are many cores.
 880 
 881 commit 7648363e5636bd865aeac3236eb4675f0687eb4a
 882 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 883 Date:   Mon Jan 3 07:29:48 2011 -0500
 884 
 885     cleanup C-EDF cluster size configuration
 886 
 887     Refactor the code that determines the C-EDF cluster size.
 888     - Use an enum with symbolic constants instead of magic int values.
 889     - Complain and fail to switch if an unsupported cluster size is requested.
 890     - Default to ALL as suggested by Glenn and Andrea.
 891 
 892 commit 73da50b48b6e7c60add2fcf0b683318b76ecb340
 893 Author: Andrea Bastoni <bastoni@cs.unc.edu>
 894 Date:   Tue Dec 21 18:19:27 2010 -0500
 895 
 896     bugfix: clear scheduled field of the correct CPU upon task_exit in C-EDF
 897 
 898     Do not use the "scheduled_on" field to address the cpus structure
 899     within a cluster. cpus may contain less items than num_online_cpus and
 900     we may cause an out-of-bound access. Instead, use "scheduled_on" to
 901     directly access the per-cpu cpu_entry_t structure.
 902 
 903     Reported-by: Jonathan Herman <hermanjl@cs.unc.edu>
 904 
 905 commit f07bb0a4549916107a7619d0bc4cb5dc09d5744a
 906 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 907 Date:   Mon Nov 29 09:20:03 2010 -0500
 908 
 909     bugfix: avoid underflow in budget_remaining()
 910 
 911     budget_remaining() reports incorrect values due to the operands being
 912     switched, which leads to an integer underflow.
 913 
 914     Reported-by: Chris Kenna <cjk@cs.unc.edu>
 915 
 916 commit 7b544c16beaa1f6ec70a72d53fe84cae95f70a41
 917 Author: Andrea Bastoni <bastoni@cs.unc.edu>
 918 Date:   Thu Nov 25 13:29:31 2010 +0100
 919 
 920     bugfix: fix out-of-bound array access in cedf_activate_plugin()
 921 
 922     Make sure to check for maximum index value when accessing cedf_domain_t
 923     array in cedf_activate_plugin().
 924 
 925     Reported-by: Jeremy Erickson <jerickso@cs.unc.edu>
 926 
 927 commit 2aad06b056054442964f46752bdb098030cdb866
 928 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 929 Date:   Mon Nov 22 01:25:19 2010 -0500
 930 
 931     add optional [function@file:line] tag to TRACE() log
 932 
 933     Add information to each trace message that makes it easier to locate
 934     where it came from. It is disabled by default since this adds a lot of
 935     clutter. Example:
 936 
 937       81281 P1 [gsnedf_schedule@litmus/sched_gsn_edf.c:406]: (rtspin/1483:1) blocks:0 out_of_time:0 np:0 sleep:1 preempt:0 state:0 sig:0
 938       81282 P1 [job_completion@litmus/sched_gsn_edf.c:303]: (rtspin/1483:1) job_completion().
 939       81283 P1 [__add_release@litmus/rt_domain.c:344]: (rtspin/1483:2) add_release(), rel=41941764351
 940       81284 P1 [gsnedf_schedule@litmus/sched_gsn_edf.c:453]: (rtspin/1483:2) scheduled_on = NO_CPU
 941 
 942 commit 7779685f05219ff6e713ee6591644c080f51a8bf
 943 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 944 Date:   Mon Nov 22 00:39:45 2010 -0500
 945 
 946     log job number in TRACE_TASK() and TRACE_CUR()
 947 
 948     For some problems it can be helpful to know which job of a task
 949     generated a log message. This patch changes TRACE_TASK to add :<jobno>
 950     to the existing (<comm>/<pid>) tag.
 951 
 952     The result is a trace such as the following, in which the third job of
 953     rtspin/1511 completes and the fourth job is added to the release
 954     queue.
 955 
 956       137615 P0: (rtspin/1511:3) job_completion().
 957       137616 P0: (rtspin/1511:4) add_release(), rel=262013223089
 958       137617 P0: (rtspin/1511:4) scheduled_on = NO_CPU
 959 
 960     The job number for non-real-time tasks is always zero.
 961 
 962 commit d40413efabc0ab388f6ed83f48b28dc253d47238
 963 Author: Andrea Bastoni <bastoni@cs.unc.edu>
 964 Date:   Fri Nov 19 12:52:08 2010 +0100
 965 
 966     Bugfix: synchronize with all other CPUs before switching plugin
 967 
 968     The CPU triggering the plugin switch should wait until all other CPUs
 969     are in a proper state (synch_on_plugin_switch()) before performing the
 970     actual switch.
 971 
 972     Based on the original patch from Jeremy Erickson <jerickso@cs.unc.edu>.
 973 
 974     This should solve (for most practical cases) the C-EDF-related
 975     plugin-switch problem reported on the ML.
 976 
 977 commit 1726017e944d0086f14f867befbf5ebf07adc7dd
 978 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 979 Date:   Tue Nov 16 11:44:54 2010 -0500
 980 
 981     Improve help message for TRACE() buffer
 982 
 983     It's not being allocated per cpu anymore. Further, provide a hint to
 984     the user where to find the data in userspace.
 985 
 986 commit d922f5eb1c375ab0445240110656c1d793eaad04
 987 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
 988 Date:   Tue Nov 16 11:13:10 2010 -0500
 989 
 990     Make TRACE() buffer size configurable
 991 
 992     Let the user choose an appropriate buffer size (instead of scaling
 993     with NR_CPUS).  The kfifo api requires the buffer to be a power of
 994     two, so enforce this constraint in the configuration.
 995 
 996     This fixes a previously-existing compile-time error for values of
 997     NR_CPU that are not a power of two.
 998 
 999     Based on a patch by Mac Mollison <mollison@cs.unc.edu>.
1000 
1001 commit 6fbc3b495cccf2e4ab7d4ab674b5c576e9946bed
1002 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1003 Date:   Thu Nov 11 16:54:20 2010 -0500
1004 
1005     Workaround: do not set rq->skip_clock_update
1006 
1007     Disabling the clock update seems to be causing problems even in normal
1008     Linux, and causes major bugs under LITMUS^RT. As a workaround, just
1009     disable this "optimization" for now.
1010 
1011     Details: the idle load balancer causes tasks that suspsend to be
1012     marked with set_tsk_need_resched(). When such a task resumes, it may
1013     wrongly trigger the setting of skip_clock_update. However, a
1014     corresponding rescheduling event may not happen immediately, such that
1015     the currently-scheduled task is no longer charged for its execution
1016     time.
1017 
1018 commit 5a0df8d4e9a5da47c804d89426f06e08aa44426f
1019 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1020 Date:   Thu Nov 11 02:54:40 2010 -0500
1021 
1022     Remove LITMUS^RT TRACE_BUG_ON macro
1023 
1024     Linux now has a macro of the same name, which causes namespace
1025     collisions. Since our version is only being used in two places that
1026     haven't triggered in several years, let's just remove it.
1027 
1028 commit 7c1446ddceb89ee1ddbe5d7a90cfd4cb2bc8ad37
1029 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1030 Date:   Thu Nov 11 02:45:32 2010 -0500
1031 
1032     Avoid warning on 64bit builds
1033 
1034     The specifier %u doesn't match sizeof() if sizeof() returns a 64bit
1035     quantity on x86_64. Always cast it to int to avoid the warning.
1036 
1037 commit 98ac0cd2bbe476d79ebf44139a6259cb8d0dc6be
1038 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1039 Date:   Thu Nov 11 02:33:43 2010 -0500
1040 
1041     Cleanup TRACE() implementation
1042 
1043     Since the intial rebased from .24 to .32, the TRACE() implementation
1044     was a hybrid between our old ringbuffer implementation and the new
1045     generic kfifo API. This was a) ugly and b) not save for TRACE()
1046     invoctations during early boot.
1047 
1048     This patch rips out the old parts and replaces the actual buffer with a static kfifo.
1049 
1050     This also increases TRACE() buffer size considerably. As we avoid a
1051     dynamic allocation, this a larger size is less problematic for debug
1052     builds. This helps a bit with holes in the debug log if the
1053     buffer-flushing task is starved.
1054 
1055 commit f599a587e1c7446a76d7d62ed7748f3c4435acd8
1056 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1057 Date:   Wed Nov 10 12:20:48 2010 -0500
1058 
1059     Hook up LITMUS^RT remote preemption support on ARM
1060 
1061     Call into scheduler state machine in the IPI handler.
1062 
1063 commit 2c142d1028f276c6d5e58c553768ae32ed9bda68
1064 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1065 Date:   Wed Nov 10 12:25:43 2010 -0500
1066 
1067     Hook up LITMUS^RT remote preemption support on x86
1068 
1069     Call into scheduler state machine in the IPI handler.
1070 
1071 commit fb3df2ec261d8cd6bcb8206d9d985355214d7767
1072 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1073 Date:   Wed Nov 10 12:10:49 2010 -0500
1074 
1075     Implement proper remote preemption support
1076 
1077     To date, Litmus has just hooked into the smp_send_reschedule() IPI
1078     handler and marked tasks as having to reschedule to implement remote
1079     preemptions. This was never particularly clean, but so far we got away
1080     with it. However, changes in the underlying Linux, and peculartities
1081     of the ARM code (interrupts enabled before context switch) break this
1082     naive approach. This patch introduces new state-machine based remote
1083     preemption support. By examining the local state before calling
1084     set_tsk_need_resched(), we avoid confusing the underlying Linux
1085     scheduler. Further, this patch avoids sending unncessary IPIs.
1086 
1087 commit 516b6601bb5f71035e8859735a25dea0da4a0211
1088 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1089 Date:   Mon Nov 8 20:21:35 2010 -0500
1090 
1091     hook litmus tick function into hrtimer-driven ticks
1092 
1093     Litmus plugins should also be activated if ticks are triggered by
1094     hrtimer.
1095 
1096 commit 34310fd7dbc3ad98d8e7cafa4f872ba71ca00860
1097 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1098 Date:   Mon Nov 8 15:02:09 2010 -0500
1099 
1100     Split out TRACE() from litmus.h and cleanup some includes
1101 
1102     The TRACE() functionality doesn't need all of litmus.h. Currently,
1103     it's impossible to use TRACE() in sched.h due to a circular
1104     dependency. This patch moves TRACE() and friends to
1105     litmus/sched_debug.h, which can be included in sched.h.
1106 
1107     While at it, also fix some minor include ugliness that was revealed by
1108     this change.
1109 
1110 commit c6182ba4a548baf0d1238d0df54e7d38ed299c3e
1111 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1112 Date:   Mon Nov 1 19:40:02 2010 -0400
1113 
1114     sched_trace: make buffer size configurable
1115 
1116     Large sched_trace buffers cause boot problems on the ARM box. Allow
1117     the user to specify smaller buffers.
1118 
1119 commit 8e10e1803e695a08f1fb59e90dac4ba0d8744f89
1120 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1121 Date:   Mon May 31 13:06:50 2010 -0400
1122 
1123     ARM: hookup LITMUS^RT system calls
1124 
1125     Includes the LITMUS^RT-specifc unistd.h extension and modifies the
1126     actual syscall table.
1127 
1128 commit 9907691855fa49ec8ed317fc54a626fcd137c73b
1129 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1130 Date:   Sun May 30 18:52:30 2010 -0400
1131 
1132     ARM: Include LITMUS^RT KConfig
1133 
1134     Make the ARM built aware of the LITMUS^RT-specific options.
1135 
1136 commit dd9d29e1f6ec74af4ff7df1bbe4d05829887475f
1137 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1138 Date:   Mon May 31 15:19:02 2010 -0400
1139 
1140     ARM: provide get_cycles() for RealView PB11{MP,76} and Cortex-A8
1141 
1142     Use the CCNT register to override the default get_cycles() implementation in
1143     arch/arm/asm/timex.h. This is useful for overhead measurements and debugging.
1144 
1145 commit b39ae3793ab590efbdb8aab63a598071782d32b8
1146 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1147 Date:   Mon May 31 15:12:58 2010 -0400
1148 
1149     ARM: allow mach/timex.h to define get_cycles()
1150 
1151     Some platforms have access to a cycle coutner (CCNT) register in the
1152     CP15 coprocessor. This trivial change will allow such platforms to provide
1153     specialized implementations.
1154 
1155 commit 52d5524f64b4f118672f5d80235221fe1c622c18
1156 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1157 Date:   Fri Oct 22 22:47:09 2010 -0400
1158 
1159     C-EDF: move /proc/litmus/cluster_cache to /proc/litmus/plugins/C-EDF/cluster
1160 
1161     Make use of the new per-plugin proc file infrastructure to avoid
1162     littering the global namespace. While at it, also move all the
1163     relevant bits to sched_cedf.c. In the future, each plugin's parameters
1164     should be handled in the respective plugin file.
1165 
1166 commit e06e8374b5c04aeaddf14e9686842011f80f5664
1167 Author: Christopher Kenna <cjk@cs.unc.edu>
1168 Date:   Fri Oct 22 21:04:34 2010 -0400
1169 
1170     Litmus core: refactor the implementation of /proc
1171 
1172 commit 98f56816fcb5c97e0afd21a6e242bb72d5b7a551
1173 Author: Christopher Kenna <cjk@cs.unc.edu>
1174 Date:   Fri Oct 22 17:26:38 2010 -0400
1175 
1176     Litmus core: per-plugin proc directories
1177 
1178     Change the Litmus proc layout so that loaded plugins are visible in
1179     /proc/litmus/plugins/loaded and add Litmus functions make_plugin_proc_dir()
1180     and remove_plugin_proc_dir() to add per-plugin proc directories.
1181 
1182 commit 3dd41424090a0ca3a660218d06afe6ff4441bad3
1183 Merge: 5c54564 f6f94e2
1184 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1185 Date:   Sat Oct 23 01:01:49 2010 -0400
1186 
1187     Merge commit 'v2.6.36' into wip-merge-2.6.36
1188 
1189     Conflicts:
1190     	Makefile
1191     	arch/x86/include/asm/unistd_32.h
1192     	arch/x86/kernel/syscall_table_32.S
1193     	kernel/sched.c
1194     	kernel/time/tick-sched.c
1195 
1196     Relevant API and functions changes (solved in this commit):
1197     - (API) .enqueue_task() (enqueue_task_litmus),
1198       dequeue_task() (dequeue_task_litmus),
1199       [litmus/sched_litmus.c]
1200     - (API) .select_task_rq() (select_task_rq_litmus)
1201       [litmus/sched_litmus.c]
1202     - (API) sysrq_dump_trace_buffer() and sysrq_handle_kill_rt_tasks()
1203       [litmus/sched_trace.c]
1204     - struct kfifo internal buffer name changed (buffer -> buf)
1205       [litmus/sched_trace.c]
1206     - add_wait_queue_exclusive_locked -> __add_wait_queue_tail_exclusive
1207       [litmus/fmlp.c]
1208     - syscall numbers for both x86_32 and x86_64
1209 
1210 commit 5c5456402d467969b217d7fdd6670f8c8600f5a8
1211 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1212 Date:   Wed Sep 22 15:52:03 2010 -0400
1213 
1214     Litmus core: allow PRECISE_ENFORCEMENT
1215 
1216     Allow all kinds of budget enforcement settings now that we have the
1217     supporting infrastructure.
1218 
1219 commit 7caae3d71eae4f5307cae98131390e9d10627c01
1220 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1221 Date:   Mon Oct 18 16:55:37 2010 -0400
1222 
1223     Litmus core: enable precise budget enforcement
1224 
1225     Update the budget enforcement timer after each scheduling decision.
1226 
1227 commit 576b1ad144f81d3fd3bd37d18dab86cd1e8660b0
1228 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1229 Date:   Mon Oct 18 16:01:10 2010 -0400
1230 
1231     Litmus core: add plugin-independent precise budget enforcement infrastructure
1232 
1233     Simple logic: if a task requires precise enforcement, then program a
1234     hr-timer to fire when the task must be descheduled. When the timer
1235     fires, simply activate the scheduler. When we switch to a different
1236     task, either reprogram the timer or cancel it.
1237 
1238 commit 9b718afbc5db5a808804a336c17ba896a9f048a1
1239 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1240 Date:   Wed Sep 22 17:56:59 2010 -0400
1241 
1242     Litmus core: add macro to test for PRECISE_ENFORCEMENT
1243 
1244     Required for EDF-WM. We should implement precise enforcement
1245     in the core distribution soon anyway (once we know how it
1246     works in EDF-WM).
1247 
1248 commit bf34c69c682443b5bf2f9009b1a0039fd60e654f
1249 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1250 Date:   Mon Oct 18 15:58:27 2010 -0400
1251 
1252     Litmus core: add budget_remaining() helper
1253 
1254     Quick way to figure out how much budget a LITMUS^RT job has left.
1255 
1256 commit bd6d5f1dd586a27c2082ad4d95ee58913b471f5c
1257 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1258 Date:   Tue Sep 28 11:08:17 2010 -0400
1259 
1260     hrtimer: add init function to properly set hrtimer_start_on_info params
1261 
1262     This helper function is also useful to remind us that if we use
1263     hrtimer_pull outside the scope of triggering remote releases, we need to
1264     take care of properly set the "state" field of hrtimer_start_on_info
1265     structure.
1266 
1267 commit c8f95e3e04ffc1d96b7b615f8be9b7ac941ead15
1268 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1269 Date:   Wed Sep 22 23:13:03 2010 -0400
1270 
1271     Litmus core: set state to TASK_RUNNING before calling wake_up()
1272 
1273     Having tasks that are !is_running() in shared structures is
1274     very confusing during development and debugging, and can likely
1275     mask bugs and/or create races.
1276 
1277     It seems like a strange choice that Linux changes a task's state
1278     only _after_ activating it. For LITMUS^RT tasks, we change this order.
1279 
1280 commit 8ad8bfcab56a140389df2ed323b56d849e6cf5fb
1281 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1282 Date:   Wed Sep 22 18:17:37 2010 -0400
1283 
1284     rt_domain_t: disable timer TRACE() spam by default
1285 
1286     These messages are highly useful when debugging races,
1287     but they quickly litter the log when looking for something else.
1288 
1289     We keep them around, but by default they shouldn't show up.
1290 
1291 commit 8cc60b37588e130bed9d418bcfbe4d64c3a91935
1292 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1293 Date:   Tue Sep 21 22:49:37 2010 -0400
1294 
1295     rt_domain_t: add add_release_on()
1296 
1297     This API addition allows the calling code to override
1298     the release master for a given rt_domain_t object. This
1299     is particularly useful if a job is supposed to migrate
1300     to a particular CPU. This need arises for example in semi-
1301     partitioned schedulers.
1302 
1303 commit 2ed4499a959f8fc30e430b6644ec83ceb7d49ef6
1304 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1305 Date:   Tue Sep 21 12:16:00 2010 -0400
1306 
1307     PSN-EDF: remove outdated comment
1308 
1309     ...and replace it with a more useful one. We don't directly modify
1310     Linux run queues anymore since (at least) LITMUS^RT 2008.
1311 
1312 commit 136a08dbe8c28e751b01e932420f715edb229f6b
1313 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1314 Date:   Fri Jul 16 10:30:06 2010 -0400
1315 
1316     Bugfix: avoid link error in Feather-Trace on x86
1317 
1318     If no events are defined but Feater-Trace support is enabled, then the current
1319     implementation generates a link error because the __event_table sections is
1320     absent.
1321 
1322     > arch/x86/built-in.o: In function `ft_disable_all_events':
1323     > (.text+0x242af): undefined reference to `__start___event_table'
1324 
1325     As a simple work around, we force zero-element array to always be "allocated"
1326     in the __event_table section. This ensures that we end up with a zero-byte
1327     section if no events are enabled, and does not affect the layout of the section
1328     if events are present.
1329 
1330     > bbb@ludwig:~/dev/litmus2010$ nm vmlinux | grep event_table
1331     > ffffffff81950cdc D __event_table_dummy
1332     > ffffffff81950cdc A __start___event_table
1333     > ffffffff81950cdc A __stop___event_table
1334 
1335 commit cbc5d49e4973400737aab50b60dc5d86e71f5420
1336 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1337 Date:   Sat Jun 19 13:45:36 2010 -0400
1338 
1339     Bugfix: avoid conditional compilation dependent error
1340 
1341     If RELEASE_MASTER is not selected the "info" hrtimer_start_on_info
1342     structure in release_heap structure is not visible and trying to access
1343     "info" from reinit_release_heap() causes the following error:
1344 
1345     error: 'struct release_heap' has no member named 'info'
1346 
1347     info should not be referenced if RELEASE_MASTER is not used.
1348 
1349     The problem was first reported by Glenn <gelliott@cs.unc.edu>
1350 
1351 commit d1aa1956eb23202e4d614574f686e53b8785212c
1352 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1353 Date:   Sat Jun 12 20:22:16 2010 -0400
1354 
1355     Bugfix: change __ARCH_HAS_SEND_PULL_TIMERS in CONFIG_ARCH_HAS_SEND_PULL_TIMERS
1356 
1357     Commit "0c527966 Make release master support optional" uses
1358     __ARCH_HAS_SEND_PULL_TIMERS instead of CONFIG_ARCH_HAS_SEND_PULL_TIMERS
1359     (introduced in commit 0fb33c99) to conditionally compile a pull timer
1360     related code in rt_domain.c. This code is disabled and pull-timer's
1361     state is no longer properly reset. Therefore, a pulled timer cannot be
1362     armed anymore.
1363 
1364 commit 9840983a4f30145bcf0b82b6e2bc8518e7212fb5
1365 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1366 Date:   Wed Jun 2 18:27:47 2010 -0400
1367 
1368     Make litmus_sched_class static
1369 
1370     litmus_sched_class wasn't declared static, but it's not used outside
1371     sched.c, so change it's signature to static.
1372 
1373 commit 753fb14dfb0662e1d38758ffc6876c0ab1c7bd9e
1374 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1375 Date:   Mon May 31 12:52:35 2010 -0400
1376 
1377     Make  platform-specific Feather-Trace depend on !CONFIG_DEBUG_RODATA
1378 
1379     Feather-Trace rewrites instructions in the kernel's .text segment.
1380     This segment may be write-protected if CONFIG_DEBUG_RODATA is selected.
1381     In this case, fall back to the default flag-based Feather-Trace
1382     implementation. In the future, we could either adopt the ftrace method
1383     of rewriting .text addresses using non-.text mappings or we could
1384     consider replacing Feather-Trace with ftrace altogether.
1385 
1386     For now, this patch avoids unexpected runtime errors.
1387 
1388 commit 62c186fde48926a30f4e61332a805430dc1325cd
1389 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1390 Date:   Mon May 31 12:15:51 2010 -0400
1391 
1392     Make PFAIR optional to prevent build and runtime failures.
1393 
1394     The PFAIR plugin always implicitly assumed !NO_HZ (the schedule
1395     is wrong if NO_HZ is enabled) and does not built if hrtimers are absent:
1396 
1397     > litmus/built-in.o: In function `pfair_activate_plugin':
1398     > sched_pfair.c:(.text+0x7f07): undefined reference to `cpu_stagger_offset'
1399     > litmus/built-in.o: In function `init_pfair':
1400     > sched_pfair.c:(.init.text+0x487): undefined reference to `cpu_stagger_offset'
1401 
1402     cpu_stagger_offset() is only available if hrtimers are enabled.
1403 
1404     This patch makes these dependencies explicit.
1405 
1406 commit 4382e90cf851fc1d209a466bab92e256aeb7acf1
1407 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1408 Date:   Mon May 31 00:54:07 2010 -0400
1409 
1410     Make C-EDF depend on x86 and SYSFS
1411 
1412     C-EDF depends on intel_cacheinfo.c (for get_shared_cpu_map()) which is
1413     only available on x86 architectures. Furthermore, get_shared_cpu_map()
1414     is only available if SYSFS filesystem is present.
1415 
1416 commit 8bf9de45b663e4b9ce889eb24929ce773f306339
1417 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1418 Date:   Sun May 30 19:50:52 2010 -0400
1419 
1420     Make smp_send_pull_timers() optional.
1421 
1422     There is currently no need to implement this in ARM.
1423     So let's make it optional instead.
1424 
1425 commit cedc8df1cf1ff935af5455a9d565dac05192a47f
1426 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1427 Date:   Sun May 30 19:46:21 2010 -0400
1428 
1429     Make release master support optional
1430 
1431     Introduces CONFIG_RELEASE_MASTER and makes release
1432     master support dependent on the new symbol. This is
1433     useful because dedicated interrupt handling only applies
1434     to "large" multicore platforms. This will allow us to
1435     not implement smp_send_pull_timers() for all platforms.
1436 
1437 commit 5b54b24c13b7c5dbaa06eae5e1a0075da354289c
1438 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1439 Date:   Sun May 30 18:59:30 2010 -0400
1440 
1441     Make compilation of C-EDF optional.
1442 
1443     C-EDF only makes sense on multicore platforms that have shared caches.
1444     Make it possible to disable it on other platforms, in particular,
1445     on those that do not export get_shared_cpu_map().
1446 
1447 commit 152968b15afb74a6adba6d512c5eebf0280c8f00
1448 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1449 Date:   Sun May 30 18:41:28 2010 -0400
1450 
1451     Make __ARCH_HAS_FEATHER_TRACE a proper CONFIG_ variable.
1452 
1453     The idea of the Feather-Trace default implementation is that LITMUS^RT should
1454     work without a specialized Feather-Trace implementation present. This was
1455     actually broken.
1456 
1457     Changes litmus/feather_trace.h to only include asm/feather_trace.h if actually
1458     promised by the architecture.
1459 
1460 commit a7205820bae197a89fc746f9f3c07e389d7068ba
1461 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1462 Date:   Fri May 28 15:45:23 2010 -0400
1463 
1464     Bugfix: re-insert missing TS_PLUGIN_TICK_END tracing point
1465 
1466     Insert PLUGIN_TICK_END tracing point in litmus_tick(). It was lost during
1467     the porting of 2008.3 to 2010.1.
1468 
1469 commit de2d5dfa2dce8ec40555b3bb6dfe21627e472c52
1470 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1471 Date:   Thu May 20 16:14:00 2010 -0400
1472 
1473     Add support for one single cluster (all cpus) on C-EDF
1474 
1475     - With the "ALL" cluster size option the behavior of C-EDF is
1476       equivalent to G-EDF (one single cluster)
1477 
1478 commit 6f89d4f31485546674187cf3b4d472f230b263d0
1479 Author: Glenn Elliott <gelliott@koruna.cs.unc.edu>
1480 Date:   Thu May 20 14:33:27 2010 -0400
1481 
1482     Added support for choices in budget policy enforcement.
1483 
1484     NO_ENFORCEMENT - A job may execute beyond its declared execution time.
1485       Jobs notify the kernel that they are complete via liblitmus's
1486       sleep_next_period()
1487     QUANTUM_ENFORCEMENT - The kernel terminates a job if its actual execution
1488       time exceeds the declared execution time.
1489     PRECISE_ENFORCEMENT - Hook declared, but not yet implemented.  Plan to
1490       support this policy through hrtimers.  Error thrown if specified.
1491 
1492 commit 521422c4ef2c64731f709030915a7b301709f4b4
1493 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1494 Date:   Sat May 29 23:53:40 2010 -0400
1495 
1496     Update kfifo and spinlock_t in sched_trace.c
1497 
1498     - kfifo needs to be defined and used differently (see include/linux/kfifo.h)
1499     - spinlock -> raw_spinlock
1500     - include slab.h when using kmalloc and friends
1501 
1502     This commit compiles and is the logical end of the merge of Litmus and
1503     2.6.34.
1504 
1505 commit 8e9830a5bdb081fd3f4387db3a3838a687dfdad2
1506 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1507 Date:   Sat May 29 23:50:17 2010 -0400
1508 
1509     Update sched_class and spinlock_t in litmus.c
1510 
1511     - get_rr_interval() changed signature
1512     - load_balance() and move_one_tak() are no longer needed
1513     - spinlock_t -> raw_spinlock_t
1514 
1515     This commit does not compile.
1516 
1517 commit a66246f9e973a68fb9955a2fa7663a2e02afbd30
1518 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1519 Date:   Sat May 29 23:45:13 2010 -0400
1520 
1521     Change most LitmusRT spinlock_t in raw_spinlock_t
1522 
1523     Adapt to new schema for spinlock:
1524     (tglx 20091217)
1525     spinlock - the weakest one, which might sleep in RT
1526     raw_spinlock - spinlock which always spins even on RT
1527     arch_spinlock - the hardware level architecture dependent implementation
1528 
1529     ----
1530 
1531     Most probably, all the spinlocks changed by this commit will be true
1532     spinning lock (raw_spinlock) in PreemptRT (so hopefully we'll need few
1533     changes when porting Litmmus to PreemptRT).
1534 
1535     There are a couple of spinlock that the kernel still defines as
1536     spinlock_t (therefore no changes reported in this commit) that might cause
1537     us troubles:
1538 
1539     - wait_queue_t lock is defined as spinlock_t; it is used in:
1540       * fmlp.c -- sem->wait.lock
1541       * sync.c -- ts_release.wait.lock
1542 
1543     - rwlock_t used in fifo implementation in sched_trace.c
1544       * this need probably to be changed to something always spinning in RT
1545         at the expense of increased locking time.
1546 
1547     ----
1548 
1549     This commit also fixes warnings and errors due to the need to include
1550     slab.h when using kmalloc() and friends.
1551 
1552     ----
1553 
1554     This commit does not compile.
1555 
1556 commit 6ffc1fee98c4b995eb3a0285f4f8fb467cb0306e
1557 Merge: e40152e 7c1ff4c
1558 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1559 Date:   Sat May 29 23:35:01 2010 -0400
1560 
1561     Merge branch 'master' into wip-merge-2.6.34
1562 
1563     Simple merge between master and 2.6.34 with conflicts resolved.
1564 
1565     This commit does not compile, the following main problems are still
1566     unresolved:
1567 
1568     - spinlock -> raw_spinlock API changes
1569     - kfifo API changes
1570     - sched_class API changes
1571 
1572     Conflicts:
1573     	Makefile
1574     	arch/x86/include/asm/hw_irq.h
1575     	arch/x86/include/asm/unistd_32.h
1576     	arch/x86/kernel/syscall_table_32.S
1577     	include/linux/hrtimer.h
1578     	kernel/sched.c
1579     	kernel/sched_fair.c
1580 
1581 commit 7c1ff4c544dd650cceff3cd69a04bcba60856678
1582 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1583 Date:   Fri May 28 10:51:01 2010 -0400
1584 
1585     Add C-EDF Plugin
1586 
1587     Improved C-EDF plugin. C-EDF now supports different cluster sizes (based
1588     on L2 and L3 cache sharing) and supports dynamic changes of cluster size
1589     (this requires reloading the plugin).
1590 
1591 commit 425a6b5043bcc2142804107c853f978ac2fe3040
1592 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1593 Date:   Fri May 28 10:49:09 2010 -0400
1594 
1595     Export shared_cpu_map
1596 
1597     The cpumap of CPUs that share the same cache level is not normally
1598     available outside intel_cacheinfo.c. This commit allows to export such
1599     map.
1600 
1601 commit f85625ccf28d1bffd4dac916babb76b910ebef31
1602 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1603 Date:   Tue Apr 27 11:00:19 2010 -0400
1604 
1605     Synchronize plugin switching
1606 
1607     Make sure the plugin is not used by any CPUs while switching.
1608     The CPU performing the switch sends an IPI to all other CPUs forcing
1609     them to synchronize on an atomic variable.
1610 
1611 commit 8fe2fb8bb1c1cd0194608bc783d0ce7029e8d869
1612 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1613 Date:   Mon Apr 26 13:42:00 2010 -0400
1614 
1615     Measure timer re-arming in the proper location
1616 
1617     hrtimers are properly rearmed during arm_release_timer() and no longer
1618     after rescheduling (with the norqlock mechanism of 2008.3). This commit
1619     accordingly updates the locations where measures are taken.
1620 
1621 commit 5da9b3e7aab0755f6ca19738d33e218e02b19a41
1622 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1623 Date:   Fri Mar 12 12:23:13 2010 -0500
1624 
1625     Bugfix: PSN-EDF should log job_completion events
1626 
1627     Log task completions in job_completion() for PSN-EDF.
1628     This fixes the problem of missing job-completion events for PSN-EDF.
1629 
1630 commit 7a4affe47db86075eb36519049d047f6facab378
1631 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1632 Date:   Tue Mar 2 11:51:07 2010 -0500
1633 
1634     Bugfix: PSN-EDF should only requeue tasks that are not scheduled
1635 
1636     Requeue a task that is already scheduled will cause it to be effectively
1637     in the runqueue twice since scheduled tasks are conceptually the head
1638     of the queue. If a task is still scheduled, then schedule() will do the
1639     right thing and do the requeuing if necessary.
1640 
1641     This fixes crashes reported by Glenn and Andrea.
1642 
1643 commit 0c1a489cb92c996d50adfb84fee5edd7205e0c1b
1644 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1645 Date:   Thu Feb 4 19:47:29 2010 -0500
1646 
1647     Used miscdevice API for sched_trace
1648 
1649     This patch changes sched_trace.c to use the miscdevice API
1650     instead of doing all the cdev management ourselves. This remove a
1651     chunk of code and we get sysfs / udev integration for free.
1652 
1653     On systems with default udev rules, this will result in a /dev/litmus/log
1654     device being created automatically.
1655 
1656 commit 8815090d72fe0fe8f5f67e3bcc8fbe7a5ad1704d
1657 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1658 Date:   Thu Feb 25 19:33:22 2010 -0500
1659 
1660     Bugfix: make fdso syscalls 64bit clean
1661 
1662     This fixes a bug found by liblitmus's regression test suite.
1663     Before:
1664     > ** LITMUS^RT test suite.
1665     > ** Running tests for LINUX.
1666     > ** Testing: don't open FMLP semaphores if FMLP is not supported...
1667     > !! TEST FAILURE open_fmlp_sem(fd, 0) -> -16, Success (expected: EBUSY)
1668     >    at tests/fdso.c:21 (test_fmlp_not_active)
1669     > ** Testing: reject invalid object descriptors... ok.
1670     > ** Testing: reject invalid object types...
1671     > !! TEST FAILURE od_open(0, -1, 0) -> -22, Bad file descriptor (expected: EINVAL)
1672     >    at tests/fdso.c:51 (test_invalid_obj_type)
1673     > ** Testing: reject invalid rt_task pointers... ok.
1674     > ** Result: 2 ok, 2 failed.
1675 
1676     After:
1677     > ** LITMUS^RT test suite.
1678     > ** Running tests for LINUX.
1679     > ** Testing: don't open FMLP semaphores if FMLP is not supported... ok.
1680     > ** Testing: reject invalid object descriptors... ok.
1681     > ** Testing: reject invalid object types... ok.
1682     > ** Testing: reject invalid rt_task pointers... ok.
1683     > ** Result: 4 ok, 0 failed.
1684 
1685 commit 8ad3e04b815e44d084b855cfa3dcda260cdf56ae
1686 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1687 Date:   Fri Feb 19 13:42:35 2010 -0500
1688 
1689     Bugfix: don't inherit od_table across forks
1690 
1691     The od_table is strictly per-thread and should not be inherited across
1692     a fork/clone. This caused memory corruption when a task exited, which
1693     ultimately could lead to oopses in unrelated code.
1694 
1695     Bug and testcase initially reported by Glenn.
1696 
1697 commit 944f051fda9551483399bed556870b0895df1efa
1698 Author: Glenn Elliott <gelliott@cs.unc.edu>
1699 Date:   Fri May 28 10:39:56 2010 -0400
1700 
1701     Bugfix: 1) incorrect FMLP high prio task tracking and 2) race in print statement
1702 
1703     1) High priority task tied to FMLP semaphore in P-EDF scheduling is
1704        incorrectly tracked for tasks acquiring the lock without
1705        contention.  (HP is always set to CPU 0 instead of proper CPU.)
1706     2) Race in a print statement from P-EDF's pi_block() causes NULL
1707        pointer dereference.
1708 
1709 commit 9039e5f731ca5f9a0c69f8523ccfee044111d2e3
1710 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1711 Date:   Wed Feb 3 19:56:21 2010 -0500
1712 
1713     Use generic preemption function in GSN- and PSN-EDF.
1714 
1715     This patch updates non-preemptive section support in
1716     GSN- and PSN-EDF.
1717 
1718 commit f3a6cb9af5cdb01f29ad32b01aa56a14f0da144e
1719 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1720 Date:   Wed Feb 3 19:42:02 2010 -0500
1721 
1722     Introduce generic NP-section aware preemption function
1723 
1724     Dealing with preemptions across CPUs in the presence of non-preemptive
1725     sections can be tricky and should not be replicated across (event-driven) plugins.
1726 
1727     This patch introduces a generic preemption function that handles
1728     non-preemptive sections (hopefully) correctly.
1729 
1730 commit fb95c290fe461de794c984bc4130741f04f9142d
1731 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1732 Date:   Wed Feb 3 19:40:01 2010 -0500
1733 
1734     Re-implement non-preemptive section support.
1735 
1736     Re-introduce NP sections in the configuration and in litmus.h. Remove the old
1737     np_flag from rt_param.
1738 
1739     If CONFIG_NP_SECTION is disabled, then all non-preemptive section checks are
1740     constant expressions which should get removed by the dead code elimination
1741     during optimization.
1742 
1743     Instead of re-implementing sys_exit_np(), we simply repurposed sched_yield()
1744     for calling into the scheduler to trigger delayed preemptions.
1745 
1746 commit b973c95c86e6710c913c01a67013605f68a3c2c3
1747 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1748 Date:   Wed Feb 3 19:35:20 2010 -0500
1749 
1750     Add virtual LITMUS^RT control device.
1751 
1752     This device only supports mmap()'ing a single page.
1753     This page is shared RW between the kernel and userspace.
1754     It is inteded to allow near-zero-overhead communication
1755     between the kernel and userspace. It's first use will be a
1756     proper implementation of user-signaled
1757     non-preemptable section support.
1758 
1759 commit 5e987d486c0f89d615d134512938fc1198b3ca67
1760 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1761 Date:   Fri Jan 29 19:25:26 2010 -0500
1762 
1763     Bugfix: clear LITMUS^RT state on fork completely
1764 
1765     When a real-time task forks, then its LITMUS^RT-specific fields should be cleared,
1766     because we don't want real-time tasks to spawn new real-time tasks that bypass
1767     the plugin's admission control (if any).
1768 
1769     This was broken in three ways:
1770     1) kernel/fork.c did not erase all of tsk->rt_param, only the first few bytes due to
1771        a wrong size argument to memset().
1772     2) It should have been calling litmus_fork() instead anyway.
1773     3) litmus_fork() was _also_ not clearing all of tsk->rt_param, due to another size
1774        argument bug.
1775 
1776     Interestingly, 1) and 2) can be traced back to the 2007->2008 port,
1777     whereas 3) was added by Mitchell much later on (to dead code, no less).
1778 
1779     I'm really surprised that this never blew up before.
1780 
1781 commit 37b840336a1663a5ce62d663a702d9afefd56d23
1782 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1783 Date:   Mon Feb 1 23:07:54 2010 -0500
1784 
1785     Add Feather-Trace x86_64 architecture dependent code
1786 
1787 commit d1a840d7194fdd09c1bd9977e30fd391ef2a7526
1788 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1789 Date:   Tue Jan 19 19:38:14 2010 -0500
1790 
1791     [ported from 2008.3] Add Feather-Trace x86_32 architecture dependent code
1792 
1793     - [ported from 2008.3] Add x86_32 architecture dependent code.
1794     - Add the infrastructure for x86_32 - x86_64 integration.
1795 
1796 commit 07ae7efcb81f95eb8e870cad21c7ba72573af7e8
1797 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1798 Date:   Thu Dec 17 21:48:38 2009 -0500
1799 
1800     Add support for x86_64 architecture
1801 
1802     - Add syscall on x86_64
1803 
1804     - Refactor __NR_sleep_next_period -> __NR_complete_job
1805       for both x86_32 and x86_64
1806 
1807 commit 5306b9834e9660e370fb8430ff22d4a47b4bbdf5
1808 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1809 Date:   Thu Dec 17 21:47:51 2009 -0500
1810 
1811     Add pull_timers_interrupt() to x86_64
1812 
1813     Add apic interrupt vector for pull_timers() in x86_64 arch.
1814 
1815 commit b30bc467e88c9f1e6335ac7d442d0190bf6f6a2e
1816 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1817 Date:   Thu Jan 28 19:03:17 2010 -0500
1818 
1819     [ported from 2008.3] Add PSN-EDF Plugin
1820 
1821 commit c2f4c165b208062d90f65a1c1a0c815261c6a81e
1822 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1823 Date:   Wed Jan 27 19:57:09 2010 -0500
1824 
1825     [ported from 2008.3] Add PFAIR plugin
1826 
1827 commit cddade083e5ea74cba6f0e4b2fa10c6bbec1336c
1828 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1829 Date:   Sat Jan 16 19:39:40 2010 -0500
1830 
1831     Add optional dynamic assignment of tracing devices major nr
1832 
1833     Setting FT_TASK_TRACE_MAJOR, LOG_MAJOR, FT_TRACE_MAJOR to 0
1834     allows to have them automatically assigned by the kernel
1835 
1836 commit a084c01569bcfe13fd880a0b1e3a9026629a89da
1837 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1838 Date:   Fri May 28 10:30:29 2010 -0400
1839 
1840     Better explanation of jump-to-CFS optimization removal
1841 
1842     GSN-EDF and friends rely on being called even if there is currently
1843     no runnable real-time task on the runqueue for (at least) two reasons:
1844     1) To initiate migrations. LITMUS^RT pull tasks for migrations; this requires
1845          plugins to be called even if no task is currently present.
1846     2) To maintain invariants when jobs block.
1847 
1848 commit e68debebdc2983600063cd6b04c6a51c4b7ddcc1
1849 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1850 Date:   Fri May 28 10:25:34 2010 -0400
1851 
1852     Integrate litmus_tick() in task_tick_litmus()
1853 
1854     - remove the call to litmus_tick() from scheduler_tick() just after
1855       having performed the class task_tick() and integrate
1856       litmus_tick() in task_tick_litmus()
1857 
1858     - task_tick_litmus() is the handler for the litmus class task_tick()
1859       method. It is called in non-queued mode from scheduler_tick()
1860 
1861 commit 9ac80419f88f192cdf586da3df585c224ef27773
1862 Author: Bjoern B. Brandenburg <bbb@cs.unc.edu>
1863 Date:   Wed Feb 3 13:59:40 2010 -0500
1864 
1865     Turn off GSN-EDF TRACE() spam by default.
1866 
1867     Having GSN-EDF log so many things each tick is useful
1868     when tracking down race conditions, but it also makes
1869     it really hard to find anything else. Thus, turn it off by
1870     default but leave it in for future debugging fun.
1871 
1872 commit ee09f78d8faa0b988088d93142e6f5f8a6e75394
1873 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1874 Date:   Mon Dec 21 12:23:57 2009 -0500
1875 
1876     Refactor binomial heap names: heap -> bheap
1877 
1878     - Binomial heap "heap" names conflicted with priority heap
1879       of cgroup in kernel
1880     - This patch change binomial heap "heap" names in "bheap"
1881 
1882 commit 0b28a3122d6917784701377e15a863489aee1c6c
1883 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1884 Date:   Thu Dec 17 21:47:19 2009 -0500
1885 
1886     [ported from 2008.3] Add release-master support
1887 
1888 commit c15be843778236e9f2fdbc207ab36ba996b2bb1b
1889 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1890 Date:   Thu Dec 17 21:45:38 2009 -0500
1891 
1892     [ported from 2008.3] Add hrtimer_start_on() API
1893 
1894 commit b085cafc43bc395e255626204169e20a587f28ba
1895 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1896 Date:   Thu Dec 17 21:44:47 2009 -0500
1897 
1898     [ported from 2008.3] Add send_pull_timers() support for x86_32 arch
1899 
1900 commit 50ca05ff9cc85176c3ee18bf1363d3d7c34aa355
1901 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1902 Date:   Thu Dec 17 21:39:14 2009 -0500
1903 
1904     [ported from 2008.3] Add GSN-EDF plugin
1905 
1906     - insert arm_release_timer() in add_relese() path
1907     - arm_release_timer() uses __hrtimer_start_range_ns() instead of
1908       hrtimer_start() to avoid deadlock on rq->lock.
1909 
1910 commit 2a94c7bf9869a13e32de7a1fe94596de7b4789a8
1911 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1912 Date:   Fri May 28 10:03:24 2010 -0400
1913 
1914     [ported from 2008.3] Add LITRMUS^RT syscalls to x86_32
1915 
1916 commit 269cf3c49cef2b23605e98ad4a8133357bebaac0
1917 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1918 Date:   Thu Dec 17 21:36:40 2009 -0500
1919 
1920     [ported from 2008.3] Add FMLP support
1921 
1922 commit 5442a8adfce93c1cd556e04bfc0a118adc3b683e
1923 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1924 Date:   Thu Dec 17 21:34:09 2009 -0500
1925 
1926     [ported from 2008.3] Add Stack Resource Policy (SRP) support
1927 
1928 commit fa3c94fc9cd1619fe0dd6081a1a980c09ef3e119
1929 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1930 Date:   Thu Dec 17 21:33:26 2009 -0500
1931 
1932     [ported from 2008.3] Add File Descriptor Attached Shared Objects (FDSO) infrastructure
1933 
1934 commit f5936ecf0cff0b94419b6768efba3e15622beeb6
1935 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1936 Date:   Thu Dec 17 21:32:31 2009 -0500
1937 
1938     [ported from 2008.3] Add common EDF functions
1939 
1940 commit 53696c1fe6a6ada66f2a47c078d62aee40ad8ebe
1941 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1942 Date:   Thu Dec 17 21:31:46 2009 -0500
1943 
1944     [ported from 2008.3] Add rt_domain_t support
1945 
1946     Still to be merged:
1947     - arm_release_timer() with no rq locking
1948 
1949 commit 4e593e7105dec02e62ea7a1812dccb35a0d56d01
1950 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1951 Date:   Thu Dec 17 21:30:47 2009 -0500
1952 
1953     [ported from 2008.3] Add support for quantum alignment
1954 
1955 commit 1d823f50678d7cc3bf72bf89ec0bddc7338e23d5
1956 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1957 Date:   Thu Dec 17 21:30:11 2009 -0500
1958 
1959     [ported from 2008.3] Add synchronous task release API
1960 
1961 commit 59d8d4c53f1e9f6408b87fc22e319e78f664276f
1962 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1963 Date:   Thu Dec 17 21:29:31 2009 -0500
1964 
1965     [ported from 2008.3] Add complete_n() call
1966 
1967 commit 2079f38466395c64ef40ef3429ee52fd92cdbd99
1968 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1969 Date:   Sat Jan 16 19:36:50 2010 -0500
1970 
1971     Move sched_trace ring buffer to kfifo implementation
1972 
1973     Use kfifo [kernel/kfifo.c] to implement the ring buffer used
1974     for sched_trace (TRACE() and TRACE_TASK() macros)
1975 
1976     This patch also includes some reorganization of sched_trace.c code
1977     and some fixes:
1978 
1979     - 1c39c59b3 Fix GFP_KERNEL in rb_alloc_buf with interrupt disabled.
1980     - 193ad2688 Let TRACE() log buffer size and comment converge.
1981     - 6195e2ae8 re-enable capturing of printk() messages in TRACE() logs.
1982 
1983 commit 96979188007a0671d3f067d7edf144742d7433ee
1984 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1985 Date:   Thu Dec 17 21:26:50 2009 -0500
1986 
1987     [ported from 2008.3] Add tracing support and hook up Litmus KConfig for x86
1988 
1989     - fix requesting more than 2^11 pages (MAX_ORDER)
1990       to system allocator
1991 
1992     Still to be merged:
1993     - feather-trace generic implementation
1994 
1995 commit cf3f4bd8db320f3f487d66bdec924e926f004787
1996 Author: Andrea Bastoni <bastoni@cs.unc.edu>
1997 Date:   Thu Dec 17 21:24:47 2009 -0500
1998 
1999     [ported from 2008.3] Add Feather-Trace device file support
2000 
2001 commit 4b38febbd59fd33542a343991262119eb9860f5e
2002 Author: Andrea Bastoni <bastoni@cs.unc.edu>
2003 Date:   Thu Dec 17 21:23:36 2009 -0500
2004 
2005     [ported from 2008.3] Core LITMUS^RT infrastructure
2006 
2007     Port 2008.3 Core LITMUS^RT infrastructure to Linux 2.6.32
2008 
2009     litmus_sched_class implements 4 new methods:
2010 
2011     - prio_changed:
2012       void
2013 
2014     - switched_to:
2015       void
2016 
2017     - get_rr_interval:
2018       return infinity (i.e., 0)
2019 
2020     - select_task_rq:
2021       return current cpu
2022 ---
2023  Makefile                                    |    4 +-
2024  arch/arm/Kconfig                            |    8 +
2025  arch/arm/include/asm/timex.h                |    2 +
2026  arch/arm/include/asm/unistd.h               |    3 +
2027  arch/arm/kernel/calls.S                     |   12 +
2028  arch/arm/kernel/smp.c                       |    4 +
2029  arch/arm/mach-realview/include/mach/timex.h |   27 +
2030  arch/x86/Kconfig                            |    8 +
2031  arch/x86/include/asm/entry_arch.h           |    1 +
2032  arch/x86/include/asm/feather_trace.h        |   17 +
2033  arch/x86/include/asm/feather_trace_32.h     |   79 +
2034  arch/x86/include/asm/feather_trace_64.h     |   67 +
2035  arch/x86/include/asm/hw_irq.h               |    3 +
2036  arch/x86/include/asm/irq_vectors.h          |    7 +
2037  arch/x86/include/asm/processor.h            |    4 +
2038  arch/x86/include/asm/unistd_32.h            |    6 +-
2039  arch/x86/include/asm/unistd_64.h            |    4 +
2040  arch/x86/kernel/Makefile                    |    2 +
2041  arch/x86/kernel/cpu/intel_cacheinfo.c       |   17 +
2042  arch/x86/kernel/entry_64.S                  |    2 +
2043  arch/x86/kernel/ft_event.c                  |  118 ++
2044  arch/x86/kernel/irq.c                       |    4 +
2045  arch/x86/kernel/irqinit.c                   |    3 +
2046  arch/x86/kernel/smp.c                       |   31 +
2047  arch/x86/kernel/syscall_table_32.S          |   13 +
2048  fs/exec.c                                   |   13 +-
2049  fs/inode.c                                  |    2 +
2050  include/linux/completion.h                  |    2 +
2051  include/linux/fs.h                          |   21 +-
2052  include/linux/hardirq.h                     |    4 +
2053  include/linux/hrtimer.h                     |   32 +
2054  include/linux/interrupt.h                   |   12 +-
2055  include/linux/mutex.h                       |   10 +
2056  include/linux/sched.h                       |   19 +-
2057  include/linux/semaphore.h                   |    9 +
2058  include/linux/smp.h                         |    5 +
2059  include/linux/tick.h                        |    5 +
2060  include/linux/workqueue.h                   |   18 +
2061  include/litmus/affinity.h                   |   80 +
2062  include/litmus/bheap.h                      |   77 +
2063  include/litmus/binheap.h                    |  207 ++
2064  include/litmus/budget.h                     |    8 +
2065  include/litmus/clustered.h                  |   44 +
2066  include/litmus/debug_trace.h                |   37 +
2067  include/litmus/edf_common.h                 |   37 +
2068  include/litmus/fdso.h                       |   83 +
2069  include/litmus/feather_buffer.h             |   94 +
2070  include/litmus/feather_trace.h              |   65 +
2071  include/litmus/fpmath.h                     |  145 ++
2072  include/litmus/ftdev.h                      |   55 +
2073  include/litmus/gpu_affinity.h               |   49 +
2074  include/litmus/ikglp_lock.h                 |  160 ++
2075  include/litmus/jobs.h                       |    9 +
2076  include/litmus/kexclu_affinity.h            |   35 +
2077  include/litmus/kfmlp_lock.h                 |   97 +
2078  include/litmus/litmus.h                     |  282 +++
2079  include/litmus/litmus_proc.h                |   25 +
2080  include/litmus/litmus_softirq.h             |  199 ++
2081  include/litmus/locking.h                    |  160 ++
2082  include/litmus/nvidia_info.h                |   46 +
2083  include/litmus/preempt.h                    |  164 ++
2084  include/litmus/rsm_lock.h                   |   54 +
2085  include/litmus/rt_domain.h                  |  182 ++
2086  include/litmus/rt_param.h                   |  307 +++
2087  include/litmus/sched_plugin.h               |  183 ++
2088  include/litmus/sched_trace.h                |  380 ++++
2089  include/litmus/sched_trace_external.h       |   78 +
2090  include/litmus/srp.h                        |   28 +
2091  include/litmus/trace.h                      |  148 ++
2092  include/litmus/trace_irq.h                  |   21 +
2093  include/litmus/unistd_32.h                  |   24 +
2094  include/litmus/unistd_64.h                  |   40 +
2095  kernel/exit.c                               |    4 +
2096  kernel/fork.c                               |    7 +
2097  kernel/hrtimer.c                            |   95 +
2098  kernel/lockdep.c                            |    7 +-
2099  kernel/mutex.c                              |  125 ++
2100  kernel/printk.c                             |   14 +-
2101  kernel/sched.c                              |  164 +-
2102  kernel/sched_fair.c                         |    3 +
2103  kernel/sched_rt.c                           |    2 +-
2104  kernel/semaphore.c                          |   13 +-
2105  kernel/softirq.c                            |  322 ++-
2106  kernel/time/tick-sched.c                    |   47 +
2107  kernel/workqueue.c                          |   71 +-
2108  litmus/Kconfig                              |  364 ++++
2109  litmus/Makefile                             |   38 +
2110  litmus/affinity.c                           |   42 +
2111  litmus/bheap.c                              |  314 +++
2112  litmus/binheap.c                            |  443 +++++
2113  litmus/budget.c                             |  111 ++
2114  litmus/clustered.c                          |  111 ++
2115  litmus/ctrldev.c                            |  150 ++
2116  litmus/edf_common.c                         |  211 ++
2117  litmus/fdso.c                               |  306 +++
2118  litmus/ft_event.c                           |   43 +
2119  litmus/ftdev.c                              |  439 +++++
2120  litmus/gpu_affinity.c                       |  113 ++
2121  litmus/ikglp_lock.c                         | 2838 +++++++++++++++++++++++++++
2122  litmus/jobs.c                               |   56 +
2123  litmus/kexclu_affinity.c                    |   92 +
2124  litmus/kfmlp_lock.c                         | 1002 ++++++++++
2125  litmus/litmus.c                             |  684 +++++++
2126  litmus/litmus_pai_softirq.c                 |   64 +
2127  litmus/litmus_proc.c                        |  364 ++++
2128  litmus/litmus_softirq.c                     | 1582 +++++++++++++++
2129  litmus/locking.c                            |  524 +++++
2130  litmus/nvidia_info.c                        |  597 ++++++
2131  litmus/preempt.c                            |  138 ++
2132  litmus/rsm_lock.c                           |  796 ++++++++
2133  litmus/rt_domain.c                          |  357 ++++
2134  litmus/sched_cedf.c                         | 1849 +++++++++++++++++
2135  litmus/sched_gsn_edf.c                      | 1862 ++++++++++++++++++
2136  litmus/sched_litmus.c                       |  327 +++
2137  litmus/sched_pfair.c                        | 1067 ++++++++++
2138  litmus/sched_plugin.c                       |  360 ++++
2139  litmus/sched_psn_edf.c                      |  645 ++++++
2140  litmus/sched_task_trace.c                   |  509 +++++
2141  litmus/sched_trace.c                        |  252 +++
2142  litmus/sched_trace_external.c               |   64 +
2143  litmus/srp.c                                |  295 +++
2144  litmus/sync.c                               |  104 +
2145  litmus/trace.c                              |  225 +++
2146  123 files changed, 24316 insertions(+), 97 deletions(-)
2147  create mode 100644 arch/x86/include/asm/feather_trace.h
2148  create mode 100644 arch/x86/include/asm/feather_trace_32.h
2149  create mode 100644 arch/x86/include/asm/feather_trace_64.h
2150  create mode 100644 arch/x86/kernel/ft_event.c
2151  create mode 100644 include/litmus/affinity.h
2152  create mode 100644 include/litmus/bheap.h
2153  create mode 100644 include/litmus/binheap.h
2154  create mode 100644 include/litmus/budget.h
2155  create mode 100644 include/litmus/clustered.h
2156  create mode 100644 include/litmus/debug_trace.h
2157  create mode 100644 include/litmus/edf_common.h
2158  create mode 100644 include/litmus/fdso.h
2159  create mode 100644 include/litmus/feather_buffer.h
2160  create mode 100644 include/litmus/feather_trace.h
2161  create mode 100644 include/litmus/fpmath.h
2162  create mode 100644 include/litmus/ftdev.h
2163  create mode 100644 include/litmus/gpu_affinity.h
2164  create mode 100644 include/litmus/ikglp_lock.h
2165  create mode 100644 include/litmus/jobs.h
2166  create mode 100644 include/litmus/kexclu_affinity.h
2167  create mode 100644 include/litmus/kfmlp_lock.h
2168  create mode 100644 include/litmus/litmus.h
2169  create mode 100644 include/litmus/litmus_proc.h
2170  create mode 100644 include/litmus/litmus_softirq.h
2171  create mode 100644 include/litmus/locking.h
2172  create mode 100644 include/litmus/nvidia_info.h
2173  create mode 100644 include/litmus/preempt.h
2174  create mode 100644 include/litmus/rsm_lock.h
2175  create mode 100644 include/litmus/rt_domain.h
2176  create mode 100644 include/litmus/rt_param.h
2177  create mode 100644 include/litmus/sched_plugin.h
2178  create mode 100644 include/litmus/sched_trace.h
2179  create mode 100644 include/litmus/sched_trace_external.h
2180  create mode 100644 include/litmus/srp.h
2181  create mode 100644 include/litmus/trace.h
2182  create mode 100644 include/litmus/trace_irq.h
2183  create mode 100644 include/litmus/unistd_32.h
2184  create mode 100644 include/litmus/unistd_64.h
2185  create mode 100644 litmus/Kconfig
2186  create mode 100644 litmus/Makefile
2187  create mode 100644 litmus/affinity.c
2188  create mode 100644 litmus/bheap.c
2189  create mode 100644 litmus/binheap.c
2190  create mode 100644 litmus/budget.c
2191  create mode 100644 litmus/clustered.c
2192  create mode 100644 litmus/ctrldev.c
2193  create mode 100644 litmus/edf_common.c
2194  create mode 100644 litmus/fdso.c
2195  create mode 100644 litmus/ft_event.c
2196  create mode 100644 litmus/ftdev.c
2197  create mode 100644 litmus/gpu_affinity.c
2198  create mode 100644 litmus/ikglp_lock.c
2199  create mode 100644 litmus/jobs.c
2200  create mode 100644 litmus/kexclu_affinity.c
2201  create mode 100644 litmus/kfmlp_lock.c
2202  create mode 100644 litmus/litmus.c
2203  create mode 100644 litmus/litmus_pai_softirq.c
2204  create mode 100644 litmus/litmus_proc.c
2205  create mode 100644 litmus/litmus_softirq.c
2206  create mode 100644 litmus/locking.c
2207  create mode 100644 litmus/nvidia_info.c
2208  create mode 100644 litmus/preempt.c
2209  create mode 100644 litmus/rsm_lock.c
2210  create mode 100644 litmus/rt_domain.c
2211  create mode 100644 litmus/sched_cedf.c
2212  create mode 100644 litmus/sched_gsn_edf.c
2213  create mode 100644 litmus/sched_litmus.c
2214  create mode 100644 litmus/sched_pfair.c
2215  create mode 100644 litmus/sched_plugin.c
2216  create mode 100644 litmus/sched_psn_edf.c
2217  create mode 100644 litmus/sched_task_trace.c
2218  create mode 100644 litmus/sched_trace.c
2219  create mode 100644 litmus/sched_trace_external.c
2220  create mode 100644 litmus/srp.c
2221  create mode 100644 litmus/sync.c
2222  create mode 100644 litmus/trace.c
2223 
2224 diff --git a/Makefile b/Makefile
2225 index 6a5bdad..a327725 100644
2226 --- a/Makefile
2227 +++ b/Makefile
2228 @@ -1,7 +1,7 @@
2229  VERSION = 3
2230  PATCHLEVEL = 0
2231  SUBLEVEL = 0
2232 -EXTRAVERSION =
2233 +EXTRAVERSION =-litmus
2234  NAME = Sneaky Weasel
2235  
2236  # *DOCUMENTATION*
2237 @@ -708,7 +708,7 @@ export mod_strip_cmd
2238  
2239  
2240  ifeq ($(KBUILD_EXTMOD),)
2241 -core-y		+= kernel/ mm/ fs/ ipc/ security/ crypto/ block/
2242 +core-y		+= kernel/ mm/ fs/ ipc/ security/ crypto/ block/ litmus/
2243  
2244  vmlinux-dirs	:= $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
2245  		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
2246 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
2247 index 9adc278..fb228ea 100644
2248 --- a/arch/arm/Kconfig
2249 +++ b/arch/arm/Kconfig
2250 @@ -2040,3 +2040,11 @@ source "security/Kconfig"
2251  source "crypto/Kconfig"
2252  
2253  source "lib/Kconfig"
2254 +
2255 +config ARCH_HAS_SEND_PULL_TIMERS
2256 +	def_bool n
2257 +
2258 +config ARCH_HAS_FEATHER_TRACE
2259 +	def_bool n
2260 +
2261 +source "litmus/Kconfig"
2262 diff --git a/arch/arm/include/asm/timex.h b/arch/arm/include/asm/timex.h
2263 index 3be8de3..8a102a3 100644
2264 --- a/arch/arm/include/asm/timex.h
2265 +++ b/arch/arm/include/asm/timex.h
2266 @@ -16,9 +16,11 @@
2267  
2268  typedef unsigned long cycles_t;
2269  
2270 +#ifndef get_cycles
2271  static inline cycles_t get_cycles (void)
2272  {
2273  	return 0;
2274  }
2275 +#endif
2276  
2277  #endif
2278 diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
2279 index 2c04ed5..0196edf 100644
2280 --- a/arch/arm/include/asm/unistd.h
2281 +++ b/arch/arm/include/asm/unistd.h
2282 @@ -403,6 +403,9 @@
2283  #define __NR_sendmmsg			(__NR_SYSCALL_BASE+374)
2284  #define __NR_setns			(__NR_SYSCALL_BASE+375)
2285  
2286 +#define __NR_LITMUS (__NR_SYSCALL_BASE+376)
2287 +#include <litmus/unistd_32.h>
2288 +
2289  /*
2290   * The following SWIs are ARM private.
2291   */
2292 diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
2293 index 80f7896..ed2ae93 100644
2294 --- a/arch/arm/kernel/calls.S
2295 +++ b/arch/arm/kernel/calls.S
2296 @@ -385,6 +385,18 @@
2297  		CALL(sys_syncfs)
2298  		CALL(sys_sendmmsg)
2299  /* 375 */	CALL(sys_setns)
2300 +		CALL(sys_set_rt_task_param)
2301 +		CALL(sys_get_rt_task_param)
2302 +		CALL(sys_complete_job)
2303 +		CALL(sys_od_open)
2304 +/* 380 */	CALL(sys_od_close)
2305 +		CALL(sys_litmus_lock)
2306 +		CALL(sys_litmus_unlock)
2307 +		CALL(sys_query_job_no)
2308 +		CALL(sys_wait_for_job_release)
2309 +/* 385 */	CALL(sys_wait_for_ts_release)
2310 +		CALL(sys_release_ts)
2311 +		CALL(sys_null_call)
2312  #ifndef syscalls_counted
2313  .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
2314  #define syscalls_counted
2315 diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
2316 index e7f92a4..5a57429 100644
2317 --- a/arch/arm/kernel/smp.c
2318 +++ b/arch/arm/kernel/smp.c
2319 @@ -40,6 +40,8 @@
2320  #include <asm/ptrace.h>
2321  #include <asm/localtimer.h>
2322  
2323 +#include <litmus/preempt.h>
2324 +
2325  /*
2326   * as from 2.5, kernels no longer have an init_tasks structure
2327   * so we need some other way of telling a new secondary core
2328 @@ -572,6 +574,8 @@ asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs)
2329  		break;
2330  
2331  	case IPI_RESCHEDULE:
2332 +		/* LITMUS^RT: take action based on scheduler state */
2333 +		sched_state_ipi();
2334  		scheduler_ipi();
2335  		break;
2336  
2337 diff --git a/arch/arm/mach-realview/include/mach/timex.h b/arch/arm/mach-realview/include/mach/timex.h
2338 index 4eeb069..e8bcc40 100644
2339 --- a/arch/arm/mach-realview/include/mach/timex.h
2340 +++ b/arch/arm/mach-realview/include/mach/timex.h
2341 @@ -21,3 +21,30 @@
2342   */
2343  
2344  #define CLOCK_TICK_RATE		(50000000 / 16)
2345 +
2346 +#if defined(CONFIG_MACH_REALVIEW_PB11MP) || defined(CONFIG_MACH_REALVIEW_PB1176)
2347 +
2348 +static inline unsigned long realview_get_arm11_cp15_ccnt(void)
2349 +{
2350 +	unsigned long cycles;
2351 +	/* Read CP15 CCNT register. */
2352 +	asm volatile ("mrc p15, 0, %0, c15, c12, 1" : "=r" (cycles));
2353 +	return cycles;
2354 +}
2355 +
2356 +#define get_cycles realview_get_arm11_cp15_ccnt
2357 +
2358 +#elif defined(CONFIG_MACH_REALVIEW_PBA8)
2359 +
2360 +
2361 +static inline unsigned long realview_get_a8_cp15_ccnt(void)
2362 +{
2363 +	unsigned long cycles;
2364 +	/* Read CP15 CCNT register. */
2365 +	asm volatile ("mrc p15, 0, %0, c9, c13, 0" : "=r" (cycles));
2366 +	return cycles;
2367 +}
2368 +
2369 +#define get_cycles realview_get_a8_cp15_ccnt
2370 +
2371 +#endif
2372 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
2373 index 37357a5..9f5e143 100644
2374 --- a/arch/x86/Kconfig
2375 +++ b/arch/x86/Kconfig
2376 @@ -2166,3 +2166,11 @@ source "crypto/Kconfig"
2377  source "arch/x86/kvm/Kconfig"
2378  
2379  source "lib/Kconfig"
2380 +
2381 +config ARCH_HAS_FEATHER_TRACE
2382 +	def_bool y
2383 +
2384 +config ARCH_HAS_SEND_PULL_TIMERS
2385 +	def_bool y
2386 +
2387 +source "litmus/Kconfig"
2388 diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
2389 index 1cd6d26..3b0d7ef 100644
2390 --- a/arch/x86/include/asm/entry_arch.h
2391 +++ b/arch/x86/include/asm/entry_arch.h
2392 @@ -13,6 +13,7 @@
2393  BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR)
2394  BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR)
2395  BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR)
2396 +BUILD_INTERRUPT(pull_timers_interrupt,PULL_TIMERS_VECTOR)
2397  BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR)
2398  BUILD_INTERRUPT(reboot_interrupt,REBOOT_VECTOR)
2399  
2400 diff --git a/arch/x86/include/asm/feather_trace.h b/arch/x86/include/asm/feather_trace.h
2401 new file mode 100644
2402 index 0000000..4fd3163
2403 --- /dev/null
2404 +++ b/arch/x86/include/asm/feather_trace.h
2405 @@ -0,0 +1,17 @@
2406 +#ifndef _ARCH_FEATHER_TRACE_H
2407 +#define _ARCH_FEATHER_TRACE_H
2408 +
2409 +#include <asm/msr.h>
2410 +
2411 +static inline unsigned long long ft_timestamp(void)
2412 +{
2413 +	return __native_read_tsc();
2414 +}
2415 +
2416 +#ifdef CONFIG_X86_32
2417 +#include "feather_trace_32.h"
2418 +#else
2419 +#include "feather_trace_64.h"
2420 +#endif
2421 +
2422 +#endif
2423 diff --git a/arch/x86/include/asm/feather_trace_32.h b/arch/x86/include/asm/feather_trace_32.h
2424 new file mode 100644
2425 index 0000000..70202f9
2426 --- /dev/null
2427 +++ b/arch/x86/include/asm/feather_trace_32.h
2428 @@ -0,0 +1,79 @@
2429 +/* Do not directly include this file. Include feather_trace.h instead */
2430 +
2431 +#define feather_callback __attribute__((regparm(0)))
2432 +
2433 +/*
2434 + * make the compiler reload any register that is not saved in
2435 + * a cdecl function call
2436 + */
2437 +#define CLOBBER_LIST "memory", "cc", "eax", "ecx", "edx"
2438 +
2439 +#define ft_event(id, callback)                                  \
2440 +        __asm__ __volatile__(                                   \
2441 +            "1: jmp 2f                                    \n\t" \
2442 +	    " call " #callback "                          \n\t" \
2443 +            ".section __event_table, \"aw\"               \n\t" \
2444 +            ".long " #id  ", 0, 1b, 2f                    \n\t" \
2445 +            ".previous                                    \n\t" \
2446 +            "2:                                           \n\t" \
2447 +        : : : CLOBBER_LIST)
2448 +
2449 +#define ft_event0(id, callback)                                 \
2450 +        __asm__ __volatile__(                                   \
2451 +            "1: jmp 2f                                    \n\t" \
2452 +	    " subl $4, %%esp                              \n\t" \
2453 +            " movl $" #id  ", (%%esp)                     \n\t" \
2454 +	    " call " #callback "                          \n\t" \
2455 +	    " addl $4, %%esp                              \n\t" \
2456 +            ".section __event_table, \"aw\"               \n\t" \
2457 +            ".long " #id  ", 0, 1b, 2f                    \n\t" \
2458 +            ".previous                                    \n\t" \
2459 +            "2:                                           \n\t" \
2460 +        : :  : CLOBBER_LIST)
2461 +
2462 +#define ft_event1(id, callback, param)                          \
2463 +        __asm__ __volatile__(                                   \
2464 +            "1: jmp 2f                                    \n\t" \
2465 +	    " subl $8, %%esp                              \n\t" \
2466 +	    " movl %0, 4(%%esp)                           \n\t" \
2467 +            " movl $" #id  ", (%%esp)                     \n\t" \
2468 +	    " call " #callback "                          \n\t" \
2469 +	    " addl $8, %%esp                              \n\t" \
2470 +            ".section __event_table, \"aw\"               \n\t" \
2471 +            ".long " #id  ", 0, 1b, 2f                    \n\t" \
2472 +            ".previous                                    \n\t" \
2473 +            "2:                                           \n\t" \
2474 +        : : "r" (param)  : CLOBBER_LIST)
2475 +
2476 +#define ft_event2(id, callback, param, param2)                  \
2477 +        __asm__ __volatile__(                                   \
2478 +            "1: jmp 2f                                    \n\t" \
2479 +	    " subl $12, %%esp                             \n\t" \
2480 +	    " movl %1, 8(%%esp)                           \n\t" \
2481 +	    " movl %0, 4(%%esp)                           \n\t" \
2482 +            " movl $" #id  ", (%%esp)                     \n\t" \
2483 +	    " call " #callback "                          \n\t" \
2484 +	    " addl $12, %%esp                             \n\t" \
2485 +            ".section __event_table, \"aw\"               \n\t" \
2486 +            ".long " #id  ", 0, 1b, 2f                    \n\t" \
2487 +            ".previous                                    \n\t" \
2488 +            "2:                                           \n\t" \
2489 +        : : "r" (param), "r" (param2)  : CLOBBER_LIST)
2490 +
2491 +
2492 +#define ft_event3(id, callback, p, p2, p3)                      \
2493 +        __asm__ __volatile__(                                   \
2494 +            "1: jmp 2f                                    \n\t" \
2495 +	    " subl $16, %%esp                             \n\t" \
2496 +	    " movl %2, 12(%%esp)                          \n\t" \
2497 +	    " movl %1, 8(%%esp)                           \n\t" \
2498 +	    " movl %0, 4(%%esp)                           \n\t" \
2499 +            " movl $" #id  ", (%%esp)                     \n\t" \
2500 +	    " call " #callback "                          \n\t" \
2501 +	    " addl $16, %%esp                             \n\t" \
2502 +            ".section __event_table, \"aw\"               \n\t" \
2503 +            ".long " #id  ", 0, 1b, 2f                    \n\t" \
2504 +            ".previous                                    \n\t" \
2505 +            "2:                                           \n\t" \
2506 +        : : "r" (p), "r" (p2), "r" (p3)  : CLOBBER_LIST)
2507 +
2508 diff --git a/arch/x86/include/asm/feather_trace_64.h b/arch/x86/include/asm/feather_trace_64.h
2509 new file mode 100644
2510 index 0000000..54ac2ae
2511 --- /dev/null
2512 +++ b/arch/x86/include/asm/feather_trace_64.h
2513 @@ -0,0 +1,67 @@
2514 +/* Do not directly include this file. Include feather_trace.h instead */
2515 +
2516 +/* regparm is the default on x86_64 */
2517 +#define feather_callback
2518 +
2519 +# define _EVENT_TABLE(id,from,to) \
2520 +            ".section __event_table, \"aw\"\n\t" \
2521 +	    ".balign 8\n\t" \
2522 +            ".quad " #id  ", 0, " #from ", " #to " \n\t" \
2523 +            ".previous \n\t"
2524 +
2525 +/*
2526 + * x86_64 callee only owns rbp, rbx, r12 -> r15
2527 + * the called can freely modify the others
2528 + */
2529 +#define CLOBBER_LIST	"memory", "cc", "rdi", "rsi", "rdx", "rcx", \
2530 +			"r8", "r9", "r10", "r11", "rax"
2531 +
2532 +#define ft_event(id, callback)                                  \
2533 +        __asm__ __volatile__(                                   \
2534 +            "1: jmp 2f                                    \n\t" \
2535 +	    " call " #callback "                          \n\t" \
2536 +            _EVENT_TABLE(id,1b,2f) \
2537 +            "2:                                           \n\t" \
2538 +        : : : CLOBBER_LIST)
2539 +
2540 +#define ft_event0(id, callback)                                 \
2541 +        __asm__ __volatile__(                                   \
2542 +            "1: jmp 2f                                    \n\t" \
2543 +	    " movq $" #id ", %%rdi			  \n\t" \
2544 +	    " call " #callback "                          \n\t" \
2545 +	    _EVENT_TABLE(id,1b,2f) \
2546 +            "2:                                           \n\t" \
2547 +        : :  : CLOBBER_LIST)
2548 +
2549 +#define ft_event1(id, callback, param)                          \
2550 +	__asm__ __volatile__(                                   \
2551 +	    "1: jmp 2f                                    \n\t" \
2552 +	    " movq %0, %%rsi				  \n\t"	\
2553 +	    " movq $" #id ", %%rdi			  \n\t" \
2554 +	    " call " #callback "                          \n\t" \
2555 +	    _EVENT_TABLE(id,1b,2f) \
2556 +	    "2:                                           \n\t" \
2557 +	: : "r" (param)  : CLOBBER_LIST)
2558 +
2559 +#define ft_event2(id, callback, param, param2)                  \
2560 +        __asm__ __volatile__(                                   \
2561 +            "1: jmp 2f                                    \n\t" \
2562 +	    " movq %1, %%rdx				  \n\t"	\
2563 +	    " movq %0, %%rsi				  \n\t"	\
2564 +	    " movq $" #id ", %%rdi			  \n\t" \
2565 +	    " call " #callback "                          \n\t" \
2566 +            _EVENT_TABLE(id,1b,2f) \
2567 +            "2:                                           \n\t" \
2568 +        : : "r" (param), "r" (param2)  : CLOBBER_LIST)
2569 +
2570 +#define ft_event3(id, callback, p, p2, p3)                      \
2571 +        __asm__ __volatile__(                                   \
2572 +            "1: jmp 2f                                    \n\t" \
2573 +	    " movq %2, %%rcx				  \n\t"	\
2574 +	    " movq %1, %%rdx				  \n\t"	\
2575 +	    " movq %0, %%rsi				  \n\t"	\
2576 +	    " movq $" #id ", %%rdi			  \n\t" \
2577 +	    " call " #callback "                          \n\t" \
2578 +            _EVENT_TABLE(id,1b,2f) \
2579 +            "2:                                           \n\t" \
2580 +        : : "r" (p), "r" (p2), "r" (p3)  : CLOBBER_LIST)
2581 diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
2582 index bb9efe8..c490d89 100644
2583 --- a/arch/x86/include/asm/hw_irq.h
2584 +++ b/arch/x86/include/asm/hw_irq.h
2585 @@ -77,6 +77,8 @@ extern void threshold_interrupt(void);
2586  extern void call_function_interrupt(void);
2587  extern void call_function_single_interrupt(void);
2588  
2589 +extern void pull_timers_interrupt(void);
2590 +
2591  /* IOAPIC */
2592  #define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1<<(x)) & io_apic_irqs))
2593  extern unsigned long io_apic_irqs;
2594 @@ -155,6 +157,7 @@ extern asmlinkage void smp_irq_move_cleanup_interrupt(void);
2595  extern void smp_reschedule_interrupt(struct pt_regs *);
2596  extern void smp_call_function_interrupt(struct pt_regs *);
2597  extern void smp_call_function_single_interrupt(struct pt_regs *);
2598 +extern void smp_pull_timers_interrupt(struct pt_regs *);
2599  #ifdef CONFIG_X86_32
2600  extern void smp_invalidate_interrupt(struct pt_regs *);
2601  #else
2602 diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
2603 index 6e976ee..99a44cf 100644
2604 --- a/arch/x86/include/asm/irq_vectors.h
2605 +++ b/arch/x86/include/asm/irq_vectors.h
2606 @@ -135,6 +135,13 @@
2607  #define INVALIDATE_TLB_VECTOR_START	\
2608  	(INVALIDATE_TLB_VECTOR_END-NUM_INVALIDATE_TLB_VECTORS+1)
2609  
2610 +/*
2611 + * LITMUS^RT pull timers IRQ vector
2612 + * Make sure it's below the above max 32 vectors.
2613 + */
2614 +#define PULL_TIMERS_VECTOR		0xce
2615 +
2616 +
2617  #define NR_VECTORS			 256
2618  
2619  #define FPU_IRQ				  13
2620 diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
2621 index 2193715..b844edc 100644
2622 --- a/arch/x86/include/asm/processor.h
2623 +++ b/arch/x86/include/asm/processor.h
2624 @@ -166,6 +166,10 @@ extern void print_cpu_info(struct cpuinfo_x86 *);
2625  extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
2626  extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
2627  extern unsigned short num_cache_leaves;
2628 +#ifdef CONFIG_SYSFS
2629 +extern int get_shared_cpu_map(cpumask_var_t mask,
2630 +			       unsigned int cpu, int index);
2631 +#endif
2632  
2633  extern void detect_extended_topology(struct cpuinfo_x86 *c);
2634  extern void detect_ht(struct cpuinfo_x86 *c);
2635 diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h
2636 index 593485b..2f6e127 100644
2637 --- a/arch/x86/include/asm/unistd_32.h
2638 +++ b/arch/x86/include/asm/unistd_32.h
2639 @@ -353,9 +353,13 @@
2640  #define __NR_sendmmsg		345
2641  #define __NR_setns		346
2642  
2643 +#define __NR_LITMUS		347
2644 +
2645 +#include "litmus/unistd_32.h"
2646 +
2647  #ifdef __KERNEL__
2648  
2649 -#define NR_syscalls 347
2650 +#define NR_syscalls 347 + NR_litmus_syscalls
2651  
2652  #define __ARCH_WANT_IPC_PARSE_VERSION
2653  #define __ARCH_WANT_OLD_READDIR
2654 diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h
2655 index 705bf13..e347f07 100644
2656 --- a/arch/x86/include/asm/unistd_64.h
2657 +++ b/arch/x86/include/asm/unistd_64.h
2658 @@ -682,6 +682,10 @@ __SYSCALL(__NR_sendmmsg, sys_sendmmsg)
2659  #define __NR_setns				308
2660  __SYSCALL(__NR_setns, sys_setns)
2661  
2662 +#define __NR_LITMUS				309
2663 +
2664 +#include "litmus/unistd_64.h"
2665 +
2666  #ifndef __NO_STUBS
2667  #define __ARCH_WANT_OLD_READDIR
2668  #define __ARCH_WANT_OLD_STAT
2669 diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
2670 index 90b06d4..d727f8f 100644
2671 --- a/arch/x86/kernel/Makefile
2672 +++ b/arch/x86/kernel/Makefile
2673 @@ -116,6 +116,8 @@ obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
2674  obj-$(CONFIG_SWIOTLB)			+= pci-swiotlb.o
2675  obj-$(CONFIG_OF)			+= devicetree.o
2676  
2677 +obj-$(CONFIG_FEATHER_TRACE)	+= ft_event.o
2678 +
2679  ###
2680  # 64 bit specific files
2681  ifeq ($(CONFIG_X86_64),y)
2682 diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
2683 index c105c53..0bf1264 100644
2684 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c
2685 +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
2686 @@ -747,6 +747,23 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
2687  static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info);
2688  #define CPUID4_INFO_IDX(x, y)	(&((per_cpu(ici_cpuid4_info, x))[y]))
2689  
2690 +/* returns CPUs that share the index cache with cpu */
2691 +int get_shared_cpu_map(cpumask_var_t mask, unsigned int cpu, int index)
2692 +{
2693 +	int ret = 0;
2694 +	struct _cpuid4_info *this_leaf;
2695 +
2696 +	if (index >= num_cache_leaves) {
2697 +		index = num_cache_leaves - 1;
2698 +		ret = index;
2699 +	}
2700 +
2701 +	this_leaf = CPUID4_INFO_IDX(cpu,index);
2702 +	cpumask_copy(mask, to_cpumask(this_leaf->shared_cpu_map));
2703 +
2704 +	return ret;
2705 +}
2706 +
2707  #ifdef CONFIG_SMP
2708  static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
2709  {
2710 diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
2711 index 8a445a0..47a4bcd 100644
2712 --- a/arch/x86/kernel/entry_64.S
2713 +++ b/arch/x86/kernel/entry_64.S
2714 @@ -1003,6 +1003,8 @@ apicinterrupt CALL_FUNCTION_VECTOR \
2715  	call_function_interrupt smp_call_function_interrupt
2716  apicinterrupt RESCHEDULE_VECTOR \
2717  	reschedule_interrupt smp_reschedule_interrupt
2718 +apicinterrupt PULL_TIMERS_VECTOR \
2719 +	pull_timers_interrupt smp_pull_timers_interrupt
2720  #endif
2721  
2722  apicinterrupt ERROR_APIC_VECTOR \
2723 diff --git a/arch/x86/kernel/ft_event.c b/arch/x86/kernel/ft_event.c
2724 new file mode 100644
2725 index 0000000..37cc332
2726 --- /dev/null
2727 +++ b/arch/x86/kernel/ft_event.c
2728 @@ -0,0 +1,118 @@
2729 +#include <linux/types.h>
2730 +
2731 +#include <litmus/feather_trace.h>
2732 +
2733 +/* the feather trace management functions assume
2734 + * exclusive access to the event table
2735 + */
2736 +
2737 +#ifndef CONFIG_DEBUG_RODATA
2738 +
2739 +#define BYTE_JUMP      0xeb
2740 +#define BYTE_JUMP_LEN  0x02
2741 +
2742 +/* for each event, there is an entry in the event table */
2743 +struct trace_event {
2744 +	long 	id;
2745 +	long	count;
2746 +	long	start_addr;
2747 +	long	end_addr;
2748 +};
2749 +
2750 +extern struct trace_event  __start___event_table[];
2751 +extern struct trace_event  __stop___event_table[];
2752 +
2753 +/* Workaround: if no events are defined, then the event_table section does not
2754 + * exist and the above references cause linker errors. This could probably be
2755 + * fixed by adjusting the linker script, but it is easier to maintain for us if
2756 + * we simply create a dummy symbol in the event table section.
2757 + */
2758 +int __event_table_dummy[0] __attribute__ ((section("__event_table")));
2759 +
2760 +int ft_enable_event(unsigned long id)
2761 +{
2762 +	struct trace_event* te = __start___event_table;
2763 +	int count = 0;
2764 +	char* delta;
2765 +	unsigned char* instr;
2766 +
2767 +	while (te < __stop___event_table) {
2768 +		if (te->id == id && ++te->count == 1) {
2769 +			instr  = (unsigned char*) te->start_addr;
2770 +			/* make sure we don't clobber something wrong */
2771 +			if (*instr == BYTE_JUMP) {
2772 +				delta  = (((unsigned char*) te->start_addr) + 1);
2773 +				*delta = 0;
2774 +			}
2775 +		}
2776 +		if (te->id == id)
2777 +			count++;
2778 +		te++;
2779 +	}
2780 +
2781 +	printk(KERN_DEBUG "ft_enable_event: enabled %d events\n", count);
2782 +	return count;
2783 +}
2784 +
2785 +int ft_disable_event(unsigned long id)
2786 +{
2787 +	struct trace_event* te = __start___event_table;
2788 +	int count = 0;
2789 +	char* delta;
2790 +	unsigned char* instr;
2791 +
2792 +	while (te < __stop___event_table) {
2793 +		if (te->id == id && --te->count == 0) {
2794 +			instr  = (unsigned char*) te->start_addr;
2795 +			if (*instr == BYTE_JUMP) {
2796 +				delta  = (((unsigned char*) te->start_addr) + 1);
2797 +				*delta = te->end_addr - te->start_addr -
2798 +					BYTE_JUMP_LEN;
2799 +			}
2800 +		}
2801 +		if (te->id == id)
2802 +			count++;
2803 +		te++;
2804 +	}
2805 +
2806 +	printk(KERN_DEBUG "ft_disable_event: disabled %d events\n", count);
2807 +	return count;
2808 +}
2809 +
2810 +int ft_disable_all_events(void)
2811 +{
2812 +	struct trace_event* te = __start___event_table;
2813 +	int count = 0;
2814 +	char* delta;
2815 +	unsigned char* instr;
2816 +
2817 +	while (te < __stop___event_table) {
2818 +		if (te->count) {
2819 +			instr  = (unsigned char*) te->start_addr;
2820 +			if (*instr == BYTE_JUMP) {
2821 +				delta  = (((unsigned char*) te->start_addr)
2822 +					  + 1);
2823 +				*delta = te->end_addr - te->start_addr -
2824 +					BYTE_JUMP_LEN;
2825 +				te->count = 0;
2826 +				count++;
2827 +			}
2828 +		}
2829 +		te++;
2830 +	}
2831 +	return count;
2832 +}
2833 +
2834 +int ft_is_event_enabled(unsigned long id)
2835 +{
2836 +	struct trace_event* te = __start___event_table;
2837 +
2838 +	while (te < __stop___event_table) {
2839 +		if (te->id == id)
2840 +			return te->count;
2841 +		te++;
2842 +	}
2843 +	return 0;
2844 +}
2845 +
2846 +#endif
2847 diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
2848 index 6c0802e..680a5cb 100644
2849 --- a/arch/x86/kernel/irq.c
2850 +++ b/arch/x86/kernel/irq.c
2851 @@ -10,6 +10,10 @@
2852  #include <linux/ftrace.h>
2853  #include <linux/delay.h>
2854  
2855 +#ifdef CONFIG_LITMUS_NVIDIA
2856 +#include <litmus/sched_trace.h>
2857 +#endif
2858 +
2859  #include <asm/apic.h>
2860  #include <asm/io_apic.h>
2861  #include <asm/irq.h>
2862 diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
2863 index f470e4e..48acf71 100644
2864 --- a/arch/x86/kernel/irqinit.c
2865 +++ b/arch/x86/kernel/irqinit.c
2866 @@ -252,6 +252,9 @@ static void __init smp_intr_init(void)
2867  	alloc_intr_gate(CALL_FUNCTION_SINGLE_VECTOR,
2868  			call_function_single_interrupt);
2869  
2870 +	/* IPI for hrtimer pulling on remote cpus */
2871 +	alloc_intr_gate(PULL_TIMERS_VECTOR, pull_timers_interrupt);
2872 +
2873  	/* Low priority IPI to cleanup after moving an irq */
2874  	set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
2875  	set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors);
2876 diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
2877 index 013e7eb..ed4c4f5 100644
2878 --- a/arch/x86/kernel/smp.c
2879 +++ b/arch/x86/kernel/smp.c
2880 @@ -23,6 +23,10 @@
2881  #include <linux/cpu.h>
2882  #include <linux/gfp.h>
2883  
2884 +#include <litmus/preempt.h>
2885 +#include <litmus/debug_trace.h>
2886 +#include <litmus/trace.h>
2887 +
2888  #include <asm/mtrr.h>
2889  #include <asm/tlbflush.h>
2890  #include <asm/mmu_context.h>
2891 @@ -118,6 +122,7 @@ static void native_smp_send_reschedule(int cpu)
2892  		WARN_ON(1);
2893  		return;
2894  	}
2895 +	TS_SEND_RESCHED_START(cpu);
2896  	apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR);
2897  }
2898  
2899 @@ -147,6 +152,16 @@ void native_send_call_func_ipi(const struct cpumask *mask)
2900  	free_cpumask_var(allbutself);
2901  }
2902  
2903 +/* trigger timers on remote cpu */
2904 +void smp_send_pull_timers(int cpu)
2905 +{
2906 +	if (unlikely(cpu_is_offline(cpu))) {
2907 +		WARN_ON(1);
2908 +		return;
2909 +	}
2910 +	apic->send_IPI_mask(cpumask_of(cpu), PULL_TIMERS_VECTOR);
2911 +}
2912 +
2913  /*
2914   * this function calls the 'stop' function on all other CPUs in the system.
2915   */
2916 @@ -199,8 +214,15 @@ static void native_stop_other_cpus(int wait)
2917  void smp_reschedule_interrupt(struct pt_regs *regs)
2918  {
2919  	ack_APIC_irq();
2920 +	/* LITMUS^RT: this IPI might need to trigger the sched state machine. */
2921 +	sched_state_ipi();
2922  	inc_irq_stat(irq_resched_count);
2923 +	/*
2924 +	 * LITMUS^RT: starting from 3.0 schedule_ipi() actually does something.
2925 +	 * This may increase IPI latencies compared with previous versions.
2926 +	 */
2927  	scheduler_ipi();
2928 +	TS_SEND_RESCHED_END;
2929  	/*
2930  	 * KVM uses this interrupt to force a cpu out of guest mode
2931  	 */
2932 @@ -224,6 +246,15 @@ void smp_call_function_single_interrupt(struct pt_regs *regs)
2933  	irq_exit();
2934  }
2935  
2936 +extern void hrtimer_pull(void);
2937 +
2938 +void smp_pull_timers_interrupt(struct pt_regs *regs)
2939 +{
2940 +	ack_APIC_irq();
2941 +	TRACE("pull timer interrupt\n");
2942 +	hrtimer_pull();
2943 +}
2944 +
2945  struct smp_ops smp_ops = {
2946  	.smp_prepare_boot_cpu	= native_smp_prepare_boot_cpu,
2947  	.smp_prepare_cpus	= native_smp_prepare_cpus,
2948 diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S
2949 index fbb0a04..0cb4373 100644
2950 --- a/arch/x86/kernel/syscall_table_32.S
2951 +++ b/arch/x86/kernel/syscall_table_32.S
2952 @@ -346,3 +346,16 @@ ENTRY(sys_call_table)
2953  	.long sys_syncfs
2954  	.long sys_sendmmsg		/* 345 */
2955  	.long sys_setns
2956 +	.long sys_set_rt_task_param	/* LITMUS^RT 347 */
2957 +	.long sys_get_rt_task_param
2958 +	.long sys_complete_job
2959 +	.long sys_od_open
2960 +	.long sys_od_close
2961 +	.long sys_litmus_lock		/* +5 */
2962 +	.long sys_litmus_unlock
2963 +	.long sys_query_job_no
2964 +	.long sys_wait_for_job_release
2965 +	.long sys_wait_for_ts_release
2966 +	.long sys_release_ts		/* +10 */
2967 +	.long sys_null_call
2968 +	.long sys_register_nv_device
2969 diff --git a/fs/exec.c b/fs/exec.c
2970 index 6075a1e..9984562 100644
2971 --- a/fs/exec.c
2972 +++ b/fs/exec.c
2973 @@ -19,7 +19,7 @@
2974   * current->executable is only used by the procfs.  This allows a dispatch
2975   * table to check for several different types  of binary formats.  We keep
2976   * trying until we recognize the file or we run out of supported binary
2977 - * formats. 
2978 + * formats.
2979   */
2980  
2981  #include <linux/slab.h>
2982 @@ -56,6 +56,8 @@
2983  #include <linux/oom.h>
2984  #include <linux/compat.h>
2985  
2986 +#include <litmus/litmus.h>
2987 +
2988  #include <asm/uaccess.h>
2989  #include <asm/mmu_context.h>
2990  #include <asm/tlb.h>
2991 @@ -85,7 +87,7 @@ int __register_binfmt(struct linux_binfmt * fmt, int insert)
2992  	insert ? list_add(&fmt->lh, &formats) :
2993  		 list_add_tail(&fmt->lh, &formats);
2994  	write_unlock(&binfmt_lock);
2995 -	return 0;	
2996 +	return 0;
2997  }
2998  
2999  EXPORT_SYMBOL(__register_binfmt);
3000 @@ -1160,7 +1162,7 @@ void setup_new_exec(struct linux_binprm * bprm)
3001  	   group */
3002  
3003  	current->self_exec_id++;
3004 -			
3005 +
3006  	flush_signal_handlers(current, 0);
3007  	flush_old_files(current->files);
3008  }
3009 @@ -1250,8 +1252,8 @@ int check_unsafe_exec(struct linux_binprm *bprm)
3010  	return res;
3011  }
3012  
3013 -/* 
3014 - * Fill the binprm structure from the inode. 
3015 +/*
3016 + * Fill the binprm structure from the inode.
3017   * Check permissions, then read the first 128 (BINPRM_BUF_SIZE) bytes
3018   *
3019   * This may be called multiple times for binary chains (scripts for example).
3020 @@ -1459,6 +1461,7 @@ static int do_execve_common(const char *filename,
3021  		goto out_unmark;
3022  
3023  	sched_exec();
3024 +	litmus_exec();
3025  
3026  	bprm->file = file;
3027  	bprm->filename = filename;
3028 diff --git a/fs/inode.c b/fs/inode.c
3029 index 43566d1..dbf0e76 100644
3030 --- a/fs/inode.c
3031 +++ b/fs/inode.c
3032 @@ -308,6 +308,8 @@ void inode_init_once(struct inode *inode)
3033  #ifdef CONFIG_FSNOTIFY
3034  	INIT_HLIST_HEAD(&inode->i_fsnotify_marks);
3035  #endif
3036 +	INIT_LIST_HEAD(&inode->i_obj_list);
3037 +	mutex_init(&inode->i_obj_mutex);
3038  }
3039  EXPORT_SYMBOL(inode_init_once);
3040  
3041 diff --git a/include/linux/completion.h b/include/linux/completion.h
3042 index 51494e6..cff405c 100644
3043 --- a/include/linux/completion.h
3044 +++ b/include/linux/completion.h
3045 @@ -76,6 +76,7 @@ static inline void init_completion(struct completion *x)
3046  	init_waitqueue_head(&x->wait);
3047  }
3048  
3049 +extern void __wait_for_completion_locked(struct completion *);
3050  extern void wait_for_completion(struct completion *);
3051  extern int wait_for_completion_interruptible(struct completion *x);
3052  extern int wait_for_completion_killable(struct completion *x);
3053 @@ -90,6 +91,7 @@ extern bool completion_done(struct completion *x);
3054  
3055  extern void complete(struct completion *);
3056  extern void complete_all(struct completion *);
3057 +extern void complete_n(struct completion *, int n);
3058  
3059  /**
3060   * INIT_COMPLETION - reinitialize a completion structure
3061 diff --git a/include/linux/fs.h b/include/linux/fs.h
3062 index b5b9792..8d5834b 100644
3063 --- a/include/linux/fs.h
3064 +++ b/include/linux/fs.h
3065 @@ -17,8 +17,8 @@
3066   * nr_file rlimit, so it's safe to set up a ridiculously high absolute
3067   * upper limit on files-per-process.
3068   *
3069 - * Some programs (notably those using select()) may have to be 
3070 - * recompiled to take full advantage of the new limits..  
3071 + * Some programs (notably those using select()) may have to be
3072 + * recompiled to take full advantage of the new limits..
3073   */
3074  
3075  /* Fixed constants first: */
3076 @@ -172,7 +172,7 @@ struct inodes_stat_t {
3077  #define SEL_EX		4
3078  
3079  /* public flags for file_system_type */
3080 -#define FS_REQUIRES_DEV 1 
3081 +#define FS_REQUIRES_DEV 1
3082  #define FS_BINARY_MOUNTDATA 2
3083  #define FS_HAS_SUBTYPE 4
3084  #define FS_REVAL_DOT	16384	/* Check the paths ".", ".." for staleness */
3085 @@ -480,7 +480,7 @@ struct iattr {
3086   */
3087  #include <linux/quota.h>
3088  
3089 -/** 
3090 +/**
3091   * enum positive_aop_returns - aop return codes with specific semantics
3092   *
3093   * @AOP_WRITEPAGE_ACTIVATE: Informs the caller that page writeback has
3094 @@ -490,7 +490,7 @@ struct iattr {
3095   * 			    be a candidate for writeback again in the near
3096   * 			    future.  Other callers must be careful to unlock
3097   * 			    the page if they get this return.  Returned by
3098 - * 			    writepage(); 
3099 + * 			    writepage();
3100   *
3101   * @AOP_TRUNCATED_PAGE: The AOP method that was handed a locked page has
3102   *  			unlocked it and the page might have been truncated.
3103 @@ -734,6 +734,7 @@ static inline int mapping_writably_mapped(struct address_space *mapping)
3104  
3105  struct posix_acl;
3106  #define ACL_NOT_CACHED ((void *)(-1))
3107 +struct inode_obj_id_table;
3108  
3109  struct inode {
3110  	/* RCU path lookup touches following: */
3111 @@ -807,6 +808,8 @@ struct inode {
3112  	struct posix_acl	*i_acl;
3113  	struct posix_acl	*i_default_acl;
3114  #endif
3115 +	struct list_head	i_obj_list;
3116 +	struct mutex		i_obj_mutex;
3117  	void			*i_private; /* fs or device private pointer */
3118  };
3119  
3120 @@ -1032,10 +1035,10 @@ static inline int file_check_writeable(struct file *filp)
3121  
3122  #define	MAX_NON_LFS	((1UL<<31) - 1)
3123  
3124 -/* Page cache limit. The filesystems should put that into their s_maxbytes 
3125 -   limits, otherwise bad things can happen in VM. */ 
3126 +/* Page cache limit. The filesystems should put that into their s_maxbytes
3127 +   limits, otherwise bad things can happen in VM. */
3128  #if BITS_PER_LONG==32
3129 -#define MAX_LFS_FILESIZE	(((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) 
3130 +#define MAX_LFS_FILESIZE	(((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
3131  #elif BITS_PER_LONG==64
3132  #define MAX_LFS_FILESIZE 	0x7fffffffffffffffUL
3133  #endif
3134 @@ -2234,7 +2237,7 @@ extern void free_write_pipe(struct file *);
3135  
3136  extern int kernel_read(struct file *, loff_t, char *, unsigned long);
3137  extern struct file * open_exec(const char *);
3138 - 
3139 +
3140  /* fs/dcache.c -- generic fs support functions */
3141  extern int is_subdir(struct dentry *, struct dentry *);
3142  extern int path_is_under(struct path *, struct path *);
3143 diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
3144 index ba36217..e6dd5a4 100644
3145 --- a/include/linux/hardirq.h
3146 +++ b/include/linux/hardirq.h
3147 @@ -6,6 +6,8 @@
3148  #include <linux/ftrace_irq.h>
3149  #include <asm/hardirq.h>
3150  
3151 +#include <litmus/trace_irq.h>
3152 +
3153  /*
3154   * We put the hardirq and softirq counter into the preemption
3155   * counter. The bitmask has the following meaning:
3156 @@ -186,6 +188,7 @@ extern void rcu_nmi_exit(void);
3157  		account_system_vtime(current);		\
3158  		add_preempt_count(HARDIRQ_OFFSET);	\
3159  		trace_hardirq_enter();			\
3160 +		ft_irq_fired();				\
3161  	} while (0)
3162  
3163  /*
3164 @@ -216,6 +219,7 @@ extern void irq_exit(void);
3165  		lockdep_off();					\
3166  		rcu_nmi_enter();				\
3167  		trace_hardirq_enter();				\
3168 +		ft_irq_fired();					\
3169  	} while (0)
3170  
3171  #define nmi_exit()						\
3172 diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
3173 index fd0dc30..d91bba5 100644
3174 --- a/include/linux/hrtimer.h
3175 +++ b/include/linux/hrtimer.h
3176 @@ -174,6 +174,7 @@ enum  hrtimer_base_type {
3177   * @nr_hangs:		Total number of hrtimer interrupt hangs
3178   * @max_hang_time:	Maximum time spent in hrtimer_interrupt
3179   * @clock_base:		array of clock bases for this cpu
3180 + * @to_pull:		LITMUS^RT list of timers to be pulled on this cpu
3181   */
3182  struct hrtimer_cpu_base {
3183  	raw_spinlock_t			lock;
3184 @@ -188,8 +189,32 @@ struct hrtimer_cpu_base {
3185  	ktime_t				max_hang_time;
3186  #endif
3187  	struct hrtimer_clock_base	clock_base[HRTIMER_MAX_CLOCK_BASES];
3188 +	struct list_head		to_pull;
3189  };
3190  
3191 +#ifdef CONFIG_ARCH_HAS_SEND_PULL_TIMERS
3192 +
3193 +#define HRTIMER_START_ON_INACTIVE	0
3194 +#define HRTIMER_START_ON_QUEUED		1
3195 +
3196 +/*
3197 + * struct hrtimer_start_on_info - save timer info on remote cpu
3198 + * @list:	list of hrtimer_start_on_info on remote cpu (to_pull)
3199 + * @timer:	timer to be triggered on remote cpu
3200 + * @time:	time event
3201 + * @mode:	timer mode
3202 + * @state:	activity flag
3203 + */
3204 +struct hrtimer_start_on_info {
3205 +	struct list_head	list;
3206 +	struct hrtimer		*timer;
3207 +	ktime_t			time;
3208 +	enum hrtimer_mode	mode;
3209 +	atomic_t		state;
3210 +};
3211 +
3212 +#endif
3213 +
3214  static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
3215  {
3216  	timer->node.expires = time;
3217 @@ -355,6 +380,13 @@ __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
3218  			 unsigned long delta_ns,
3219  			 const enum hrtimer_mode mode, int wakeup);
3220  
3221 +#ifdef CONFIG_ARCH_HAS_SEND_PULL_TIMERS
3222 +extern void hrtimer_start_on_info_init(struct hrtimer_start_on_info *info);
3223 +extern int hrtimer_start_on(int cpu, struct hrtimer_start_on_info *info,
3224 +			struct hrtimer *timer, ktime_t time,
3225 +			const enum hrtimer_mode mode);
3226 +#endif
3227 +
3228  extern int hrtimer_cancel(struct hrtimer *timer);
3229  extern int hrtimer_try_to_cancel(struct hrtimer *timer);
3230  
3231 diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
3232 index f6efed0..8fb3dad 100644
3233 --- a/include/linux/interrupt.h
3234 +++ b/include/linux/interrupt.h
3235 @@ -445,6 +445,7 @@ static inline void __raise_softirq_irqoff(unsigned int nr)
3236  
3237  extern void raise_softirq_irqoff(unsigned int nr);
3238  extern void raise_softirq(unsigned int nr);
3239 +extern void wakeup_softirqd(void);
3240  
3241  /* This is the worklist that queues up per-cpu softirq work.
3242   *
3243 @@ -500,6 +501,10 @@ struct tasklet_struct
3244  	atomic_t count;
3245  	void (*func)(unsigned long);
3246  	unsigned long data;
3247 +
3248 +#if defined(CONFIG_LITMUS_SOFTIRQD) || defined(CONFIG_LITMUS_PAI_SOFTIRQD)
3249 +	struct task_struct *owner;
3250 +#endif
3251  };
3252  
3253  #define DECLARE_TASKLET(name, func, data) \
3254 @@ -523,7 +528,7 @@ static inline int tasklet_trylock(struct tasklet_struct *t)
3255  
3256  static inline void tasklet_unlock(struct tasklet_struct *t)
3257  {
3258 -	smp_mb__before_clear_bit(); 
3259 +	smp_mb__before_clear_bit();
3260  	clear_bit(TASKLET_STATE_RUN, &(t)->state);
3261  }
3262  
3263 @@ -537,6 +542,7 @@ static inline void tasklet_unlock_wait(struct tasklet_struct *t)
3264  #define tasklet_unlock(t) do { } while (0)
3265  #endif
3266  
3267 +extern void ___tasklet_schedule(struct tasklet_struct *t);
3268  extern void __tasklet_schedule(struct tasklet_struct *t);
3269  
3270  static inline void tasklet_schedule(struct tasklet_struct *t)
3271 @@ -545,6 +551,7 @@ static inline void tasklet_schedule(struct tasklet_struct *t)
3272  		__tasklet_schedule(t);
3273  }
3274  
3275 +extern void ___tasklet_hi_schedule(struct tasklet_struct *t);
3276  extern void __tasklet_hi_schedule(struct tasklet_struct *t);
3277  
3278  static inline void tasklet_hi_schedule(struct tasklet_struct *t)
3279 @@ -553,6 +560,7 @@ static inline void tasklet_hi_schedule(struct tasklet_struct *t)
3280  		__tasklet_hi_schedule(t);
3281  }
3282  
3283 +extern void ___tasklet_hi_schedule_first(struct tasklet_struct *t);
3284  extern void __tasklet_hi_schedule_first(struct tasklet_struct *t);
3285  
3286  /*
3287 @@ -651,7 +659,7 @@ void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer)
3288   * if more than one irq occurred.
3289   */
3290  
3291 -#if defined(CONFIG_GENERIC_HARDIRQS) && !defined(CONFIG_GENERIC_IRQ_PROBE) 
3292 +#if defined(CONFIG_GENERIC_HARDIRQS) && !defined(CONFIG_GENERIC_IRQ_PROBE)
3293  static inline unsigned long probe_irq_on(void)
3294  {
3295  	return 0;
3296 diff --git a/include/linux/mutex.h b/include/linux/mutex.h
3297 index a940fe4..cb47deb 100644
3298 --- a/include/linux/mutex.h
3299 +++ b/include/linux/mutex.h
3300 @@ -126,6 +126,15 @@ static inline int mutex_is_locked(struct mutex *lock)
3301  	return atomic_read(&lock->count) != 1;
3302  }
3303  
3304 +/* return non-zero to abort.  only pre-side-effects may abort */
3305 +typedef int (*side_effect_t)(unsigned long);
3306 +extern void mutex_lock_sfx(struct mutex *lock,
3307 +						   side_effect_t pre, unsigned long pre_arg,
3308 +						   side_effect_t post, unsigned long post_arg);
3309 +extern void mutex_unlock_sfx(struct mutex *lock,
3310 +							 side_effect_t pre, unsigned long pre_arg,
3311 +							 side_effect_t post, unsigned long post_arg);
3312 +
3313  /*
3314   * See kernel/mutex.c for detailed documentation of these APIs.
3315   * Also see Documentation/mutex-design.txt.
3316 @@ -153,6 +162,7 @@ extern void mutex_lock(struct mutex *lock);
3317  extern int __must_check mutex_lock_interruptible(struct mutex *lock);
3318  extern int __must_check mutex_lock_killable(struct mutex *lock);
3319  
3320 +
3321  # define mutex_lock_nested(lock, subclass) mutex_lock(lock)
3322  # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
3323  # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock)
3324 diff --git a/include/linux/sched.h b/include/linux/sched.h
3325 index 14a6c7b..9c990d1 100644
3326 --- a/include/linux/sched.h
3327 +++ b/include/linux/sched.h
3328 @@ -39,6 +39,7 @@
3329  #define SCHED_BATCH		3
3330  /* SCHED_ISO: reserved but not implemented yet */
3331  #define SCHED_IDLE		5
3332 +#define SCHED_LITMUS		6
3333  /* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */
3334  #define SCHED_RESET_ON_FORK     0x40000000
3335  
3336 @@ -93,6 +94,9 @@ struct sched_param {
3337  
3338  #include <asm/processor.h>
3339  
3340 +#include <litmus/rt_param.h>
3341 +#include <litmus/preempt.h>
3342 +
3343  struct exec_domain;
3344  struct futex_pi_state;
3345  struct robust_list_head;
3346 @@ -1209,6 +1213,7 @@ struct sched_rt_entity {
3347  };
3348  
3349  struct rcu_node;
3350 +struct od_table_entry;
3351  
3352  enum perf_event_task_context {
3353  	perf_invalid_context = -1,
3354 @@ -1313,9 +1318,9 @@ struct task_struct {
3355  	unsigned long stack_canary;
3356  #endif
3357  
3358 -	/* 
3359 +	/*
3360  	 * pointers to (original) parent process, youngest child, younger sibling,
3361 -	 * older sibling, respectively.  (p->father can be replaced with 
3362 +	 * older sibling, respectively.  (p->father can be replaced with
3363  	 * p->real_parent->pid)
3364  	 */
3365  	struct task_struct *real_parent; /* real parent process */
3366 @@ -1526,6 +1531,13 @@ struct task_struct {
3367  	int make_it_fail;
3368  #endif
3369  	struct prop_local_single dirties;
3370 +
3371 +	/* LITMUS RT parameters and state */
3372 +	struct rt_param rt_param;
3373 +
3374 +	/* references to PI semaphores, etc. */
3375 +	struct od_table_entry *od_table;
3376 +
3377  #ifdef CONFIG_LATENCYTOP
3378  	int latency_record_count;
3379  	struct latency_record latency_record[LT_SAVECOUNT];
3380 @@ -2136,7 +2148,7 @@ static inline int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, s
3381  	spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
3382  
3383  	return ret;
3384 -}	
3385 +}
3386  
3387  extern void block_all_signals(int (*notifier)(void *priv), void *priv,
3388  			      sigset_t *mask);
3389 @@ -2446,6 +2458,7 @@ static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag)