Fix wake_up() preemptions under P-FP and PSN-EDF

Due to some mistake in the past, PSN-EDF was missing a check for
preemptions when a task resumes. P-FP adopted it by virtue of
copy&paste. This patch makes sure that a preemption is triggered when
a higher-priority task is added to the ready queue.
Fix changed task_struct field name.
Include a missing header file.
Do processor state transitions in schedule_tail().

Fixes a bug in Litmus where processor scheduling states
could become corrupted. Corruption can occur when a
just-forked thread is externally forced to be scheduled
by SCHED_LITMUS before this just-forked thread can complete
post-fork processing. Specifically, before schedule_tail()
has completed.
Improve readability of EDF comparisons.

Restructured the EDF task comparison code to improve readability.
Recoded chained logical expression embedded in return statement
into a series of if/else blocks.
EDF priority tie-breaks.

Instead of tie-breaking by PID (which is a static
priority tie-break), we can tie-break by other
job-level-unique parameters. This is desirable
because tasks are equaly affected by tardiness
since static priority tie-breaks cause tasks
with greater PID values to experience the most
tardiness.

There are four tie-break methods:

1) Lateness.  If two jobs, J_{1,i} and J_{2,j} of
tasks T_1 and T_2, respectively, have equal
deadlines, we favor the job of the task that
had the worst lateness for jobs J_{1,i-1} and
J_{2,j-1}.

Note: Unlike tardiness, lateness may be less than
zero. This occurs when a job finishes before its
deadline.

2) Normalized Lateness.  The same as #1, except
lateness is first normalized by each task's
relative deadline.  This prevents tasks with short
relative deadlines and small execution requirements
from always losing tie-breaks.

3) Hash. The job tuple (PID, Job#) is used to
generate a hash. Hash values are then compared.
A job has ~50% chance of winning a tie-break
with respect to another job.

Note: Emperical testing shows that some jobs
can have +/- ~1.5% advantage in tie-breaks.
Linux's built-in hash function is not totally
a uniform hash.

4) PIDs. PID-based tie-break used in prior
versions of Litmus.
Fix 64-bit division in fpmath.h

Commit e6f51fb826ce98d436f445aae4eb9e9dba1f30e8 added some floating
point support for LITMUS^RT, but it used 64-bit division that ARM does
not support. Therefore, use the division functions from math64.h.
Fix compilation error on ARM platforms.
Re-implement synchronous task set release support

The old implementation had the problem that the first job release of all
tasks was handled on the *same* CPU (that triggered the synchronous task set
release). This could result in significant latency spikes.

The new implementation uses a completion per task. Futher, each task programs
its own release, which ensures that it will be on the proper processor.
Remove complete_n() API

The LITMUS^RT-specific completion API complete_n() is no longer
required by the synchronous release code. Let's remove it; one less
modification of a core Linux file to maintain during rebasing.
FDSO: make sure fdso_close() is called during task teardown

When a task exists and its FDSO table is released, the locking
protocol's 'close()' callback should be invoked to do proper
protocol-specific cleanup (such as unlocking the resource, if
required).
ftdev: don't hold lock while sleeping

Holding the lock prevents other tasks from opening the device.
Feather-Trace: keep track of PID in trace record

To properly trace locking overheads, it is required to tell apart
samples from different tasks, which requires keeping track of their
PIDs.

The timestamp is shortened to 48 bits to make room for the PID.
Feather-Trace: update locking timestamps

Reassing locking timestamps and prepare support for tracing
system call overheads.
Feather-Trace: add support for locking-related syscall overheads

Support recording timestamps that allow tracing the entry and exit
costs of locking-related system calls.
Export IRQ count to control page

Also add some compile-time checks to detect unexpected offsets.
Use user-provided irq count for TS_SYSCALL_IN_END

To detect interrupts that interfered after the initial time stamp was
recorded, this patch changes sched_trace to also record the IRQ count
as observed by userspace.
Make Feather-Trace timestamp collection non-preemptive

If the tracing code is interrupted / preempted inbetween the time that
a sequence number is drawn and the time that the trace recorded is
allocated, then the trace file will contain "out of order" events.
These are difficult to detect during post-processing and can create
artificial "outliers". This patch briefly disables local interrutps to
avoid this.

While at it, de-duplicate the timestamp recording code.
Mark feather-trace buffers as "disturbed" on soft IRQs

We don't want outliers due to soft IRQs, so let them mark ongoing
traces as "dirty" as well.
Trace IPI-related IRQs with ft_irq_fired()

IPIs have some special cases where irq_enter() is not called. This
caused ft_irq_fired() to "miss" some rescheduling-related interrupts,
which in turn may cause outliers.

This patch makes sure ft_irq_fired() is called on scheduling-related
IPIs.