diff for duplicates of <1458273857.6622.75.camel@neuling.org> diff --git a/a/1.txt b/N1/1.txt index e7e5e6a..536efa4 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -5,7 +5,7 @@ On Wed, 2016-02-03 at 01:11 +0530, Shilpasri G Bhat wrote: > in a hot path. So instead of calling cpu_to_chip_id() everytime cache > the chip ids for all cores in the array 'core_to_chip_map' and use it > in the hotpath. -> +>=20 > Reported-by: Anton Blanchard <anton@samba.org> > Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> > Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com> @@ -18,34 +18,35 @@ less complex. Mikey -diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c +diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cp= +ufreq.c index 547890f..d63d2cb 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -52,6 +52,7 @@ static struct chip { } *chips; - +=20 static int nr_chips; +static DEFINE_PER_CPU(unsigned int, chip_id); - +=20 /* * Note: The set of pstates consists of contiguous integers, the @@ -317,9 +318,7 @@ static void powernv_cpufreq_throttle_check(void *data) - - pmsr = get_pmspr(SPRN_PMSR); - -- for (i = 0; i < nr_chips; i++) -- if (chips[i].id == cpu_to_chip_id(cpu)) +=20 + pmsr =3D get_pmspr(SPRN_PMSR); +=20 +- for (i =3D 0; i < nr_chips; i++) +- if (chips[i].id =3D=3D cpu_to_chip_id(cpu)) - break; -+ i = this_cpu_read(chip_id); - ++ i =3D this_cpu_read(chip_id); +=20 /* Check for Pmax Capping */ - pmsr_pmax = (s8)PMSR_MAX(pmsr); + pmsr_pmax =3D (s8)PMSR_MAX(pmsr); @@ -560,6 +559,7 @@ static int init_chip_info(void) for_each_possible_cpu(cpu) { - unsigned int id = cpu_to_chip_id(cpu); - -+ per_cpu(chip_id, cpu) = nr_chips; - if (prev_chip_id != id) { - prev_chip_id = id; - chip[nr_chips++] = id; + unsigned int id =3D cpu_to_chip_id(cpu); +=20 ++ per_cpu(chip_id, cpu) =3D nr_chips; + if (prev_chip_id !=3D id) { + prev_chip_id =3D id; + chip[nr_chips++] =3D id; diff --git a/a/content_digest b/N1/content_digest index b1090bc..9c4fea7 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -22,7 +22,7 @@ "> in a hot path. So instead of calling cpu_to_chip_id() everytime cache\n" "> the chip ids for all cores in the array 'core_to_chip_map' and use it\n" "> in the hotpath.\n" - "> \n" + ">=20\n" "> Reported-by: Anton Blanchard <anton@samba.org>\n" "> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>\n" "> Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>\n" @@ -35,36 +35,37 @@ "\n" "Mikey\n" "\n" - "diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c\n" + "diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cp=\n" + "ufreq.c\n" "index 547890f..d63d2cb 100644\n" "--- a/drivers/cpufreq/powernv-cpufreq.c\n" "+++ b/drivers/cpufreq/powernv-cpufreq.c\n" "@@ -52,6 +52,7 @@ static struct chip {\n" " } *chips;\n" - " \n" + "=20\n" " static int nr_chips;\n" "+static DEFINE_PER_CPU(unsigned int, chip_id);\n" - " \n" + "=20\n" " /*\n" " * Note: The set of pstates consists of contiguous integers, the\n" "@@ -317,9 +318,7 @@ static void powernv_cpufreq_throttle_check(void *data)\n" - " \n" - " \tpmsr = get_pmspr(SPRN_PMSR);\n" - " \n" - "-\tfor (i = 0; i < nr_chips; i++)\n" - "-\t\tif (chips[i].id == cpu_to_chip_id(cpu))\n" + "=20\n" + " \tpmsr =3D get_pmspr(SPRN_PMSR);\n" + "=20\n" + "-\tfor (i =3D 0; i < nr_chips; i++)\n" + "-\t\tif (chips[i].id =3D=3D cpu_to_chip_id(cpu))\n" "-\t\t\tbreak;\n" - "+\ti = this_cpu_read(chip_id);\n" - " \n" + "+\ti =3D this_cpu_read(chip_id);\n" + "=20\n" " \t/* Check for Pmax Capping */\n" - " \tpmsr_pmax = (s8)PMSR_MAX(pmsr);\n" + " \tpmsr_pmax =3D (s8)PMSR_MAX(pmsr);\n" "@@ -560,6 +559,7 @@ static int init_chip_info(void)\n" " \tfor_each_possible_cpu(cpu) {\n" - " \t\tunsigned int id = cpu_to_chip_id(cpu);\n" - " \n" - "+\t\tper_cpu(chip_id, cpu) = nr_chips;\n" - " \t\tif (prev_chip_id != id) {\n" - " \t\t\tprev_chip_id = id;\n" - " \t\t\tchip[nr_chips++] = id;" + " \t\tunsigned int id =3D cpu_to_chip_id(cpu);\n" + "=20\n" + "+\t\tper_cpu(chip_id, cpu) =3D nr_chips;\n" + " \t\tif (prev_chip_id !=3D id) {\n" + " \t\t\tprev_chip_id =3D id;\n" + " \t\t\tchip[nr_chips++] =3D id;" -77a1ebf03bd79b56a56415894360d372d7e53f69f6c4a0e3ec4eb197ff468ab2 +f05cf7956ea2493fb726003d53144cc8d9d485e38dd1053f57cac6187b3165df
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.