Skip to content

Commit

Permalink
RQ Affinity corrections and minor GPU/DDR adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Apr 25, 2019
1 parent 9d0be61 commit b71e73b
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 25 deletions.
3 changes: 2 additions & 1 deletion arch/arm/configs/rk3188_X5_defconfig
Expand Up @@ -31,7 +31,8 @@ CONFIG_DEFAULT_IOSCHED_ROW=y
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_WESTWOOD=y
CONFIG_CPU_FREQ_GOV_INTERACTIVEX=y
CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y
#CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y
CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_NEOX=y
#CONFIG_CPU_FREQ_DEFAULT_GOV_NEOX=y
#CONFIG_MALI_SHARED_INTERRUPTS=y
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-rk3188/board-rk3188-sdk-slowCPU.c
Expand Up @@ -3703,10 +3703,10 @@ static struct cpufreq_frequency_table dvfs_ddr_table_volt_level0[] = {
};

static struct cpufreq_frequency_table dvfs_ddr_table_t[] = {
{.frequency = 300 * 1000 + DDR_FREQ_SUSPEND, .index = 1025 * 1000},
{.frequency = 200 * 1000 + DDR_FREQ_SUSPEND, .index = 1025 * 1000},
{.frequency = 460 * 1000 + DDR_FREQ_NORMAL, .index = 1200 * 1000},
{.frequency = 720 * 1000 + DDR_FREQ_NORMAL, .index = 1200 * 1000},
{.frequency = 800 * 1000 + DDR_FREQ_NORMAL, .index = 1250 * 1000},
// {.frequency = 720 * 1000 + DDR_FREQ_NORMAL, .index = 1200 * 1000},
// {.frequency = 800 * 1000 + DDR_FREQ_NORMAL, .index = 1250 * 1000},
{.frequency = CPUFREQ_TABLE_END},
};

Expand Down
14 changes: 7 additions & 7 deletions arch/arm/mach-rk3188/board-rk3188-sdk.c
Expand Up @@ -3667,14 +3667,14 @@ static struct cpufreq_frequency_table dvfs_arm_table_volt_level2[] = {
//FiiO new
static struct cpufreq_frequency_table dvfs_gpu_table_volt_level0[] = {
// {.frequency = 133 * 1000, .index = 950 * 1000},//the mininum rate is limited 133M for rk3188
// {.frequency = 200 * 1000, .index = 950 * 1000},
// {.frequency = 266 * 1000, .index = 975 * 1000},
// {.frequency = 300 * 1000, .index = 1025 * 1000},
// {.frequency = 400 * 1000, .index = 1075 * 1000},
{.frequency = 200 * 1000, .index = 950 * 1000},
{.frequency = 266 * 1000, .index = 975 * 1000},
{.frequency = 300 * 1000, .index = 1025 * 1000},
{.frequency = 400 * 1000, .index = 1075 * 1000},
// {.frequency = 600 * 1000, .index = 1125 * 1000},
// {.frequency = 666 * 1000, .index = 1175 * 1000},
{.frequency = 700 * 1000, .index = 1250 * 1000},
{.frequency = 798 * 1000, .index = 1250 * 1000},
// {.frequency = 700 * 1000, .index = 1250 * 1000},
// {.frequency = 798 * 1000, .index = 1250 * 1000},
{.frequency = CPUFREQ_TABLE_END},
};
/*//cube 10'
Expand Down Expand Up @@ -3714,7 +3714,7 @@ static struct cpufreq_frequency_table dvfs_ddr_table_t[] = {
*/
{.frequency = 200 * 1000 + DDR_FREQ_SUSPEND, .index = 950 * 1000},
// {.frequency = 300 * 1000 + DDR_FREQ_VIDEO, .index = 1000 * 1000},
{.frequency = 792 * 1000 + DDR_FREQ_NORMAL, .index = 1250 * 1000},
{.frequency = 460 * 1000 + DDR_FREQ_NORMAL, .index = 1250 * 1000},
{.frequency = CPUFREQ_TABLE_END},
};

Expand Down
12 changes: 7 additions & 5 deletions block/blk-core.c
Expand Up @@ -1350,11 +1350,13 @@ static int __make_request(struct request_queue *q, struct bio *bio)
init_request_from_bio(req, bio);

if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) ||
bio_flagged(bio, BIO_CPU_AFFINE)) {
req->cpu = blk_cpu_to_group(get_cpu());
put_cpu();
}

// bio_flagged(bio, BIO_CPU_AFFINE)) {
// req->cpu = blk_cpu_to_group(get_cpu());
// put_cpu();
//}
bio_flagged(bio, BIO_CPU_AFFINE))
req->cpu = smp_processor_id();

plug = current->plug;
if (plug) {
/*
Expand Down
14 changes: 9 additions & 5 deletions block/blk-softirq.c
Expand Up @@ -103,25 +103,29 @@ static struct notifier_block __cpuinitdata blk_cpu_notifier = {

void __blk_complete_request(struct request *req)
{
int ccpu, cpu;
struct request_queue *q = req->q;
unsigned long flags;
int ccpu, cpu, group_cpu;
bool shared = false;

BUG_ON(!q->softirq_done_fn);

local_irq_save(flags);
cpu = smp_processor_id();
group_cpu = blk_cpu_to_group(cpu);
// group_cpu = blk_cpu_to_group(cpu);

/*
* Select completion CPU
*/
if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) && req->cpu != -1)

if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) && req->cpu != -1) {
ccpu = req->cpu;
else
if (!test_bit(QUEUE_FLAG_SAME_FORCE, &q->queue_flags))
ccpu = blk_cpu_to_group(ccpu);
} else
ccpu = cpu;

if (ccpu == cpu || ccpu == group_cpu) {
if (ccpu == cpu) {
struct list_head *list;
do_local:
list = &__get_cpu_var(blk_cpu_done);
Expand Down
15 changes: 12 additions & 3 deletions block/blk-sysfs.c
Expand Up @@ -246,8 +246,9 @@ static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,
static ssize_t queue_rq_affinity_show(struct request_queue *q, char *page)
{
bool set = test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags);
bool force = test_bit(QUEUE_FLAG_SAME_FORCE, &q->queue_flags);

return queue_var_show(set, page);
return queue_var_show(set << force, page);
}

static ssize_t
Expand All @@ -258,11 +259,19 @@ queue_rq_affinity_store(struct request_queue *q, const char *page, size_t count)
unsigned long val;

ret = queue_var_store(&val, page, count);
// if (ret < 0)
// return ret;
spin_lock_irq(q->queue_lock);
if (val)
if (val == 2) {
queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
else
queue_flag_set(QUEUE_FLAG_SAME_FORCE, q);
} else if (val == 1) {
queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q);
} else if (val == 0) {
queue_flag_clear(QUEUE_FLAG_SAME_COMP, q);
queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q);
}
spin_unlock_irq(q->queue_lock);
#endif
return ret;
Expand Down
9 changes: 8 additions & 1 deletion include/linux/blkdev.h
Expand Up @@ -403,11 +403,18 @@ struct request_queue
#define QUEUE_FLAG_NOXMERGES 15 /* No extended merges */
#define QUEUE_FLAG_ADD_RANDOM 16 /* Contributes to random pool */
#define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */
#define QUEUE_FLAG_SAME_FORCE 18 /* force complete on same CPU */

#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
(1 << QUEUE_FLAG_STACKABLE) | \
(1 << QUEUE_FLAG_SAME_COMP) | \
(1 << QUEUE_FLAG_ADD_RANDOM))
(1 << QUEUE_FLAG_ADD_RANDOM)| \
(1 << QUEUE_FLAG_SAME_FORCE))

#define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
(1 << QUEUE_FLAG_STACKABLE) | \
(1 << QUEUE_FLAG_SAME_COMP) | \
(1 << QUEUE_FLAG_SAME_FORCE))

static inline int queue_is_locked(struct request_queue *q)
{
Expand Down
Binary file modified kernel.img
Binary file not shown.
2 changes: 2 additions & 0 deletions sound/soc/codecs/ak4490.c
Expand Up @@ -1518,6 +1518,7 @@ static int ak4490_set_dai_mute(struct snd_soc_dai *dai, int mute)
akdbgprt("\t[AK4490] %s mute %d set unmute\n",__FUNCTION__,mute);
}
/* ak4490_update_bits_lr2(AK4490_01_CONTROL2, 0x01, 0x00); */
/*
#ifdef CONFIG_SND_SOC_AK4490_CUSTOM_DRIVER
switch (selected_filter) {
case 1:
Expand Down Expand Up @@ -1568,6 +1569,7 @@ static int ak4490_set_dai_mute(struct snd_soc_dai *dai, int mute)
}
#endif
*/
}

return 0;
Expand Down

0 comments on commit b71e73b

Please sign in to comment.