Skip to content

Commit

Permalink
IntelliPlug: Added to more performance
Browse files Browse the repository at this point in the history
Author: Paul Reioux aka Faux123 <reioux@gmail.com>

Signed-off-by: Javier Sayago <admin@lonasdigital.com>
  • Loading branch information
javilonas committed May 30, 2015
1 parent 0fbc589 commit 4ef16c6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
27 changes: 23 additions & 4 deletions arch/arm/hotplug/intelli_plug.c
Expand Up @@ -199,7 +199,7 @@ static unsigned int calculate_thread_stats(void)
return nr_run;
}

static void __cpuinit intelli_plug_boost_fn(struct work_struct *work)
static void __ref intelli_plug_boost_fn(struct work_struct *work)
{

int nr_cpus = num_online_cpus();
Expand Down Expand Up @@ -250,7 +250,7 @@ static void unplug_cpu(int min_active_cpu)
}
}

static void __cpuinit intelli_plug_work_fn(struct work_struct *work)
static void __ref intelli_plug_work_fn(struct work_struct *work)
{
unsigned int nr_run_stat;
unsigned int cpu_count = 0;
Expand Down Expand Up @@ -410,10 +410,29 @@ static void wakeup_boost(void)
}
}

void __ref intelli_plug_perf_boost(bool on)
{
unsigned int cpu;

if (intelli_plug_active) {
flush_workqueue(intelliplug_wq);
if (on) {
for_each_possible_cpu(cpu) {
if (!cpu_online(cpu))
cpu_up(cpu);
}
} else {
queue_delayed_work_on(0, intelliplug_wq,
&intelli_plug_work,
msecs_to_jiffies(sampling_time));
}
}
}

#ifdef CONFIG_POWERSUSPEND
static void __cpuinit intelli_plug_resume(struct power_suspend *handler)
static void __ref intelli_plug_resume(struct power_suspend *handler)
#else
static void __cpuinit intelli_plug_resume(struct early_suspend *handler)
static void __ref intelli_plug_resume(struct early_suspend *handler)
#endif
{

Expand Down
10 changes: 10 additions & 0 deletions drivers/md/dm-crypt.c
Expand Up @@ -1010,6 +1010,10 @@ static void kcryptd_io_write(struct dm_crypt_io *io)
generic_make_request(clone);
}

#ifdef CONFIG_INTELLI_PLUG
extern void intelli_plug_perf_boost(bool);
#endif

static int dmcrypt_write(void *data)
{
struct crypt_config *cc = data;
Expand Down Expand Up @@ -1062,6 +1066,9 @@ static int dmcrypt_write(void *data)
kcryptd_io_write(io);
} while (!RB_EMPTY_ROOT(&write_tree));
blk_finish_plug(&plug);
#ifdef CONFIG_INTELLI_PLUG
intelli_plug_perf_boost(false);
#endif
}
return 0;
}
Expand Down Expand Up @@ -1676,6 +1683,9 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
ti->error = "Couldn't spawn write thread";
goto bad;
}
#ifdef CONFIG_INTELLI_PLUG
intelli_plug_perf_boost(true);
#endif
wake_up_process(cc->write_thread);

ti->num_flush_bios = 1;
Expand Down

0 comments on commit 4ef16c6

Please sign in to comment.