Deleted Added
full compact
sched_ule.c (172293) sched_ule.c (172308)
1/*-
2 * Copyright (c) 2002-2007, Jeffrey Roberson <jeff@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 *
32 * etymology:
33 * ULE is the last three letters in schedule. It owes its name to a
34 * generic user created for a scheduling system by Paul Mikesell at
35 * Isilon Systems and a general lack of creativity on the part of the author.
36 */
37
38#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002-2007, Jeffrey Roberson <jeff@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 *
32 * etymology:
33 * ULE is the last three letters in schedule. It owes its name to a
34 * generic user created for a scheduling system by Paul Mikesell at
35 * Isilon Systems and a general lack of creativity on the part of the author.
36 */
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/sys/kern/sched_ule.c 172293 2007-09-22 02:20:14Z jeff $");
39__FBSDID("$FreeBSD: head/sys/kern/sched_ule.c 172308 2007-09-24 00:28:54Z jeff $");
40
41#include "opt_hwpmc_hooks.h"
42#include "opt_sched.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/kdb.h>
47#include <sys/kernel.h>

--- 1357 unchanged lines hidden (view full) ---

1405 * Scores greater than this are placed on the normal timeshare queue
1406 * where the priority is partially decided by the most recent cpu
1407 * utilization and the rest is decided by nice value.
1408 *
1409 * The nice value of the process has a linear effect on the calculated
1410 * score. Negative nice values make it easier for a thread to be
1411 * considered interactive.
1412 */
40
41#include "opt_hwpmc_hooks.h"
42#include "opt_sched.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/kdb.h>
47#include <sys/kernel.h>

--- 1357 unchanged lines hidden (view full) ---

1405 * Scores greater than this are placed on the normal timeshare queue
1406 * where the priority is partially decided by the most recent cpu
1407 * utilization and the rest is decided by nice value.
1408 *
1409 * The nice value of the process has a linear effect on the calculated
1410 * score. Negative nice values make it easier for a thread to be
1411 * considered interactive.
1412 */
1413 score = sched_interact_score(td) - td->td_proc->p_nice;
1413 score = imax(0, sched_interact_score(td) - td->td_proc->p_nice);
1414 if (score < sched_interact) {
1415 pri = PRI_MIN_REALTIME;
1416 pri += ((PRI_MAX_REALTIME - PRI_MIN_REALTIME) / sched_interact)
1417 * score;
1418 KASSERT(pri >= PRI_MIN_REALTIME && pri <= PRI_MAX_REALTIME,
1419 ("sched_priority: invalid interactive priority %d score %d",
1420 pri, score));
1421 } else {

--- 1230 unchanged lines hidden ---
1414 if (score < sched_interact) {
1415 pri = PRI_MIN_REALTIME;
1416 pri += ((PRI_MAX_REALTIME - PRI_MIN_REALTIME) / sched_interact)
1417 * score;
1418 KASSERT(pri >= PRI_MIN_REALTIME && pri <= PRI_MAX_REALTIME,
1419 ("sched_priority: invalid interactive priority %d score %d",
1420 pri, score));
1421 } else {

--- 1230 unchanged lines hidden ---