diff --git a/NEWS b/NEWS
index 5da2be3cbe7b109cecb81bbeebbac7a029425e0e..f54bf276dddf9fe466d0bd586e5f647fdd90f010 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,8 @@ documents those changes that are of interest to users and admins.
     partitions.
  -- Added sacctmgr list events which will list events that have happened on
     clusters in accounting.
+ -- Add support for slurmctld and slurmd option of "-n <value>" to reset the
+    daemon's nice value.
 
 * Changes in SLURM 2.2.0.pre3
 =============================
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 2aecfa25c5991c0913e73e1cb09859dd19179339..a5c9f773511b81c350954b198f22b78d537c54c3 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -93,6 +93,9 @@ COMMAND CHANGES (see man pages for details)
 
 * scontrol now has the ability to change a job step's time limit.
 
+* Add support for slurmctld and slurmd option of "-n <value>" to reset the
+  daemon's nice value.
+
 BLUEGENE SPECIFIC CHANGES
 =========================
 
diff --git a/doc/man/man8/slurmctld.8 b/doc/man/man8/slurmctld.8
index b751282393dfd0e5632eeb7edfdc2ab585983094..fcd824c475eab7936e32232f4cfc995530b2a7c1 100644
--- a/doc/man/man8/slurmctld.8
+++ b/doc/man/man8/slurmctld.8
@@ -1,4 +1,4 @@
-.TH SLURMCTLD "8" "June 2006" "slurmctld 2.0" "Slurm components"
+.TH SLURMCTLD "8" "March 2010" "slurmctld 2.2" "Slurm components"
 .SH "NAME"
 slurmctld \- The central management daemon of Slurm.
 .SH "SYNOPSIS"
@@ -32,6 +32,10 @@ Help; print a brief summary of command options.
 \fB\-L <file>\fR
 Write log messages to the specified file.
 
+.TP
+\fB\-n <value>\fR
+Set the daemon's nice value to the specified value, typically a negative number.
+
 .TP
 \fB\-R\fR
 Recover full state from last checkpoint: jobs, node, and partition state. 
diff --git a/doc/man/man8/slurmd.8 b/doc/man/man8/slurmd.8
index 6cfde1df931ae7b739038a314e7b8349945cff31..2eb3e3d5085e5cb674835724aeec4004361b51d1 100644
--- a/doc/man/man8/slurmd.8
+++ b/doc/man/man8/slurmd.8
@@ -1,4 +1,4 @@
-.TH SLURMD "8" "March 2009" "slurmd 2.0" "Slurm components"
+.TH SLURMD "8" "March 2010" "slurmd 2.2" "Slurm components"
 
 .SH "NAME"
 slurmd \- The compute node daemon for SLURM.
@@ -19,7 +19,7 @@ abnormally.
 .TP
 \fB\-d <file>\fR
 Specify the fully qualified pathname to the \fBslurmstepd\fR program to be used
-for sheperding user job steps. This can be useful for testing purposes.
+for shepherding user job steps. This can be useful for testing purposes.
 .TP
 \fB\-D\fR
 Run slurmd in the foreground. Error and debug messages will be copied to stderr.
@@ -39,6 +39,12 @@ paging of the slurmd process. This may help in cases where nodes are
 marked DOWN during periods of heavy swap activity. If the mlockall(2)
 system call is not available, an error will be printed to the log
 and slurmd will continue as normal.
+
+.TP
+\fB\-n <value>\fR
+Set the daemon's nice value to the specified value, typically a negative number.
+Also note the \fBPropagatePrioProcess\fR configuration parameter.
+
 .TP
 \fB\-v\fR
 Verbose operation. Multiple \-v's increase verbosity.
@@ -66,7 +72,7 @@ configuration file, \fBslurm.conf\fR.
 
 .SH "COPYING"
 Copyright (C) 2002\-2007 The Regents of the University of California.
-Copyright (C) 2008\-2009 Lawrence Livermore National Security.
+Copyright (C) 2008\-2010 Lawrence Livermore National Security.
 Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 CODE\-OCEC\-09\-009. All rights reserved.
 .LP
diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c
index 9439e0b56240f50cf496a5ee882f15ba214daa72..8c079d3ad52bc0a8fb5b01cc2407b5c386b033c7 100644
--- a/src/slurmctld/controller.c
+++ b/src/slurmctld/controller.c
@@ -162,6 +162,7 @@ static int	daemonize = DEFAULT_DAEMONIZE;
 static int	debug_level = 0;
 static char	*debug_logfile = NULL;
 static bool     dump_core = false;
+static int	new_nice = 0;
 static char	node_name[MAX_SLURM_NAME];
 static int	recover   = DEFAULT_RECOVER;
 static pthread_cond_t server_thread_cond = PTHREAD_COND_INITIALIZER;
@@ -196,6 +197,7 @@ static void *       _slurmctld_background(void *no_data);
 static void *       _slurmctld_rpc_mgr(void *no_data);
 static void *       _slurmctld_signal_hand(void *no_data);
 inline static void  _update_cred_key(void);
+static void         _update_nice(void);
 inline static void  _usage(char *prog_name);
 static bool         _valid_controller(void);
 static bool         _wait_for_server_thread(void);
@@ -228,6 +230,7 @@ int main(int argc, char *argv[])
 	slurm_conf_reinit(slurm_conf_filename);
 
 	update_logging();
+	_update_nice();
 	_kill_old_slurmctld();
 
 	/*
@@ -1488,9 +1491,10 @@ extern int optind, opterr, optopt;
 static void _parse_commandline(int argc, char *argv[])
 {
 	int c = 0;
+	char *tmp_char;
 
 	opterr = 0;
-	while ((c = getopt(argc, argv, "cdDf:hL:rRvV")) != -1)
+	while ((c = getopt(argc, argv, "cdDf:hL:n:rRvV")) != -1)
 		switch (c) {
 		case 'c':
 			recover = 0;
@@ -1512,6 +1516,11 @@ static void _parse_commandline(int argc, char *argv[])
 		case 'L':
 			debug_logfile = xstrdup(optarg);
 			break;
+		case 'n':
+			new_nice = strtol(optarg, &tmp_char, 10);
+			if (tmp_char[0] != '\0')
+				new_nice = NO_VAL;
+			break;
 		case 'r':
 			recover = 1;
 			bg_recover = 1;
@@ -1676,6 +1685,25 @@ void update_logging(void)
 			slurmctld_conf.sched_logfile);
 }
 
+/* Reset slurmd nice value */
+static void _update_nice(void)
+{
+	int cur_nice;
+	id_t pid;
+
+	if (new_nice == NO_VAL) {
+		error("Invalid option for -n option (nice value), ignored");
+		return;
+	}
+
+	pid = getpid();
+	cur_nice = getpriority(PRIO_PROCESS, pid);
+	if (cur_nice == new_nice)
+		return;
+	if (setpriority(PRIO_PROCESS, pid, new_nice))
+		error("Unable to reset nice value to %d: %m", new_nice);
+}
+
 /* Kill the currently running slurmctld
  * NOTE: No need to lock the config data since we are still single-threaded */
 static void
diff --git a/src/slurmd/slurmd/slurmd.c b/src/slurmd/slurmd/slurmd.c
index e0ca9f816ebc0054a4b13b5616e47683cc73686f..977debbb93752b65342e508afb03417b9363efef 100644
--- a/src/slurmd/slurmd/slurmd.c
+++ b/src/slurmd/slurmd/slurmd.c
@@ -93,7 +93,7 @@
 #include "src/slurmd/common/task_plugin.h"
 #include "src/slurmd/common/set_oomadj.h"
 
-#define GETOPT_ARGS	"cd:Df:hL:MN:vV"
+#define GETOPT_ARGS	"cd:Df:hL:Mn:N:vV"
 
 #ifndef MAXHOSTNAMELEN
 #  define MAXHOSTNAMELEN	64
@@ -157,6 +157,7 @@ static int       _slurmd_fini(void);
 static void      _spawn_registration_engine(void);
 static void      _term_handler(int);
 static void      _update_logging(void);
+static void      _update_nice(void);
 static void      _usage(void);
 static void      _wait_for_all_threads(void);
 
@@ -746,6 +747,8 @@ _read_config(void)
 	conf->block_map_size = 0;
 
 	_update_logging();
+	_update_nice();
+		
 	get_procs(&conf->actual_cpus);
 	get_cpuinfo(conf->actual_cpus,
 		    &conf->actual_sockets,
@@ -1027,6 +1030,7 @@ static void
 _process_cmdline(int ac, char **av)
 {
 	int c;
+	char *tmp_char;
 
 	conf->prog = xbasename(av[0]);
 
@@ -1054,6 +1058,11 @@ _process_cmdline(int ac, char **av)
 		case 'M':
 			conf->mlock_pages = 1;
 			break;
+		case 'n':
+			conf->nice = strtol(optarg, &tmp_char, 10);
+			if (tmp_char[0] != '\0')
+				conf->nice = NO_VAL;
+			break;
 		case 'N':
 			conf->node_name = xstrdup(optarg);
 			break;
@@ -1465,7 +1474,7 @@ _kill_old_slurmd(void)
 	}
 }
 
-/* Reset slurmctld logging based upon configuration parameters */
+/* Reset slurmd logging based upon configuration parameters */
 static void _update_logging(void)
 {
 	log_options_t *o = &conf->log_opts;
@@ -1501,6 +1510,25 @@ static void _update_logging(void)
 	log_alter(conf->log_opts, SYSLOG_FACILITY_DAEMON, conf->logfile);
 }
 
+/* Reset slurmd nice value */
+static void _update_nice(void)
+{
+	int cur_nice;
+	id_t pid;
+
+	if (conf->nice == NO_VAL) {
+		error("Invalid option for -n option (nice value), ignored");
+		return;
+	}
+
+	pid = getpid();
+	cur_nice = getpriority(PRIO_PROCESS, pid);
+	if (cur_nice == conf->nice)
+		return;
+	if (setpriority(PRIO_PROCESS, pid, conf->nice))
+		error("Unable to reset nice value to %d: %m", conf->nice);
+}
+
 /*
  *  Lock the fork mutex to protect fork-critical regions
  */
diff --git a/src/slurmd/slurmd/slurmd.h b/src/slurmd/slurmd/slurmd.h
index 89d349a85ad024191c1c980478b6c3bcfce406dd..d890345eb8ac2d68a64acbdb8bd65c9dbc6e012c 100644
--- a/src/slurmd/slurmd/slurmd.h
+++ b/src/slurmd/slurmd/slurmd.h
@@ -3,7 +3,7 @@
  * $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
- *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
+ *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Mark Grondona <mgrondona@llnl.gov>.
  *  CODE-OCEC-09-009. All rights reserved.
@@ -94,9 +94,10 @@ typedef struct slurmd_config {
 	uint16_t     block_map_size;	/* size of block map               */
 	uint16_t     *block_map;	/* abstract->machine block map     */
 	uint16_t     *block_map_inv;	/* machine->abstract (inverse) map */
-	uint16_t      cr_type;           /* Consumable Resource Type:       *
+	uint16_t      cr_type;		/* Consumable Resource Type:       *
 					 * CR_SOCKET, CR_CORE, CR_MEMORY,  *
 					 * CR_DEFAULT, etc.                */
+	int           nice;		/* command line nice value spec    */
 	char         *node_name;	/* node name                       */
 	char         *node_addr;	/* node's address                  */
 	char         *node_topo_addr;   /* node's topology address         */