Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ba1ae92 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branches 'timers/clockevents', 'timers/hpet', 'timers/hrtimers' and...

Merge branches 'timers/clockevents', 'timers/hpet', 'timers/hrtimers' and 'timers/urgent' into timers/core
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -897,13 +897,21 @@ static unsigned long hpet_rtc_flags;
static int hpet_prev_update_sec;
static struct rtc_time hpet_alarm_time;
static unsigned long hpet_pie_count;
static unsigned long hpet_t1_cmp;
static u32 hpet_t1_cmp;
static unsigned long hpet_default_delta;
static unsigned long hpet_pie_delta;
static unsigned long hpet_pie_limit;

static rtc_irq_handler irq_handler;

/*
 * Check that the hpet counter c1 is ahead of the c2
 */
static inline int hpet_cnt_ahead(u32 c1, u32 c2)
{
	return (s32)(c2 - c1) < 0;
}

/*
 * Registers a IRQ handler.
 */
@@ -1075,7 +1083,7 @@ static void hpet_rtc_timer_reinit(void)
		hpet_t1_cmp += delta;
		hpet_writel(hpet_t1_cmp, HPET_T1_CMP);
		lost_ints++;
	} while ((long)(hpet_readl(HPET_COUNTER) - hpet_t1_cmp) > 0);
	} while (!hpet_cnt_ahead(hpet_t1_cmp, hpet_readl(HPET_COUNTER)));

	if (lost_ints) {
		if (hpet_rtc_flags & RTC_PIE)
+2 −1
Original line number Diff line number Diff line
@@ -172,7 +172,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4,
			 ich_force_enable_hpet);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7,
			 ich_force_enable_hpet);

DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x3a16,	/* ICH10 */
			 ich_force_enable_hpet);

static struct pci_dev *cached_dev;

+5 −6
Original line number Diff line number Diff line
@@ -48,12 +48,11 @@ extern struct fs_struct init_fs;
	.posix_timers	 = LIST_HEAD_INIT(sig.posix_timers),		\
	.cpu_timers	= INIT_CPU_TIMERS(sig.cpu_timers),		\
	.rlim		= INIT_RLIMITS,					\
	.cputime	= { .totals = {					\
		.utime = cputime_zero,					\
		.stime = cputime_zero,					\
		.sum_exec_runtime = 0,					\
		.lock = __SPIN_LOCK_UNLOCKED(sig.cputime.totals.lock),	\
	}, },								\
	.cputimer	= { 						\
		.cputime = INIT_CPUTIME,				\
		.running = 0,						\
		.lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock),	\
	},								\
}

extern struct nsproxy init_nsproxy;
+38 −24
Original line number Diff line number Diff line
@@ -443,7 +443,6 @@ struct pacct_struct {
 * @utime:		time spent in user mode, in &cputime_t units
 * @stime:		time spent in kernel mode, in &cputime_t units
 * @sum_exec_runtime:	total time spent on the CPU, in nanoseconds
 * @lock:		lock for fields in this struct
 *
 * This structure groups together three kinds of CPU time that are
 * tracked for threads and thread groups.  Most things considering
@@ -454,23 +453,33 @@ struct task_cputime {
	cputime_t utime;
	cputime_t stime;
	unsigned long long sum_exec_runtime;
	spinlock_t lock;
};
/* Alternate field names when used to cache expirations. */
#define prof_exp	stime
#define virt_exp	utime
#define sched_exp	sum_exec_runtime

#define INIT_CPUTIME	\
	(struct task_cputime) {					\
		.utime = cputime_zero,				\
		.stime = cputime_zero,				\
		.sum_exec_runtime = 0,				\
	}

/**
 * struct thread_group_cputime - thread group interval timer counts
 * @totals:		thread group interval timers; substructure for
 *			uniprocessor kernel, per-cpu for SMP kernel.
 * struct thread_group_cputimer - thread group interval timer counts
 * @cputime:		thread group interval timers.
 * @running:		non-zero when there are timers running and
 * 			@cputime receives updates.
 * @lock:		lock for fields in this struct.
 *
 * This structure contains the version of task_cputime, above, that is
 * used for thread group CPU clock calculations.
 * used for thread group CPU timer calculations.
 */
struct thread_group_cputime {
	struct task_cputime totals;
struct thread_group_cputimer {
	struct task_cputime cputime;
	int running;
	spinlock_t lock;
};

/*
@@ -519,10 +528,10 @@ struct signal_struct {
	cputime_t it_prof_incr, it_virt_incr;

	/*
	 * Thread group totals for process CPU clocks.
	 * See thread_group_cputime(), et al, for details.
	 * Thread group totals for process CPU timers.
	 * See thread_group_cputimer(), et al, for details.
	 */
	struct thread_group_cputime cputime;
	struct thread_group_cputimer cputimer;

	/* Earliest-expiration cache. */
	struct task_cputime cputime_expires;
@@ -559,7 +568,7 @@ struct signal_struct {
	 * Live threads maintain their own counters and add to these
	 * in __exit_signal, except for the group leader.
	 */
	cputime_t cutime, cstime;
	cputime_t utime, stime, cutime, cstime;
	cputime_t gtime;
	cputime_t cgtime;
	unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
@@ -567,6 +576,14 @@ struct signal_struct {
	unsigned long inblock, oublock, cinblock, coublock;
	struct task_io_accounting ioac;

	/*
	 * Cumulative ns of schedule CPU time fo dead threads in the
	 * group, not including a zombie group leader, (This only differs
	 * from jiffies_to_ns(utime + stime) if sched_clock uses something
	 * other than jiffies.)
	 */
	unsigned long long sum_sched_runtime;

	/*
	 * We don't bother to synchronize most readers of this at all,
	 * because there is no reader checking a limit that actually needs
@@ -2183,27 +2200,24 @@ static inline int spin_needbreak(spinlock_t *lock)
/*
 * Thread group CPU time accounting.
 */
void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);

static inline
void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times)
{
	struct task_cputime *totals = &tsk->signal->cputime.totals;
	struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
	unsigned long flags;

	spin_lock_irqsave(&totals->lock, flags);
	*times = *totals;
	spin_unlock_irqrestore(&totals->lock, flags);
	spin_lock_irqsave(&cputimer->lock, flags);
	*times = cputimer->cputime;
	spin_unlock_irqrestore(&cputimer->lock, flags);
}

static inline void thread_group_cputime_init(struct signal_struct *sig)
{
	sig->cputime.totals = (struct task_cputime){
		.utime = cputime_zero,
		.stime = cputime_zero,
		.sum_exec_runtime = 0,
	};

	spin_lock_init(&sig->cputime.totals.lock);
	sig->cputimer.cputime = INIT_CPUTIME;
	spin_lock_init(&sig->cputimer.lock);
	sig->cputimer.running = 0;
}

static inline void thread_group_cputime_free(struct signal_struct *sig)
+3 −0
Original line number Diff line number Diff line
@@ -118,6 +118,8 @@ static void __exit_signal(struct task_struct *tsk)
		 * We won't ever get here for the group leader, since it
		 * will have been the last reference on the signal_struct.
		 */
		sig->utime = cputime_add(sig->utime, task_utime(tsk));
		sig->stime = cputime_add(sig->stime, task_stime(tsk));
		sig->gtime = cputime_add(sig->gtime, task_gtime(tsk));
		sig->min_flt += tsk->min_flt;
		sig->maj_flt += tsk->maj_flt;
@@ -126,6 +128,7 @@ static void __exit_signal(struct task_struct *tsk)
		sig->inblock += task_io_get_inblock(tsk);
		sig->oublock += task_io_get_oublock(tsk);
		task_io_accounting_add(&sig->ioac, &tsk->ioac);
		sig->sum_sched_runtime += tsk->se.sum_exec_runtime;
		sig = NULL; /* Marker for below. */
	}

Loading