Index: kernel/generic/src/console/cmd.c
===================================================================
--- kernel/generic/src/console/cmd.c	(revision 55cc9bc9a819800533b1cf9d98b6af133c704c37)
+++ kernel/generic/src/console/cmd.c	(revision 1ecdbb0a73519ade1b15b6c908b07dfce755b6cc)
@@ -57,5 +57,4 @@
 #include <mm/tlb.h>
 #include <arch/mm/tlb.h>
-#include <mm/as.h>
 #include <mm/frame.h>
 #include <main/version.h>
@@ -860,7 +859,7 @@
 }
 
-static void test_wrapper(void *arg)
-{
-	test_t *test = (test_t *) arg;
+static bool run_test(const test_t *test)
+{
+	printf("%s\t\t%s\n", test->name, test->desc);
 	
 	/* Update and read thread accounting
@@ -886,37 +885,9 @@
 	if (ret == NULL) {
 		printf("Test passed\n");
-//		return true;
-		return;
+		return true;
 	}
 
 	printf("%s\n", ret);
-//	return false;
-}
-
-static bool run_test(const test_t *test)
-{
-	printf("%s\t\t%s\n", test->name, test->desc);
-	
-	/* Create separate task and thread
-	   for the test */
-	task_t *ta = task_create(AS_KERNEL, "test");
-	if (ta == NULL) {
-		printf("Unable to create test task\n");
-		return false;
-	}
-	
-	thread_t *t = thread_create(test_wrapper, (void *) test, ta, 0, "test_main");
-	if (t == NULL) {
-		printf("Unable to create test main thread\n");
-		task_destroy(ta);
-		return false;
-	}
-	
-	/* Run the test */
-	thread_ready(t);
-	thread_join(t);
-	thread_detach(t);
-	
-	return true;
+	return false;
 }
 
Index: kernel/generic/src/main/kinit.c
===================================================================
--- kernel/generic/src/main/kinit.c	(revision 55cc9bc9a819800533b1cf9d98b6af133c704c37)
+++ kernel/generic/src/main/kinit.c	(revision 1ecdbb0a73519ade1b15b6c908b07dfce755b6cc)
@@ -99,5 +99,5 @@
 		 * Just a beautification.
 		 */
-		if ((t = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp"))) {
+		if ((t = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp", true))) {
 			spinlock_lock(&t->lock);
 			t->cpu = &cpus[0];
@@ -124,5 +124,5 @@
 		for (i = 0; i < config.cpu_count; i++) {
 
-			if ((t = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb"))) {
+			if ((t = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true))) {
 				spinlock_lock(&t->lock);			
 				t->cpu = &cpus[i];
@@ -144,5 +144,5 @@
 	 * Create kernel console.
 	 */
-	if ((t = thread_create(kconsole, "kconsole", TASK, 0, "kconsole")))
+	if ((t = thread_create(kconsole, "kconsole", TASK, 0, "kconsole", false)))
 		thread_ready(t);
 	else
Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision 55cc9bc9a819800533b1cf9d98b6af133c704c37)
+++ kernel/generic/src/main/main.c	(revision 1ecdbb0a73519ade1b15b6c908b07dfce755b6cc)
@@ -267,5 +267,5 @@
 	 * Create the first thread.
 	 */
-	t = thread_create(kinit, NULL, k, 0, "kinit");
+	t = thread_create(kinit, NULL, k, 0, "kinit", true);
 	if (!t)
 		panic("can't create kinit thread\n");
Index: kernel/generic/src/proc/task.c
===================================================================
--- kernel/generic/src/proc/task.c	(revision 55cc9bc9a819800533b1cf9d98b6af133c704c37)
+++ kernel/generic/src/proc/task.c	(revision 1ecdbb0a73519ade1b15b6c908b07dfce755b6cc)
@@ -221,5 +221,5 @@
 	 * Create the main thread.
 	 */
-	t1 = thread_create(uinit, kernel_uarg, task, THREAD_FLAG_USPACE, "uinit");
+	t1 = thread_create(uinit, kernel_uarg, task, THREAD_FLAG_USPACE, "uinit", false);
 	ASSERT(t1);
 	
@@ -227,5 +227,5 @@
 	 * Create killer thread for the new task.
 	 */
-	t2 = thread_create(ktaskgc, t1, task, 0, "ktaskgc");
+	t2 = thread_create(ktaskgc, t1, task, 0, "ktaskgc", true);
 	ASSERT(t2);
 	thread_ready(t2);
@@ -286,9 +286,10 @@
 		
 		spinlock_lock(&thr->lock);
-		
-		if (thr == THREAD) /* Update accounting of current thread */
-			thread_update_accounting(); 
-		ret += thr->cycles;
-		
+		/* Process only counted threads */
+		if (!thr->uncounted) {
+			if (thr == THREAD) /* Update accounting of current thread */
+				thread_update_accounting(); 
+			ret += thr->cycles;
+		}
 		spinlock_unlock(&thr->lock);
 	}
@@ -329,5 +330,5 @@
 	spinlock_unlock(&tasks_lock);
 	
-	t = thread_create(ktaskclnp, NULL, ta, 0, "ktaskclnp");
+	t = thread_create(ktaskclnp, NULL, ta, 0, "ktaskclnp", true);
 	
 	spinlock_lock(&ta->lock);
Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision 55cc9bc9a819800533b1cf9d98b6af133c704c37)
+++ kernel/generic/src/proc/thread.c	(revision 1ecdbb0a73519ade1b15b6c908b07dfce755b6cc)
@@ -124,12 +124,15 @@
 	
 	spinlock_lock(&THREAD->lock);
-	thread_update_accounting();
-	uint64_t cycles = THREAD->cycles;
-	THREAD->cycles = 0;
-	spinlock_unlock(&THREAD->lock);
-	
-	spinlock_lock(&TASK->lock);
-	TASK->cycles += cycles;
-	spinlock_unlock(&TASK->lock);
+	if (!THREAD->uncounted) {
+		thread_update_accounting();
+		uint64_t cycles = THREAD->cycles;
+		THREAD->cycles = 0;
+		spinlock_unlock(&THREAD->lock);
+		
+		spinlock_lock(&TASK->lock);
+		TASK->cycles += cycles;
+		spinlock_unlock(&TASK->lock);
+	} else
+		spinlock_unlock(&THREAD->lock);
 	
 	interrupts_restore(ipl);
@@ -303,14 +306,15 @@
  * Create a new thread.
  *
- * @param func  Thread's implementing function.
- * @param arg   Thread's implementing function argument.
- * @param task  Task to which the thread belongs.
- * @param flags Thread flags.
- * @param name  Symbolic name.
+ * @param func      Thread's implementing function.
+ * @param arg       Thread's implementing function argument.
+ * @param task      Task to which the thread belongs.
+ * @param flags     Thread flags.
+ * @param name      Symbolic name.
+ * @param uncounted Thread's accounting doesn't affect accumulated task accounting.
  *
  * @return New thread's structure on success, NULL on failure.
  *
  */
-thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags, char *name)
+thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags, char *name, bool uncounted)
 {
 	thread_t *t;
@@ -345,4 +349,5 @@
 	t->ticks = -1;
 	t->cycles = 0;
+	t->uncounted = uncounted;
 	t->priority = -1;		/* start in rq[0] */
 	t->cpu = NULL;
@@ -650,5 +655,5 @@
 	}
 
-	if ((t = thread_create(uinit, kernel_uarg, TASK, THREAD_FLAG_USPACE, namebuf))) {
+	if ((t = thread_create(uinit, kernel_uarg, TASK, THREAD_FLAG_USPACE, namebuf, false))) {
 		tid = t->tid;
 		thread_ready(t);
