Skip to contentSkip to conversation

dlm: Use cond_resched() in ast delivery loop

Cluster-devel Steven Whitehouse 2 participants 2 messages Dec 10, 2008 Distributed lock manager (DLM)

lore
Share & tools
lore
#0 lore raw

This is a one-liner to use cond_resched() rather than schedule() in the ast delivery loop. It should not be necessary to schedule every time, so this will save some cpu time while continuing to allow scheduling when required.

fs/dlm/ast.c +1 -1
index 8bf31e3..30c11f3 100644
@@ -101,7 +101,7 @@ static void process_asts(void)
 		   and may result in the lkb being freed */
 		dlm_put_lkb(lkb);
 
-		schedule();
+		cond_resched();
 	}
 }
 
maintainer
#1 lore raw
Quoted 5 lines · Steven Whitehouse

This is a one-liner to use cond_resched() rather than schedule() in the ast delivery loop. It should not be necessary to schedule every time, so this will save some cpu time while continuing to allow scheduling when required.

Thanks, will queue it up.

Quoted 17 lines
fs/dlm/ast.c +1 -1
index 8bf31e3..30c11f3 100644
@@ -101,7 +101,7 @@ static void process_asts(void)
 		   and may result in the lkb being freed */
 		dlm_put_lkb(lkb);
 
-		schedule();
+		cond_resched();
 	}
 }