diff --git a/Documentation/hwmon/hpfall.c b/Documentation/hwmon/hpfall.c
index d2f6711b468b44ce17b259b1bbe4e38eb9ad91b1..a3cfe1a5f964aedf1b4e83ec0f62dd34f8b51a8c 100644
--- a/Documentation/hwmon/hpfall.c
+++ b/Documentation/hwmon/hpfall.c
@@ -16,6 +16,8 @@
 #include <stdint.h>
 #include <errno.h>
 #include <signal.h>
+#include <sys/mman.h>
+#include <sched.h>
 
 void write_int(char *path, int i)
 {
@@ -62,6 +64,7 @@ void ignore_me(void)
 int main(int argc, char *argv[])
 {
 	int fd, ret;
+	struct sched_param param;
 
 	fd = open("/dev/freefall", O_RDONLY);
 	if (fd < 0) {
@@ -69,6 +72,11 @@ int main(int argc, char *argv[])
 		return EXIT_FAILURE;
 	}
 
+	daemon(0, 0);
+	param.sched_priority = sched_get_priority_max(SCHED_FIFO);
+	sched_setscheduler(0, SCHED_FIFO, &param);
+	mlockall(MCL_CURRENT|MCL_FUTURE);
+
 	signal(SIGALRM, ignore_me);
 
 	for (;;) {