infra: avoid frequent resched

This commit is contained in:
Thomas Schoebel-Theuer 2017-05-17 12:10:35 +02:00
parent 17832cd7ea
commit 088b103abf
2 changed files with 5 additions and 5 deletions

View File

@ -38,7 +38,7 @@ int _brick_msleep(int msecs, bool shorten)
unsigned long timeout;
flush_signals(current); \
if (msecs <= 0) {
schedule();
cond_resched();
return 0;
}
timeout = msecs_to_jiffies(msecs) + 1;

View File

@ -375,7 +375,7 @@ struct say_channel *_make_channel(const char *name, bool must_exist)
restart:
res = kzalloc(sizeof(struct say_channel), mode);
if (unlikely(!res)) {
schedule();
cond_resched();
goto restart;
}
atomic_inc(&say_alloc_channels);
@ -385,7 +385,7 @@ restart:
restart2:
res->ch_name = kstrdup(name, mode);
if (unlikely(!res->ch_name)) {
schedule();
cond_resched();
goto restart2;
}
atomic_inc(&say_alloc_names);
@ -396,7 +396,7 @@ restart2:
restart3:
buf = (void*)__get_free_pages(mode, SAY_ORDER);
if (unlikely(!buf)) {
schedule();
cond_resched();
goto restart3;
}
atomic_inc(&say_alloc_pages);
@ -688,7 +688,7 @@ char *_make_filename(struct say_channel *ch, int class, int transact, int add_tm
restart:
filename = kmalloc(1024, GFP_KERNEL);
if (unlikely(!filename)) {
schedule();
cond_resched();
goto restart;
}
atomic_inc(&say_alloc_names);