Re: Git repo for kernel config fragments created
On Tue, 2012-06-12 at 07:41 +0800, Andy Green wrote: > Just a thought... while meddling with the OOT Androidization patches, it > seemed to me we missed a trick just killing all the default y on the > Android-related stuff. If we additionally use select xxx on > CONFIG_ANDROID for the config options we removed default for, we can > express most or all of the config relationships there, reducing this to > CONFIG_ANDROID=y That's certainly an idea for the config options which Android adds (about half of them?). There are other generic Linux configs we've enabled for Android to get certain usecases working for which it makes more sense to keep in the Android config fragment. -- Tixy ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
RE: Linaro rootfs / kernel version combination
Just to update, now I am using 12.05 (vexpress hwpack + nano rootfs). Its stable. No CPU stall errors. Thanks and regards, Suresh -Original Message- From: Suresh Kumar SHUKLA Sent: Tuesday, May 15, 2012 11:55 AM To: 'Michael Hope' Cc: linaro-dev@lists.linaro.org Subject: RE: Linaro rootfs / kernel version combination Thanks Michael, these steps worked fine. My kernel is built with statically linked modules, so I skipped initrd. I am able to boot and reach a console (with pty logging errors, and delay in prompt). I am getting some CPU stall errors occasionally. Regards, Suresh ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
[RFC 4/4] sched: cpu_power: enable ARCH_POWER
Heteregeneous ARM platform uses arch_scale_freq_power function to reflect the relative capacity of each core Signed-off-by: Vincent Guittot --- kernel/sched/features.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/features.h b/kernel/sched/features.h index de00a48..d98ae90 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -42,7 +42,7 @@ SCHED_FEAT(CACHE_HOT_BUDDY, true) /* * Use arch dependent cpu power functions */ -SCHED_FEAT(ARCH_POWER, false) +SCHED_FEAT(ARCH_POWER, true) SCHED_FEAT(HRTICK, false) SCHED_FEAT(DOUBLE_TICK, false) -- 1.7.9.5 ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
[RFC 1/4] ARM: topology: Add arch_scale_freq_power function
Add infrastructure to be able to modify the cpu_power of each core Signed-off-by: Vincent Guittot --- arch/arm/include/asm/topology.h |2 ++ arch/arm/kernel/topology.c | 36 +++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h index 58b8b84..78e4c85 100644 --- a/arch/arm/include/asm/topology.h +++ b/arch/arm/include/asm/topology.h @@ -27,11 +27,13 @@ void init_cpu_topology(void); void store_cpu_topology(unsigned int cpuid); const struct cpumask *cpu_coregroup_mask(int cpu); +void set_power_scale(unsigned int cpu, unsigned long power); #else static inline void init_cpu_topology(void) { } static inline void store_cpu_topology(unsigned int cpuid) { } +static inline void set_power_scale(unsigned int cpu, unsigned long power) { } #endif #include diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 8200dea..00301a7 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -22,6 +22,35 @@ #include #include +/* + * cpu power scale management + */ + +/* + * cpu power table + * This per cpu data structure describes the relative capacity of each core. + * On a heteregenous system, cores don't have the same computation capacity + * and we reflect that difference in the cpu_power field so the scheduler can + * take this difference into account for load balance. A per cpu structure is + * preferred because each cpu is mainly using its own cpu_power even it's not + * always true because of nohz_idle_balance + */ +static DEFINE_PER_CPU(unsigned long, cpu_scale); + +unsigned long arch_scale_freq_power(struct sched_domain *sd, int cpu) +{ + return per_cpu(cpu_scale, cpu); +} + +void set_power_scale(unsigned int cpu, unsigned long power) +{ + per_cpu(cpu_scale, cpu) = power; +} + +/* + * cpu topology management + */ + #define MPIDR_SMP_BITMASK (0x3 << 30) #define MPIDR_SMP_VALUE (0x2 << 30) @@ -41,6 +70,9 @@ #define MPIDR_LEVEL2_MASK 0xFF #define MPIDR_LEVEL2_SHIFT 16 +/* + * cpu topology table + */ struct cputopo_arm cpu_topology[NR_CPUS]; const struct cpumask *cpu_coregroup_mask(int cpu) @@ -134,7 +166,7 @@ void init_cpu_topology(void) { unsigned int cpu; - /* init core mask */ + /* init core mask and power*/ for_each_possible_cpu(cpu) { struct cputopo_arm *cpu_topo = &(cpu_topology[cpu]); @@ -143,6 +175,8 @@ void init_cpu_topology(void) cpu_topo->socket_id = -1; cpumask_clear(&cpu_topo->core_sibling); cpumask_clear(&cpu_topo->thread_sibling); + + per_cpu(cpu_scale, cpu) = SCHED_POWER_SCALE; } smp_wmb(); } -- 1.7.9.5 ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
[RFC 0/4] ARM: topology: set the capacity of each cores for big.LITTLE
This patchset creates an arch_scale_freq_power function for ARM, which is used to set the relative capacity of each core of a big.LITTLE system. Vincent Guittot (4): ARM: topology: Add arch_scale_freq_power function ARM: topology: factorize the update of sibling masks ARM: topology: Update cpu_power according to DT information sched: cpu_power: enable ARCH_POWER arch/arm/include/asm/topology.h |2 + arch/arm/kernel/topology.c | 203 +++ kernel/sched/features.h |2 +- 3 files changed, 185 insertions(+), 22 deletions(-) -- 1.7.9.5 ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
[RFC 3/4] ARM: topology: Update cpu_power according to DT information
Use cpu compatibility field and clock-frequency field of DT to estimate the capacity of each core of the system Signed-off-by: Vincent Guittot --- arch/arm/kernel/topology.c | 122 1 file changed, 122 insertions(+) diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 2f85a64..0c2aee4 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -47,6 +48,122 @@ void set_power_scale(unsigned int cpu, unsigned long power) per_cpu(cpu_scale, cpu) = power; } +#ifdef CONFIG_OF +struct cpu_efficiency { + const char *compatible; + unsigned long efficiency; +}; + +/* + * Table of relative efficiency of each processors + * The efficiency value must fit in 20bit. The final + * cpu_scale value must be in the range [1:2048[. + * Processors that are not defined in the table, + * use the default SCHED_POWER_SCALE value for cpu_scale. + */ +struct cpu_efficiency table_efficiency[] = { + {"arm,cortex-a15", 3891}, + {"arm,cortex-a7", 2048}, + {NULL, }, +}; + +struct cpu_capacity { + unsigned long hwid; + unsigned long capacity; +}; + +struct cpu_capacity cpu_capacity[NR_CPUS]; + +unsigned long middle_capacity = 1; + +static void __init parse_dt_topology(void) +{ + struct cpu_efficiency *cpu_eff; + struct device_node *cn = NULL; + unsigned long min_capacity = (unsigned long)(-1); + unsigned long max_capacity = 0; + unsigned long capacity = 0; + int cpu = 0; + + while ((cn = of_find_node_by_type(cn, "cpu"))) { + const u32 *rate, *reg; + char *compatible; + int len; + + if (cpu >= num_possible_cpus()) + break; + + compatible = of_get_property(cn, "compatible", &len); + + for (cpu_eff = table_efficiency; cpu_eff->compatible; cpu_eff++) + if (of_device_is_compatible(cn, cpu_eff->compatible)) + break; + + if (cpu_eff->compatible == NULL) + continue; + + rate = of_get_property(cn, "clock-frequency", &len); + if (!rate || len != 4) { + pr_err("%s missing clock-frequency property\n", + cn->full_name); + continue; + } + + reg = of_get_property(cn, "reg", &len); + if (!reg || len != 4) { + pr_err("%s missing reg property\n", cn->full_name); + continue; + } + + capacity = ((be32_to_cpup(rate)) >> 20) + * cpu_eff->efficiency; + + /* Save min capacity of the system */ + if (capacity < min_capacity) + min_capacity = capacity; + + /* Save max capacity of the system */ + if (capacity > max_capacity) + max_capacity = capacity; + + cpu_capacity[cpu].capacity = capacity; + cpu_capacity[cpu++].hwid = be32_to_cpup(reg); + } + + if (cpu < num_possible_cpus()) + cpu_capacity[cpu].hwid = (unsigned long)(-1); + + middle_capacity = (min_capacity + max_capacity) >> 11; +} + +void update_cpu_power(unsigned int cpu, unsigned long hwid) +{ + unsigned int idx = 0; + + /* look for the cpu's hwid in the cpu capacity table */ + for (idx = 0; idx < num_possible_cpus(); idx++) { + if (cpu_capacity[idx].hwid == hwid) + break; + + if (cpu_capacity[idx].hwid == -1) + return; + } + + if (idx == num_possible_cpus()) + return; + + set_power_scale(cpu, cpu_capacity[idx].capacity / middle_capacity); + + printk(KERN_INFO "CPU%u: update cpu_power %lu\n", + cpu, arch_scale_freq_power(NULL, cpu)); +} + +#else +static inline void parse_dt_topology(void) {} +static inline void update_cpu_power(unsigned int cpuid, unsigned int mpidr) {} +#endif + + /* * cpu topology management */ @@ -60,6 +177,7 @@ void set_power_scale(unsigned int cpu, unsigned long power) * These masks reflect the current use of the affinity levels. * The affinity level can be up to 16 bits according to ARM ARM */ +#define MPIDR_HWID_BITMASK 0xFF #define MPIDR_LEVEL0_MASK 0x3 #define MPIDR_LEVEL0_SHIFT 0 @@ -157,6 +275,8 @@ void store_cpu_topology(unsigned int cpuid) update_siblings_masks(cpuid); + update_cpu_power(cpuid, mpidr & MPIDR_HWID_BITMASK); + printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n", cpuid, cpu_topology[cpuid].thread_id, cpu_topology[cpuid].core_id, @@ -184,4 +304,6 @@ void init_cpu_topology(void)
[RFC 2/4] ARM: topology: factorize the update of sibling masks
The factorization has also be proposed in another patch that is not merge yet. http://lists.infradead.org/pipermail/linux-arm-kernel/2012-January/080873.html So it could be dropped depending of the state of the other patch. Signed-off-by: Lorenzo Pieralisi Signed-off-by: Vincent Guittot --- arch/arm/kernel/topology.c | 47 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 00301a7..2f85a64 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -80,6 +80,31 @@ const struct cpumask *cpu_coregroup_mask(int cpu) return &cpu_topology[cpu].core_sibling; } +void update_siblings_masks(unsigned int cpuid) +{ + struct cputopo_arm *cpu_topo, *cpuid_topo = &cpu_topology[cpuid]; + int cpu; + /* update core and thread sibling masks */ + for_each_possible_cpu(cpu) { + cpu_topo = &cpu_topology[cpu]; + + if (cpuid_topo->socket_id == cpu_topo->socket_id) { + cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); + if (cpu != cpuid) + cpumask_set_cpu(cpu, &cpuid_topo->core_sibling); + + if (cpuid_topo->core_id == cpu_topo->core_id) { + cpumask_set_cpu(cpuid, + &cpu_topo->thread_sibling); + if (cpu != cpuid) + cpumask_set_cpu(cpu, + &cpuid_topo->thread_sibling); + } + } + } + smp_wmb(); +} + /* * store_cpu_topology is called at boot when only one cpu is running * and with the mutex cpu_hotplug.lock locked, when several cpus have booted, @@ -89,7 +114,6 @@ void store_cpu_topology(unsigned int cpuid) { struct cputopo_arm *cpuid_topo = &cpu_topology[cpuid]; unsigned int mpidr; - unsigned int cpu; /* If the cpu topology has been already set, just return */ if (cpuid_topo->core_id != -1) @@ -131,26 +155,7 @@ void store_cpu_topology(unsigned int cpuid) cpuid_topo->socket_id = -1; } - /* update core and thread sibling masks */ - for_each_possible_cpu(cpu) { - struct cputopo_arm *cpu_topo = &cpu_topology[cpu]; - - if (cpuid_topo->socket_id == cpu_topo->socket_id) { - cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); - if (cpu != cpuid) - cpumask_set_cpu(cpu, - &cpuid_topo->core_sibling); - - if (cpuid_topo->core_id == cpu_topo->core_id) { - cpumask_set_cpu(cpuid, - &cpu_topo->thread_sibling); - if (cpu != cpuid) - cpumask_set_cpu(cpu, - &cpuid_topo->thread_sibling); - } - } - } - smp_wmb(); + update_siblings_masks(cpuid); printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n", cpuid, cpu_topology[cpuid].thread_id, -- 1.7.9.5 ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: Linaro recommended (tm) brand of SD card?
On Monday 11 June 2012, David Brown wrote: > 4MB variant: > == 2 == > 4MiB4.05M/s > 2MiB6.13M/s > 1MiB6.19M/s > 512KiB 6.14M/s > 256KiB 5.27M/s > 128KiB 4.59M/s > 64KiB 6M/s > 32KiB 5.04M/s > 16KiB 490K/s > == 3 == > 4MiB5.06M/s > 2MiB3.93M/s > 1MiB1.72M/s > 512KiB 1.51M/s > 256KiB 449K/s > 128KiB 206K/s > 64KiB 1.2M/s > 32KiB 1.23M/s > 16KiB 1.66M/s > == 30 == > 4MiB6.66M/s > 2MiB3.29M/s > 1MiB1.64M/s > 512KiB 821K/s > 256KiB 408K/s > 128KiB 204K/s > 64KiB 104K/s > 32KiB 149K/s > 16KiB 660K/s Ok, thank you very much! This confirms that it is the same as my 8 GB essential card, and I would not recommend using this kind of card in production systems with an ext4 or similar file system. >From what I can tell, all the good Samsung cards are marked "Made in Korea" while all the bad ones are "Made in Taiwan". I would not treat this as 100% reliable information as those things tend to change over time, but it's certainly a good indication. Arnd ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [PATCH] perf report: fix event name reporting
Em Tue, Jun 12, 2012 at 03:34:22PM +0900, Namhyung Kim escreveu: > On Mon, 11 Jun 2012 11:14:16 -0300, Arnaldo Carvalho de Melo wrote: > > Em Fri, Jun 08, 2012 at 04:23:27PM +0400, Dmitry Antipov escreveu: > >> Use trace_find_event to find event name before looking through > >> /sys files. This helps 'perf report' to show real event names > >> instead of 'unknown:unknown' when processing perf.data recorded > >> on another machine. > > > > We have to somehow tell perf_evlist__tty_browse_hists that it should try > > to figure out the name of the event by looking at _either_ /sys (local > > events) or what came in the perf.data file. > > > > That is because 'perf top' and 'perf report' uses > > perf_evlist__tty_browse_hists. One is for local events (top) and the > > other for perf.data files, that may or not be for local (in the sense of > > running the same kernel for record + report) or for "remote" (running on > > the same machine but with a different kernel at record than the one used > > at report) or from a different machine altogether, perhaps even > > different arch. > > I just thought that we should always consider the remote case first and > falls back to local case because if we looked for local events, the > remote events (perf.data) would not exist so that it can falls to the > local case safely. > > Now I think that we need a session method to check whether the current > session is local or remote, and acts something based on that info. We just need to get the data from the perf.data file as early as possible, i.e. just after processing the perf.data headers, like in the attached patch. Dmitry, can you please try it? - Arnaldo >From cb9dd49e11f83d548c822d7022ac180b0518b25c Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 11 Jun 2012 19:03:32 -0300 Subject: [PATCH 1/1] perf tools: Fix synthesizing tracepoint names from the perf.data headers Content-Type: text/plain; charset="UTF-8" We need to use the per event info snapshoted at record time to synthesize the events name, so do it just after reading the perf.data headers, when we already processed the /sys events data, otherwise we'll end up using the local /sys that only by sheer luck will have the same tracepoint ID -> real event association. Example: # uname -a Linux felicio.ghostprotocols.net 3.4.0-rc5+ #1 SMP Sat May 19 15:27:11 BRT 2012 x86_64 x86_64 x86_64 GNU/Linux # perf record -e sched:sched_switch usleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.015 MB perf.data (~648 samples) ] # cat /t/events/sched/sched_switch/id 279 # perf evlist -v sched:sched_switch: sample_freq=1, type: 2, config: 279, size: 80, sample_type: 1159, read_format: 7, disabled: 1, inherit: 1, mmap: 1, comm: 1, enable_on_exec: 1, sample_id_all: 1, exclude_guest: 1 # So on the above machine the sched:sched_switch has tracepoint id 279, but on the machine were we'll analyse it it has a different id: $ cat /t/events/sched/sched_switch/id 56 $ perf evlist -i /tmp/perf.data kmem:mm_balancedirty_writeout $ cat /t/events/kmem/mm_balancedirty_writeout/id 279 With this fix: $ perf evlist -i /tmp/perf.data sched:sched_switch Reported-by: Dmitry Antipov Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-auwks8fpuhmrdpiefs55o...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/header.c | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 4f9b247..e909d43 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2093,6 +2093,35 @@ static int read_attr(int fd, struct perf_header *ph, return ret <= 0 ? -1 : 0; } +static int perf_evsel__set_tracepoint_name(struct perf_evsel *evsel) +{ + struct event_format *event = trace_find_event(evsel->attr.config); + char bf[128]; + + if (event == NULL) + return -1; + + snprintf(bf, sizeof(bf), "%s:%s", event->system, event->name); + evsel->name = strdup(bf); + if (event->name == NULL) + return -1; + + return 0; +} + +static int perf_evlist__set_tracepoint_names(struct perf_evlist *evlist) +{ + struct perf_evsel *pos; + + list_for_each_entry(pos, &evlist->entries, node) { + if (pos->attr.type == PERF_TYPE_TRACEPOINT && + perf_evsel__set_tracepoint_name(pos)) + return -1; + } + + return 0; +} + int perf_session__read_header(struct perf_session *session, int fd) { struct perf_header *header = &session->header; @@ -2174,6 +2203,9 @@ int perf_session__read_header(struct perf_session *session, int fd) lseek(fd, header->data_offset, SEEK_SET); + if (perf_evlist__set
Re: Linaro recommended (tm) brand of SD card?
On Tue, Jun 12, 2012 at 02:47:31PM +, Arnd Bergmann wrote: > Ok, thank you very much! > > This confirms that it is the same as my 8 GB essential card, and I would > not recommend using this kind of card in production systems with an ext4 > or similar file system. > > From what I can tell, all the good Samsung cards are marked "Made in > Korea" while all the bad ones are "Made in Taiwan". I would not treat > this as 100% reliable information as those things tend to change over > time, but it's certainly a good indication. Unfortunately, I haven't figured out a way of telling this before buying them. Occasionally, a vendor will have photos detailed enough to show the back, but they don't always even deliver that particular card. Thanks, David -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Linaro Android Platform Team Agenda Posted
Hey yall, Posted the agenda for the Linaro Android Platform team meeting. https://wiki.linaro.org/Platform/Android/Meetings/2012-06-13 Feel free to add to it. If you're a Linaro Android team member, please fill in your status before the meeting. See ya in #linaro-meeting @ 14:00 UTC on irc.freenode.net tomorrow (Jun 13th) or later today, depending on where you are. :) -- Zach Pfeffer Android Platform Team Lead, Linaro Platform Teams Linaro.org | Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [PATCH] perf sched replay: fix event lookup
Em Tue, Jun 12, 2012 at 03:01:26PM +0900, Namhyung Kim escreveu: > Hi, > > On Mon, 11 Jun 2012 11:08:52 -0300, Arnaldo Carvalho de Melo wrote: > > Em Mon, Jun 11, 2012 at 02:46:02PM +0900, Namhyung Kim escreveu: > >> On Sat, 9 Jun 2012 13:05:58 +0400, Dmitry Antipov wrote: > >> > Use new function trace_find_event_by_name to lookup events before > >> > looking through /sys files. This helps 'perf sched replay' to map > >> > event names to IDs correctly when processing perf.data recorded > >> > on another machine. > >> > >> Basically the same approach with the previous reply, please put this > >> into trace_event__id(). And minor nits below.. > > > > Well, trace_event__id() is private to evlist and evlist so far is a > > local thing, i.e. it doesn't know anything about perf.data files. > > > > Really? I see that perf_session__open make up an evlist for the session > and a tracepoint event in the evlist should look up the perf.data > first. As this patch addressed, perf sched replay dealt with the > session->evlist already. Am I missing something? I sent a patch fixing it, basically after creating the evlist in perf_session__open it will traverse it, looking up the pevents list created while processing the trace feature section in the header, setting up evsel->name properly. > > So I think we should have a per perf.data (perf_session) method that > > knows that it shouldn't look _at all_ to /sys, but just at what came in > > the perf.data file. > > > > Fair enough. The method should be a simple wrapper to libtraceevent APIs > like this patch. Right, that is what it does. > > > As well when we want something that is on the running machine, even if > > we're dealing somehow with a perf.data file, we shouldn't use what is in > > it. > > > > That's the current behavior of the trace_event__id(). Do you want to > make it public? No need for it, the only users should be inside evsel.c. - Arnaldo ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev