This patch series adds support for DRM FIMD DT for Exynos4 DT Machines,
specifically for Exynos4412 SoC.
changes since v5:
- renamed the fimd binding documentation file name as "samsung.fimd.txt",
since it not only talks about exynos display controller but also about
previous samsung display controllers.
- rephrased an abmigious statement about the interrupt combiner in the
fimd binding documentation as pointed out by
Sachin Kamat <sachin.kamat.linaro.org>
changes since v4:
- moved the fimd binding documentation to Documentation/devicetree/bindings/video/
as suggested by Sylwester Nawrocki <sylvester.nawrocki(a)gmail.com>
- added more fimd compatiblity strings in fimd documentation as
discussed at https://patchwork.kernel.org/patch/2144861/ with
Sylwester Nawrocki <sylvester.nawrocki(a)gmail.com> and
Tomasz Figa <tomasz.figa(a)gmail.com>
- modified compatible string for exynos4 fimd as "exynos4210-fimd"
exynos5 fimd as "exynos5250-fimd" to stick to the rule that compatible
value should be named after first specific SoC model in which this
particular IP version was included as discussed at
https://patchwork.kernel.org/patch/2144861/
- documented more about the interrupt combiner and their order as
suggested by Sylwester Nawrocki <sylvester.nawrocki(a)gmail.com>
changes since v3:
- rebased on
http://git.kernel.org/?p=linux/kernel/git/kgene/linux-samsung.git;a=shortlo…
changes since v2:
- added alias to 'fimd@11c00000' node
(reported by: Rahul Sharma <r.sh.open(a)gmail.com>)
- removed 'lcd0_data' node as there was already a similar node lcd_data24
(reported by: Jingoo Han <jg1.han(a)samsung.com>
- replaced spaces with tabs in display-timing node
changes since v1:
- added new patch to add FIMD DT binding Documentation
- removed patch enabling SAMSUNG_DEV_BACKLIGHT and SAMSUNG_DEV_PMW
for mach-exynos4 DT
- added 'status' property to fimd DT node
Is based on branch "for-next-next"
http://git.kernel.org/?p=linux/kernel/git/kgene/linux-samsung.git;a=shortlo…
Sachin Kamat (1):
ARM: dts: Add lcd pinctrl node entries for EXYNOS4412 SoC
Vikas Sajjan (4):
ARM: dts: Add FIMD node to exynos4
ARM: dts: Add FIMD node and display timing node to
exynos4412-origen.dts
ARM: dts: add FIMD AUXDATA node entry for exynos4 DT
ARM: dts: Add FIMD DT binding Documentation
.../devicetree/bindings/video/samsung-fimd.txt | 54 ++++++++++++++++++++
arch/arm/boot/dts/exynos4.dtsi | 7 +++
arch/arm/boot/dts/exynos4412-origen.dts | 22 ++++++++
arch/arm/boot/dts/exynos4x12-pinctrl.dtsi | 14 +++++
arch/arm/mach-exynos/mach-exynos4-dt.c | 2 +
5 files changed, 99 insertions(+)
create mode 100644 Documentation/devicetree/bindings/video/samsung-fimd.txt
--
1.7.9.5
My first post in to the mailing list.
Deep power idle state is nothing but CPU power domain off. Its not impossible but would require some hw change.
If kernel is aware of a CPU being in power off state, can we first do a CPU wakeup before issuing SGI.
The wakeup routine has to be implemented by SoC provider as it will be different for each vendor.
Regds
Shakti
Sent from my Nokia Lumia 920
________________________________
From: Santosh Shilimkar<mailto:santosh.shilimkar@ti.com>
Sent: 2/26/2013 10:00 PM
To: Daniel Lezcano<mailto:daniel.lezcano@linaro.org>
Cc: jacob.jun.pan(a)linux.intel.com<mailto:jacob.jun.pan@linux.intel.com>; Russell King - ARM Linux<mailto:linux@arm.linux.org.uk>; linus.walleij(a)stericsson.com<mailto:linus.walleij@stericsson.com>; linux-pm(a)vger.kernel.org<mailto:linux-pm@vger.kernel.org>; viresh.kumar(a)linaro.org<mailto:viresh.kumar@linaro.org>; patches(a)linaro.org<mailto:patches@linaro.org>; linux-kernel(a)vger.kernel.org<mailto:linux-kernel@vger.kernel.org>; linaro-kernel(a)lists.linaro.org<mailto:linaro-kernel@lists.linaro.org>; linux-arm-kernel(a)lists.infradead.org<mailto:linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 0/4] time: dynamic irq affinity
On Wednesday 27 February 2013 03:47 AM, Daniel Lezcano wrote:
> When a cpu goes to a deep idle state where its local timer is shutdown,
> it notifies the time framework to use the broadcast timer instead.
>
> Unfortunately, the broadcast device could wake up any CPU, including an
> idle one which is not concerned by the wake up at all.
>
> This implies, in the worst case, an idle CPU will wake up to send an IPI
> to another idle cpu.
>
> This patch solves this by setting the irq affinity to the cpu concerned
> by the nearest timer event, by this way, the CPU which is wake up is
> guarantee to be the one concerned by the next event and we are safe with
> unnecessary wakeup for another idle CPU.
>
> As the irq affinity is not supported by all the archs, a flag is needed
> to specify which clocksource can handle it.
>
Not completely related to this series but there is another
issue where this local timer not wakeup capable hurts. So
far we are discussing only the timer related future events
which are known and can be programmed with broadcast device.
But think of the scenario's where we need to send asynchronous
IPIs to CPUs to do some work. e.g generic_exec_single().
If the CPU which is suppose to be available after IPI call
is in deep low power state, then the IPI(implemented on ARM)
isn't effective. In CPU off idle modes, a GIC SGI will not wake
the CPU and hence a special wakeup is needed to bring out
those CPUs out of idle. This special wakeup is handled
by broad-cast timer in case of CPUIDLE.
In short what I mean is, you need to have IPI which
can wakeup CPUs from any deep idle power state to address
above. Has anybody thought of this one ?
Regards,
Santosh
P.S: Time and again it proves that making the local timer wakeup
capable solves the issue.
_______________________________________________
linaro-kernel mailing list
linaro-kernel(a)lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-kernel
Hi All,
I am new on this mailing list, I browsed archive against vmcore but
got no hit so the question here.
I am running
./Foundation_v8pkg/Foundation_v8 \
--image ./img-foundation.axf \
--block-device ./vexpress64-openembedded_sdk-armv8_20130127-242.img \
--network=nat
That gives
Linux genericarmv8 3.8.0-1-linaro-vexpress64 #1ubuntu1~ci+130127041142
SMP Sun Jan 27 04:15:58 UTC 2013 aarch64 GNU/Linux
root@genericarmv8:/usr#
I am doing some linux crashdump analysis tools, and I'd like to
prepare the future.
At the moment I am not sure how to obtain an aa64 linux crashdump
(vmcore), as I got no HW then no distro.
I was wondering, is it possible to send a signal to the Foundation_v8
and then got a copy of the guest emulated main memory ? along with a
savestate per cpu ?
And to make this usable, is there a way to obtain the vmlinux (and
possibly modules) a.out non stripped with debuginfos that was used to
obtain the img.axf (abd the modules in the .img if any)
If this is not doable with file on the server used during the build of
./img-foundation.axf and
./vexpress64-openembedded_sdk-armv8_20130127-242.img
then may be I got to expliclty build my own .axf .img and keep the
debuginfo from this build.
Any advises appreciated.
Thank you for the linaro that booted straightaway.
Cheers,
Phi
Hi Tixy,
Yes, I have tried both the config in the release notes as well as
configurations to boot A7.
The configurations to boot A7 hang while executing the BOOTSCRIPT.
The release note configurations get past that state, boot up the kernel and
hang as shown in this thread.
As a first step, I am just trying to get the release note configuration
working without the hang.
Thanks
Dinesh
On Tue, Feb 26, 2013 at 9:43 AM, Jon Medhurst (Tixy) <tixy(a)linaro.org>wrote:
> On Tue, 2013-02-26 at 09:24 -0800, D D wrote:
> > Thanks Tixy, I tried 0x0032F003, but still seeing the same hang.
> > Looks like 0x0032F003 powers down the non boot cluster (in this case
> > A7), while I wanted to try running with the A7s online. That was the
> > reason why I was trying to boot with 0x00320003.
>
> So you have other config changes to get the board booting on A7? I've
> never tried to do that.
>
> Does the config produced by our release notes work for you? (Which will
> boot on the A15's.)
>
> I'm trying to understand if we're debugging a problem with the Linaro
> release, or debugging whatever modified setup you have.
>
> --
> Tixy
>
>
>
Lorenzo,
Looking in the cpuidle code in Linaro's 13.01 kernel, there are only two idle states supported in the cpuidle/arm_big_little.c, one is WFI, the other is C1. So to have more than these 2 idle states supported on a SoC, it looks like I have to create SoC specific CPU idle driver to replace the arm_big_little.c. Is this the intended design? It would be better if there is a way the arm_big_little.c can support SoC specific idle sets, via device tree maybe?
Eric Huang
Currently MIN_LATENCY_MULTIPLIER is set defined as 100 and so on a system with
transition latency of 1 ms, the minimum sampling time comes to be around 100 ms.
That is quite big if you want to get better performance for your system.
Redefine MIN_LATENCY_MULTIPLIER to 20 so that we can support 20ms sampling rate
for such platforms.
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
Hi Guys,
I really don't know how this figure (100) came initially, but we really need to
have 20ms support for my platform: ARM TC2.
Pushed here:
http://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/h…
drivers/cpufreq/cpufreq_governor.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h
index d2ac911..adb8e30 100644
--- a/drivers/cpufreq/cpufreq_governor.h
+++ b/drivers/cpufreq/cpufreq_governor.h
@@ -34,7 +34,7 @@
*/
#define MIN_SAMPLING_RATE_RATIO (2)
#define LATENCY_MULTIPLIER (1000)
-#define MIN_LATENCY_MULTIPLIER (100)
+#define MIN_LATENCY_MULTIPLIER (20)
#define TRANSITION_LATENCY_LIMIT (10 * 1000 * 1000)
/* Ondemand Sampling types */
--
1.7.12.rc2.18.g61b472e
=== Highlights ===
* Flew to SF and presented at ABS, then flew back home on Monday.
Slides are here:
http://events.linuxfoundation.org/images/stories/slides/abs2013_stultz.pdf
* Spurred by discussion at ABS, worked out how to get ADB running on
vanilla linux:
https://plus.google.com/u/0/111524780435806926688/posts/AaEccFjKNHE
* My discussion proposal for lsf/mm-minisummit on volatile ranges was
accepted and I was formally invited to attend
* Discussed Serbans' ashmem compat_ioctl patches with Arve and Serban.
* Sent out late android upstreaming subteam mail
* Synced up with Jakub on Android Upstreaming session at connect
* Got my 3.9 timekeeping queue merged upstream, and reviewed and queued
a number of timekeeping patches for 3.10
* Discussed some timekeeping changes with tglx, and reviewed some of his
patches.
* Implemented a first pass at using valid-cycle-ranges with vdso based
gettime calls to avoid potential race windows with virtualized kernels.
This will allow for reduced lock hold times in the future.
=== Plans ===
* Review Serban's binder patches
* Look into Androids support of large-files with 32bit applications
* Send out sync driver for staging (as I've not heard back from Erik or
other folks at Google)
* Prep for Connect
=== Issues ===
* NA
=== David Long ===
=== Travel/Time Off ===
* Monday February 18th (U.S. Washington's Birthday, aka President's Day)
=== Highlights ===
* I'm dealing with problems getting the uprobe uprobe patch to
correctly process the breakpoint. I see the breakpoint being placed
but the result when it hits it seems to be corrupted context.
* I received email back from Rabin Vincent saying he had no plans to
work on this any more and he is happy if I want to take it over. He
has volunteered to supply his tests, which I hope to see shortly.
=== Plans ===
* Debug the problems I'm experiencing with the patch, then move on to
addressing the upstream concerns about its integration.
=== Issues ===
-dl
On 64-bit platforms, reads/writes of the various cpustat fields are
atomic due to native 64-bit loads/stores. However, on non 64-bit
platforms, reads/writes of the cpustat fields are not atomic and could
lead to inconsistent statistics.
This problem was originally reported by Frederic Weisbecker as a
64-bit limitation with the nsec granularity cputime accounting for
full dynticks, but then we realized that it's a problem that's been
around for awhile and not specific to the new cputime accounting.
This series fixes this by first converting all access to the cputime
fields to use accessor functions, and then converting the accessor
functions to use the atomic64 functions.
Implemented based on idea proposed by Frederic Weisbecker.
Kevin Hilman (2):
cpustat: use accessor functions for get/set/add
cpustat: convert to atomic operations
arch/s390/appldata/appldata_os.c | 16 +++++++--------
drivers/cpufreq/cpufreq_governor.c | 18 ++++++++---------
drivers/cpufreq/cpufreq_ondemand.c | 2 +-
drivers/macintosh/rack-meter.c | 6 +++---
fs/proc/stat.c | 40 +++++++++++++++++++-------------------
fs/proc/uptime.c | 2 +-
include/linux/kernel_stat.h | 11 ++++++++++-
kernel/sched/core.c | 12 +++++-------
kernel/sched/cputime.c | 29 +++++++++++++--------------
9 files changed, 70 insertions(+), 66 deletions(-)
--
1.8.1.2
== Linus Walleij linusw ==
=== Highlights ===
* Finalized a GPIO+pinctrl presentation for the Embedded Linux
Conference, and presented on the first day of the conference.
Slides will be posted.
* Finalized the pinctrl tree before traveling, sent a pull request to
Torvalds as soon as the merge window opened and he pulled it
in.
* AB8500 GPIO patches and all other cleanup has been merged
up to the pinctrl and ARM SoC trees and pulled in by Torvalds.
MFD is pending but Sam has sent a pull request for this part as
well.
* Other queued fixes for mach-ux500 and also the PCI regression
fix has propagated upstream.
* Reviewed misc GPIO, pinctrl and other patches, updated
blueprints...
=== Plans ===
* Fix regressions popping up in the merge window.
There are always such...
* Attack the remaining headers in arch/arm/mach-ux500
so we can move forward with multiplatform for v3.9.
* Convert the Nomadik to multiplatform.
* Convert Nomadik pinctrl driver to register GPIO ranges
from the gpiochip side.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Get hands dirty with regmap.
=== Issues ===
* N/A
Thanks,
Linus Walleij
Since ARMv6 new atomic instructions have been introduced:
ldrex/strex. Several implementation are possible based on (1) global
and local exclusive monitors and (2) local exclusive monitor and snoop
unit.
In case of the 2nd options exclusive store operation on uncached
region may be faulty.
Check for availability of global monitor to provide some hint about
possible issues.
Signed-off-by: Vladimir Murzin <murzin.v(a)gmail.com>
---
Changes since
v1:
- Using L_PTE_MT_BUFFERABLE instead of L_PTE_MT_UNCACHABLE
Thanks to Russell for ponting this silly error
- added comment about how checking is done
arch/arm/include/asm/bugs.h | 14 +++++++++--
arch/arm/mm/fault-armv.c | 55 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 67 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/bugs.h b/arch/arm/include/asm/bugs.h
index a97f1ea..29d73cd 100644
--- a/arch/arm/include/asm/bugs.h
+++ b/arch/arm/include/asm/bugs.h
@@ -13,9 +13,19 @@
#ifdef CONFIG_MMU
extern void check_writebuffer_bugs(void);
-#define check_bugs() check_writebuffer_bugs()
+#if __LINUX_ARM_ARCH__ < 6
+static void check_gmonitor_bugs(void) {};
#else
-#define check_bugs() do { } while (0)
+extern void check_gmonitor_bugs(void);
+#endif
+
+static inline void check_bugs(void)
+{
+ check_writebuffer_bugs();
+ check_gmonitor_bugs();
+}
+#else
+static inline void check_bugs(void) { }
#endif
#endif
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index 2a5907b..6a1a07e 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -205,6 +205,61 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
__flush_icache_all();
}
}
+#else
+/*
+ * Check for the global exclusive monitor. The global monitor is a external
+ * transaction monitoring block for tracking exclusive accesses to sharable
+ * memory regions. LDREX/STREX rely on this monitor when accessing uncached
+ * shared memory.
+ * If global monitor is not implemented STREX operation on uncached shared
+ * memory region always fail, returning 0 in the destination register.
+ * We rely on this property to check whether global monitor is implemented
+ * or not.
+ * NB: The name of L_PTE_MT_BUFFERABLE is not for B bit, but for normal
+ * non-cacheable memory type (XXCB = 0001).
+ */
+void __init check_gmonitor_bugs(void)
+{
+ struct page *page;
+ const char *reason;
+ unsigned long res = 1;
+
+ printk(KERN_INFO "CPU: Testing for global monitor: ");
+
+ page = alloc_page(GFP_KERNEL);
+ if (page) {
+ unsigned long *p;
+ pgprot_t prot = __pgprot_modify(PAGE_KERNEL,
+ L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE);
+
+ p = vmap(&page, 1, VM_IOREMAP, prot);
+
+ if (p) {
+ int temp, res;
+
+ __asm__ __volatile__(
+ "ldrex %1, [%2]\n"
+ "strex %0, %1, [%2]"
+ : "=&r" (res), "=&r" (temp)
+ : "r" (p)
+ : "cc", "memory");
+
+ reason = "n/a (atomic ops may be faulty)";
+ } else {
+ reason = "unable to map memory\n";
+ }
+
+ vunmap(p);
+ put_page(page);
+ } else {
+ reason = "unable to grab page\n";
+ }
+
+ if (res)
+ printk("failed, %s\n", reason);
+ else
+ printk("ok\n");
+}
#endif /* __LINUX_ARM_ARCH__ < 6 */
/*
--
1.7.10.4
Thanks for review Russel!
On Mon, Feb 18, 2013 at 04:44:20PM +0000, Russell King - ARM Linux wrote:
> On Mon, Feb 18, 2013 at 08:26:50PM +0400, Vladimir Murzin wrote:
> > Since ARMv6 new atomic instructions have been introduced:
> > ldrex/strex. Several implementation are possible based on (1) global
> > and local exclusive monitors and (2) local exclusive monitor and snoop
> > unit.
> >
> > In case of the 2nd option exclusive store operation on uncached
> > region may be faulty.
> >
> > Check for availability of the global monitor to provide some hint about
> > possible issues.
>
> How does this code actually do that?
According to DHT0008A_arm_synchronization_primitives.pdf the global
monitor is introduce to track exclusive accesses to sharable memory
regions. This article also says about some system-wide implication
which should be taken into account:
(1) for systems with coherency management
(2) for systems without coherency management
The first one lay on SCU, L1 data cache and local monitor. The second
one requires implementation of global monitor if memory regions cannot
be cached.
It set up the behaviour for store-exclusive operations when global
monitor is not available: these operations always fail.
Taking all these into account we can guess about availability of global
monitor by using store-exclusive operation on uncached memory region.
>
> > +void __init check_gmonitor_bugs(void)
> > +{
> > + struct page *page;
> > + const char *reason;
> > + unsigned long res = 1;
> > +
> > + printk(KERN_INFO "CPU: Testing for global monitor: ");
> > +
> > + page = alloc_page(GFP_KERNEL);
> > + if (page) {
> > + unsigned long *p;
> > + pgprot_t prot = __pgprot_modify(PAGE_KERNEL,
> > + L_PTE_MT_MASK, L_PTE_MT_UNCACHED);
> > +
> > + p = vmap(&page, 1, VM_IOREMAP, prot);
>
> This is bad practise. Remapping a page of already mapped kernel memory
> using different attributes (in this case, strongly ordered) is _definitely_
> a violation of the architecture requirements. The behaviour you will see
> from this are in no way guaranteed.
DDI0406C_arm_architecture_reference_manual.pdf (A3-131) says:
A memory location can be marked as having different cacheability
attributes, for example when using aliases in a
virtual to physical address mapping:
* if the attributes differ only in the cache allocation hint this does
not affect the behavior of accesses to that location
* for other cases see Mismatched memory attributes on page A3-136.
Isn't L_PTE_MT_UNCACHED about cache allocation hint?
>
> If you want to do this, it must either come from highmem, or not already
> be mapped.
>
> Moreover, this is absolutely silly - the ARM ARM says:
>
> "LDREX and STREX operations *must* be performed only on memory with the
> Normal memory attribute."
DDI0406C_arm_architecture_reference_manual.pdf (A3-121) says:
It is IMPLEMENTATION DEFINED whether LDREX and STREX operations can be
performed to a memory region with the Device or Strongly-ordered
memory attribute. Unless the implementation documentation explicitly
states that LDREX and STREX operations to a memory region with the
Device or Strongly-ordered attribute are permitted, the effect of such
operations is UNPREDICTABLE.
At least it allows to perform operations on memory region with the
Strongly-ordered attribute... but still unpredictable.
>
> L_PTE_MT_UNCACHED doesn't get you that. As I say above, that gets you
> strongly ordered memory, not "normal memory" as required by the
> architecture for use with exclusive types.
>
> > +
> > + if (p) {
> > + int temp;
> > +
> > + __asm__ __volatile__( \
> > + "ldrex %1, [%2]\n" \
> > + "strex %0, %1, [%2]" \
> > + : "=&r" (res), "=&r" (temp) \
> > + : "r" (p) \
>
> \ character not required for any of the above. Neither is the __ version
> of "asm" and "volatile".
Thanks.
>
> > + : "cc", "memory");
> > +
> > + reason = "n\\a (atomic ops may be faulty)";
>
> "n\\a" ?
"not detected"?
> So... at the moment this has me wondering - you're testing atomic
> operations with a strongly ordered memory region, which ARM already
> define this to be outside of the architecture spec. The behaviour you
> see is not defined architecturally.
>
> And if you're trying to use LDREX/STREX to a strongly ordered or device
> memory region, then you're quite right that it'll be unreliable. It's
> not defined to even work. That's not because they're faulty, it's because
> you're abusing them.
However, IRL it is not hard to meet this undefined difference. At
least I'm able to see it on Tegra2 Harmony and Pandaboard. Moreover,
demand on Normal memory attribute breaks up ability to turn caches
off. In this case we are not able to boot the system up (seen on
Tegra2 harmony). This patch is aimed to highlight the difference in
implementation. That's why it has some softering in guessing about
faulty. Might be it worth warning about unpredictable effect instead?
Best wishes
Vladimir
On 22 February 2013 08:49, Guenter Roeck <linux(a)roeck-us.net> wrote:
> On Thu, Feb 21, 2013 at 02:24:23PM -0800, Anton Vorontsov wrote:
>> On Thu, Feb 21, 2013 at 06:32:40PM +0800, Hongbo Zhang wrote:
>> > These NTC resistance to temperature tables should be public, so others such as
>> > ab8500 hwmon driver can look up these tables to convert NTC resistance to
>> > temperature.
>> >
>> > Signed-off-by: Hongbo Zhang <hongbo.zhang(a)linaro.org>
>> > ---
>>
>> For 1/3 and 2/3 patches:
>>
>> Acked-by: Anton Vorontsov <anton(a)enomsg.org>
>>
>> (Do you need EXPORT_SYMBOL()? You don't use this from modules?)
>>
> I would think so. Also, the variables should be exported through an include
> file.
>
I have these two lines in drivers/hwmon/ab8500.h,
extern struct abx500_res_to_temp temp_tbl_A_thermistor[];
extern int temp_tbl_A_size;
Do you mean this?
Or do you mean we should create a public header file holding all the tables?
Where to place these tables really baffled me, if the current hwmon
driver is acceptable, I will talk to the ab8500_bmdata.c author to
discuss how to re-arrange all the tables, that should be another patch
in future if possible.
> The variable names are quite generic for global variables; we need to find
> something more specific/descriptive.
>
I noticed this too, this original naming isn't so good, there are also
other names like this.
I will rename these two tables I am using this time.
> There is also some overlap with functionality in drivers/hwmon/ntc_thermistor.c.
> Wonder if it would be possible to unify the code.
>
It seems not so easy to unify the code for me, if necessary and
possible, that should be another dedicated patch I think.
> Guenter
>
>> Thanks.
>>
>> > drivers/power/ab8500_bmdata.c | 8 ++++++--
>> > 1 file changed, 6 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
>> > index f034ae4..53f3324 100644
>> > --- a/drivers/power/ab8500_bmdata.c
>> > +++ b/drivers/power/ab8500_bmdata.c
>> > @@ -11,7 +11,7 @@
>> > * Note that the res_to_temp table must be strictly sorted by falling resistance
>> > * values to work.
>> > */
>> > -static struct abx500_res_to_temp temp_tbl_A_thermistor[] = {
>> > +struct abx500_res_to_temp temp_tbl_A_thermistor[] = {
>> > {-5, 53407},
>> > { 0, 48594},
>> > { 5, 43804},
>> > @@ -29,7 +29,9 @@ static struct abx500_res_to_temp temp_tbl_A_thermistor[] = {
>> > {65, 12500},
>> > };
>> >
>> > -static struct abx500_res_to_temp temp_tbl_B_thermistor[] = {
>> > +int temp_tbl_A_size = ARRAY_SIZE(temp_tbl_A_thermistor);
>> > +
>> > +struct abx500_res_to_temp temp_tbl_B_thermistor[] = {
>> > {-5, 200000},
>> > { 0, 159024},
>> > { 5, 151921},
>> > @@ -47,6 +49,8 @@ static struct abx500_res_to_temp temp_tbl_B_thermistor[] = {
>> > {65, 82869},
>> > };
>> >
>> > +int temp_tbl_B_size = ARRAY_SIZE(temp_tbl_B_thermistor);
>> > +
>> > static struct abx500_v_to_cap cap_tbl_A_thermistor[] = {
>> > {4171, 100},
>> > {4114, 95},
>> > --
>> > 1.8.0
>>
With this patch userland applications that want to maintain the
interactivity/memory allocation cost can use the pressure level
notifications. The levels are defined like this:
The "low" level means that the system is reclaiming memory for new
allocations. Monitoring this reclaiming activity might be useful for
maintaining cache level. Upon notification, the program (typically
"Activity Manager") might analyze vmstat and act in advance (i.e.
prematurely shutdown unimportant services).
The "medium" level means that the system is experiencing medium memory
pressure, the system might be making swap, paging out active file caches,
etc. Upon this event applications may decide to further analyze
vmstat/zoneinfo/memcg or internal memory usage statistics and free any
resources that can be easily reconstructed or re-read from a disk.
The "critical" level means that the system is actively thrashing, it is
about to out of memory (OOM) or even the in-kernel OOM killer is on its
way to trigger. Applications should do whatever they can to help the
system. It might be too late to consult with vmstat or any other
statistics, so it's advisable to take an immediate action.
The events are propagated upward until the event is handled, i.e. the
events are not pass-through. Here is what this means: for example you have
three cgroups: A->B->C. Now you set up an event listener on cgroups A, B
and C, and suppose group C experiences some pressure. In this situation,
only group C will receive the notification, i.e. groups A and B will not
receive it. This is done to avoid excessive "broadcasting" of messages,
which disturbs the system and which is especially bad if we are low on
memory or thrashing. So, organize the cgroups wisely, or propagate the
events manually (or, ask us to implement the pass-through events,
explaining why would you need them.)
Signed-off-by: Anton Vorontsov <anton.vorontsov(a)linaro.org>
Acked-by: Kirill A. Shutemov <kirill(a)shutemov.name>
---
Hi all,
Many thanks for the previous reviews! In this revision:
- Addressed Glauber Costa's comments:
o Use parent_mem_cgroup() instead of own parent function (also suggested
by Kamezawa). This change also affected events distribution logic, so
it became more like memory thresholds notifications, i.e. we deliver
the event to the cgroup where the event originated, not to the parent
cgroup; (This also addreses Kamezawa's remark regarding which cgroup
receives which event.)
o Register vmpressure cgroup file directly in memcontrol.c.
- Addressed Greg Thelen's comments:
o Fixed bool/int inconsistency in the code;
o Fixed nr_scanned accounting;
o Don't use cryptic 's', 'r' abbreviations; get rid of confusing
'window' argument.
- Addressed Kamezawa Hiroyuki's comments:
o Moved declarations from mm/internal.h into linux/vmpressue.h;
o Removed Kconfig symbol. Vmpressure is pretty lightweight (especially
comparing to the memcg accounting). If it ever causes any measurable
performance effect, we want to fix it, not paper it over with a
Kconfig option. :-)
o Removed read operation on pressure_level cgroup file. In apps, we only
use notifications, we don't need the content of the file, so let's
keep things simple for now. Plus this resolves questions like what
should we return there when the system is not reclaiming;
o Reworded documentation;
o Improved comments for vmpressure_prio().
Old changelogs/submissions:
v1: http://lkml.org/lkml/2013/2/10/140
mempressure cgroup: http://lkml.org/lkml/2013/1/4/55
Thanks!
Anton
Documentation/cgroups/memory.txt | 61 +++++++++-
include/linux/vmpressure.h | 47 ++++++++
mm/Makefile | 2 +-
mm/memcontrol.c | 28 +++++
mm/vmpressure.c | 252 +++++++++++++++++++++++++++++++++++++++
mm/vmscan.c | 8 ++
6 files changed, 396 insertions(+), 2 deletions(-)
create mode 100644 include/linux/vmpressure.h
create mode 100644 mm/vmpressure.c
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index addb1f1..0c004de 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -40,6 +40,7 @@ Features:
- soft limit
- moving (recharging) account at moving a task is selectable.
- usage threshold notifier
+ - memory pressure notifier
- oom-killer disable knob and oom-notifier
- Root cgroup has no limit controls.
@@ -65,6 +66,7 @@ Brief summary of control files.
memory.stat # show various statistics
memory.use_hierarchy # set/show hierarchical account enabled
memory.force_empty # trigger forced move charge to parent
+ memory.pressure_level # set memory pressure notifications
memory.swappiness # set/show swappiness parameter of vmscan
(See sysctl's vm.swappiness)
memory.move_charge_at_immigrate # set/show controls of moving charges
@@ -778,7 +780,64 @@ At reading, current status of OOM is shown.
under_oom 0 or 1 (if 1, the memory cgroup is under OOM, tasks may
be stopped.)
-11. TODO
+11. Memory Pressure
+
+The pressure level notifications can be used to monitor the memory
+allocation cost; based on the pressure, applications can implement
+different strategies of managing their memory resources. The pressure
+levels are defined as following:
+
+The "low" level means that the system is reclaiming memory for new
+allocations. Monitoring this reclaiming activity might be useful for
+maintaining cache level. Upon notification, the program (typically
+"Activity Manager") might analyze vmstat and act in advance (i.e.
+prematurely shutdown unimportant services).
+
+The "medium" level means that the system is experiencing medium memory
+pressure, the system might be making swap, paging out active file caches,
+etc. Upon this event applications may decide to further analyze
+vmstat/zoneinfo/memcg or internal memory usage statistics and free any
+resources that can be easily reconstructed or re-read from a disk.
+
+The "critical" level means that the system is actively thrashing, it is
+about to out of memory (OOM) or even the in-kernel OOM killer is on its
+way to trigger. Applications should do whatever they can to help the
+system. It might be too late to consult with vmstat or any other
+statistics, so it's advisable to take an immediate action.
+
+The events are propagated upward until the event is handled, i.e. the
+events are not pass-through. Here is what this means: for example you have
+three cgroups: A->B->C. Now you set up an event listener on cgroups A, B
+and C, and suppose group C experiences some pressure. In this situation,
+only group C will receive the notification, i.e. groups A and B will not
+receive it. This is done to avoid excessive "broadcasting" of messages,
+which disturbs the system and which is especially bad if we are low on
+memory or thrashing. So, organize the cgroups wisely, or propagate the
+events manually (or, ask us to implement the pass-through events,
+explaining why would you need them.)
+
+The file memory.pressure_level is only used to setup an eventfd,
+read/write operations are no implemented.
+
+Test:
+
+ Here is a small script example that makes a new cgroup, sets up a
+ memory limit, sets up a notification in the cgroup and then makes child
+ cgroup experience a critical pressure:
+
+ # cd /sys/fs/cgroup/memory/
+ # mkdir foo
+ # cd foo
+ # cgroup_event_listener memory.pressure_level low &
+ # echo 8000000 > memory.limit_in_bytes
+ # echo 8000000 > memory.memsw.limit_in_bytes
+ # echo $$ > tasks
+ # dd if=/dev/zero | read x
+
+ (Expect a bunch of notifications, and eventually, the oom-killer will
+ trigger.)
+
+12. TODO
1. Add support for accounting huge pages (as a separate controller)
2. Make per-cgroup scanner reclaim not-shared pages first
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h
new file mode 100644
index 0000000..fa84783
--- /dev/null
+++ b/include/linux/vmpressure.h
@@ -0,0 +1,47 @@
+#ifndef __LINUX_VMPRESSURE_H
+#define __LINUX_VMPRESSURE_H
+
+#include <linux/mutex.h>
+#include <linux/list.h>
+#include <linux/workqueue.h>
+#include <linux/gfp.h>
+#include <linux/types.h>
+#include <linux/cgroup.h>
+
+struct vmpressure {
+ unsigned int scanned;
+ unsigned int reclaimed;
+ /* The lock is used to keep the scanned/reclaimed above in sync. */
+ struct mutex sr_lock;
+
+ struct list_head events;
+ /* Have to grab the lock on events traversal or modifications. */
+ struct mutex events_lock;
+
+ struct work_struct work;
+};
+
+struct mem_cgroup;
+
+#ifdef CONFIG_MEMCG
+extern void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
+ unsigned long scanned, unsigned long reclaimed);
+extern void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio);
+#else
+static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
+ unsigned long scanned, unsigned long reclaimed) {}
+static inline void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg,
+ int prio) {}
+#endif /* CONFIG_MEMCG */
+
+extern void vmpressure_init(struct vmpressure *vmpr);
+extern struct vmpressure *memcg_to_vmpr(struct mem_cgroup *memcg);
+extern struct cgroup_subsys_state *vmpr_to_css(struct vmpressure *vmpr);
+extern struct vmpressure *css_to_vmpr(struct cgroup_subsys_state *css);
+extern int vmpressure_register_event(struct cgroup *cg, struct cftype *cft,
+ struct eventfd_ctx *eventfd,
+ const char *args);
+extern void vmpressure_unregister_event(struct cgroup *cg, struct cftype *cft,
+ struct eventfd_ctx *eventfd);
+
+#endif /* __LINUX_VMPRESSURE_H */
diff --git a/mm/Makefile b/mm/Makefile
index 3a46287..72c5acb 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -50,7 +50,7 @@ obj-$(CONFIG_FS_XIP) += filemap_xip.o
obj-$(CONFIG_MIGRATION) += migrate.o
obj-$(CONFIG_QUICKLIST) += quicklist.o
obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o
-obj-$(CONFIG_MEMCG) += memcontrol.o page_cgroup.o
+obj-$(CONFIG_MEMCG) += memcontrol.o page_cgroup.o vmpressure.o
obj-$(CONFIG_CGROUP_HUGETLB) += hugetlb_cgroup.o
obj-$(CONFIG_MEMORY_FAILURE) += memory-failure.o
obj-$(CONFIG_HWPOISON_INJECT) += hwpoison-inject.o
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 25ac5f4..b41727b 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -49,6 +49,7 @@
#include <linux/fs.h>
#include <linux/seq_file.h>
#include <linux/vmalloc.h>
+#include <linux/vmpressure.h>
#include <linux/mm_inline.h>
#include <linux/page_cgroup.h>
#include <linux/cpu.h>
@@ -370,6 +371,9 @@ struct mem_cgroup {
atomic_t numainfo_events;
atomic_t numainfo_updating;
#endif
+
+ struct vmpressure vmpr;
+
/*
* Per cgroup active and inactive list, similar to the
* per zone LRU lists.
@@ -570,6 +574,24 @@ struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *s)
return container_of(s, struct mem_cgroup, css);
}
+/* Some nice accessors for the vmpressure. */
+struct vmpressure *memcg_to_vmpr(struct mem_cgroup *memcg)
+{
+ if (!memcg)
+ memcg = root_mem_cgroup;
+ return &memcg->vmpr;
+}
+
+struct cgroup_subsys_state *vmpr_to_css(struct vmpressure *vmpr)
+{
+ return &container_of(vmpr, struct mem_cgroup, vmpr)->css;
+}
+
+struct vmpressure *css_to_vmpr(struct cgroup_subsys_state *css)
+{
+ return &mem_cgroup_from_css(css)->vmpr;
+}
+
static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg)
{
return (memcg == root_mem_cgroup);
@@ -6000,6 +6022,11 @@ static struct cftype mem_cgroup_files[] = {
.unregister_event = mem_cgroup_oom_unregister_event,
.private = MEMFILE_PRIVATE(_OOM_TYPE, OOM_CONTROL),
},
+ {
+ .name = "pressure_level",
+ .register_event = vmpressure_register_event,
+ .unregister_event = vmpressure_unregister_event,
+ },
#ifdef CONFIG_NUMA
{
.name = "numa_stat",
@@ -6291,6 +6318,7 @@ mem_cgroup_css_alloc(struct cgroup *cont)
memcg->move_charge_at_immigrate = 0;
mutex_init(&memcg->thresholds_lock);
spin_lock_init(&memcg->move_lock);
+ vmpressure_init(&memcg->vmpr);
return &memcg->css;
diff --git a/mm/vmpressure.c b/mm/vmpressure.c
new file mode 100644
index 0000000..ae0ff8e
--- /dev/null
+++ b/mm/vmpressure.c
@@ -0,0 +1,252 @@
+/*
+ * Linux VM pressure
+ *
+ * Copyright 2012 Linaro Ltd.
+ * Anton Vorontsov <anton.vorontsov(a)linaro.org>
+ *
+ * Based on ideas from Andrew Morton, David Rientjes, KOSAKI Motohiro,
+ * Leonid Moiseichuk, Mel Gorman, Minchan Kim and Pekka Enberg.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include <linux/cgroup.h>
+#include <linux/fs.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/vmstat.h>
+#include <linux/eventfd.h>
+#include <linux/swap.h>
+#include <linux/printk.h>
+#include <linux/vmpressure.h>
+
+/*
+ * The window size is the number of scanned pages before we try to analyze
+ * the scanned/reclaimed ratio (or difference).
+ *
+ * It is used as a rate-limit tunable for the "low" level notification,
+ * and for averaging medium/critical levels. Using small window sizes can
+ * cause lot of false positives, but too big window size will delay the
+ * notifications.
+ *
+ * TODO: Make the window size depend on machine size, as we do for vmstat
+ * thresholds.
+ */
+static const unsigned int vmpressure_win = SWAP_CLUSTER_MAX * 16;
+static const unsigned int vmpressure_level_med = 60;
+static const unsigned int vmpressure_level_critical = 95;
+static const unsigned int vmpressure_level_critical_prio = 3;
+
+enum vmpressure_levels {
+ VMPRESSURE_LOW = 0,
+ VMPRESSURE_MEDIUM,
+ VMPRESSURE_CRITICAL,
+ VMPRESSURE_NUM_LEVELS,
+};
+
+static const char *vmpressure_str_levels[] = {
+ [VMPRESSURE_LOW] = "low",
+ [VMPRESSURE_MEDIUM] = "medium",
+ [VMPRESSURE_CRITICAL] = "critical",
+};
+
+static enum vmpressure_levels vmpressure_level(unsigned int pressure)
+{
+ if (pressure >= vmpressure_level_critical)
+ return VMPRESSURE_CRITICAL;
+ else if (pressure >= vmpressure_level_med)
+ return VMPRESSURE_MEDIUM;
+ return VMPRESSURE_LOW;
+}
+
+static enum vmpressure_levels vmpressure_calc_level(unsigned int scanned,
+ unsigned int reclaimed)
+{
+ unsigned long scale = scanned + reclaimed;
+ unsigned long pressure;
+
+ if (!scanned)
+ return VMPRESSURE_LOW;
+
+ /*
+ * We calculate the ratio (in percents) of how many pages were
+ * scanned vs. reclaimed in a given time frame (window). Note that
+ * time is in VM reclaimer's "ticks", i.e. number of pages
+ * scanned. This makes it possible to set desired reaction time
+ * and serves as a ratelimit.
+ */
+ pressure = scale - (reclaimed * scale / scanned);
+ pressure = pressure * 100 / scale;
+
+ pr_debug("%s: %3lu (s: %6u r: %6u)\n", __func__, pressure,
+ scanned, reclaimed);
+
+ return vmpressure_level(pressure);
+}
+
+void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
+ unsigned long scanned, unsigned long reclaimed)
+{
+ struct vmpressure *vmpr = memcg_to_vmpr(memcg);
+
+ /*
+ * So far we are only interested application memory, or, in case
+ * of low pressure, in FS/IO memory reclaim. We are also
+ * interested indirect reclaim (kswapd sets sc->gfp_mask to
+ * GFP_KERNEL).
+ */
+ if (!(gfp & (__GFP_HIGHMEM | __GFP_MOVABLE | __GFP_IO | __GFP_FS)))
+ return;
+
+ if (!scanned)
+ return;
+
+ mutex_lock(&vmpr->sr_lock);
+ vmpr->scanned += scanned;
+ vmpr->reclaimed += reclaimed;
+ mutex_unlock(&vmpr->sr_lock);
+
+ if (scanned < vmpressure_win || work_pending(&vmpr->work))
+ return;
+ schedule_work(&vmpr->work);
+}
+
+void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio)
+{
+ if (prio > vmpressure_level_critical_prio)
+ return;
+
+ /*
+ * OK, the prio is below the threshold, updating vmpressure
+ * information before diving into long shrinking of long range
+ * vmscan.
+ */
+ vmpressure(gfp, memcg, vmpressure_win, 0);
+}
+
+static struct vmpressure *wk_to_vmpr(struct work_struct *wk)
+{
+ return container_of(wk, struct vmpressure, work);
+}
+
+static struct vmpressure *cg_to_vmpr(struct cgroup *cg)
+{
+ return css_to_vmpr(cgroup_subsys_state(cg, mem_cgroup_subsys_id));
+}
+
+struct vmpressure_event {
+ struct eventfd_ctx *efd;
+ enum vmpressure_levels level;
+ struct list_head node;
+};
+
+static bool vmpressure_event(struct vmpressure *vmpr,
+ unsigned long scanned, unsigned long reclaimed)
+{
+ struct vmpressure_event *ev;
+ int level = vmpressure_calc_level(scanned, reclaimed);
+ bool signalled = false;
+
+ mutex_lock(&vmpr->events_lock);
+
+ list_for_each_entry(ev, &vmpr->events, node) {
+ if (level >= ev->level) {
+ eventfd_signal(ev->efd, 1);
+ signalled = true;
+ }
+ }
+
+ mutex_unlock(&vmpr->events_lock);
+
+ return signalled;
+}
+
+static struct vmpressure *vmpressure_parent(struct vmpressure *vmpr)
+{
+ struct cgroup *cg = vmpr_to_css(vmpr)->cgroup;
+ struct mem_cgroup *memcg = mem_cgroup_from_cont(cg);
+
+ memcg = parent_mem_cgroup(memcg);
+ if (!memcg)
+ return NULL;
+ return memcg_to_vmpr(memcg);
+}
+
+static void vmpressure_wk_fn(struct work_struct *wk)
+{
+ struct vmpressure *vmpr = wk_to_vmpr(wk);
+ unsigned long s;
+ unsigned long r;
+
+ mutex_lock(&vmpr->sr_lock);
+ s = vmpr->scanned;
+ r = vmpr->reclaimed;
+ vmpr->scanned = 0;
+ vmpr->reclaimed = 0;
+ mutex_unlock(&vmpr->sr_lock);
+
+ do {
+ if (vmpressure_event(vmpr, s, r))
+ break;
+ /*
+ * If not handled, propagate the event upward into the
+ * hierarchy.
+ */
+ } while ((vmpr = vmpressure_parent(vmpr)));
+}
+
+int vmpressure_register_event(struct cgroup *cg, struct cftype *cft,
+ struct eventfd_ctx *eventfd, const char *args)
+{
+ struct vmpressure *vmpr = cg_to_vmpr(cg);
+ struct vmpressure_event *ev;
+ int lvl;
+
+ for (lvl = 0; lvl < VMPRESSURE_NUM_LEVELS; lvl++) {
+ if (!strcmp(vmpressure_str_levels[lvl], args))
+ break;
+ }
+
+ if (lvl >= VMPRESSURE_NUM_LEVELS)
+ return -EINVAL;
+
+ ev = kzalloc(sizeof(*ev), GFP_KERNEL);
+ if (!ev)
+ return -ENOMEM;
+
+ ev->efd = eventfd;
+ ev->level = lvl;
+
+ mutex_lock(&vmpr->events_lock);
+ list_add(&ev->node, &vmpr->events);
+ mutex_unlock(&vmpr->events_lock);
+
+ return 0;
+}
+
+void vmpressure_unregister_event(struct cgroup *cg, struct cftype *cft,
+ struct eventfd_ctx *eventfd)
+{
+ struct vmpressure *vmpr = cg_to_vmpr(cg);
+ struct vmpressure_event *ev;
+
+ mutex_lock(&vmpr->events_lock);
+ list_for_each_entry(ev, &vmpr->events, node) {
+ if (ev->efd != eventfd)
+ continue;
+ list_del(&ev->node);
+ kfree(ev);
+ break;
+ }
+ mutex_unlock(&vmpr->events_lock);
+}
+
+void vmpressure_init(struct vmpressure *vmpr)
+{
+ mutex_init(&vmpr->sr_lock);
+ mutex_init(&vmpr->events_lock);
+ INIT_LIST_HEAD(&vmpr->events);
+ INIT_WORK(&vmpr->work, vmpressure_wk_fn);
+}
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 88c5fed..9530777 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -19,6 +19,7 @@
#include <linux/pagemap.h>
#include <linux/init.h>
#include <linux/highmem.h>
+#include <linux/vmpressure.h>
#include <linux/vmstat.h>
#include <linux/file.h>
#include <linux/writeback.h>
@@ -1982,6 +1983,11 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc)
}
memcg = mem_cgroup_iter(root, memcg, &reclaim);
} while (memcg);
+
+ vmpressure(sc->gfp_mask, sc->target_mem_cgroup,
+ sc->nr_scanned - nr_scanned,
+ sc->nr_reclaimed - nr_reclaimed);
+
} while (should_continue_reclaim(zone, sc->nr_reclaimed - nr_reclaimed,
sc->nr_scanned - nr_scanned, sc));
}
@@ -2167,6 +2173,8 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
count_vm_event(ALLOCSTALL);
do {
+ vmpressure_prio(sc->gfp_mask, sc->target_mem_cgroup,
+ sc->priority);
sc->nr_scanned = 0;
aborted_reclaim = shrink_zones(zonelist, sc);
--
1.8.1.1
PG_swapbacked is a bit for page->flags.
In kernel code, its comment is "page is backed by RAM/swap". But I couldn't
understand it.
1. Does the RAM mean DRAM? How page is backed by RAM?
2. When the page is page-out to swap file, the bit PG_swapbacked will be
set to demonstrate this page is backed by swap. Is it right?
3. In general, when will call SetPageSwapBacked() to set the bit?
Could anybody kindly explain for me?
Thanks very much.
After some time investigating why I wasn't seeing some kernel section
mismatch errors that someone else was seeing, I found the cause was that
in Linaro we build Thumb2 kernels in the main, and modpost.c doesn't
have support for any of the Thumb relocation types in addend_arm_rel().
I thought I would spread this knowledge, because lack of section
mismatch warnings means we might miss some nasty bugs when developing
code.
If this is old news, then sorry for the noise.
--
Tixy
Hi Mark,
I am getting compilation warning while compiling v3.8
commit 19f949f52599ba7c3f67a5897ac6be14bfcb1200
Author: Linus Torvalds <torvalds(a)linux-foundation.org>
Date: Mon Feb 18 15:58:34 2013 -0800
Linux 3.8
Warning:
CC drivers/base/regmap/regmap-debugfs.o
drivers/base/regmap/regmap-debugfs.c: In function ‘regmap_read_debugfs’:
drivers/base/regmap/regmap-debugfs.c:180:9: warning: ‘ret’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
I am unable to understand why this warning is coming and that too on
line 180 (as that doesn't use this variable). I can't see how this variable is
used uninitialized.
Toolchain i used:
arm-linux-gnueabihf-gcc (crosstool-NG
linaro-1.13.1-4.7-2012.12-20121214 - Linaro GCC 2012.12) 4.7.3
20121205 (prerelease)
--
viresh
=== David Long ===
=== Travel/Time Off ===
* Monday February 18th (U.S. Washington's Birthday, aka President's Day)
=== Highlights ===
Coming up to speed on process.
* Studied the history and content of Rabin Vincent's ARM uprobe kernel
patch. It does a good job of integrating with existing kprobe
instruction interpretation code.
* Upleveled the uprobe patch to 3.7 (for now) and booted on 4460
Panda. I am experimenting with it to verify basic correct operation.
* Sent email to Rabin on the topic of assisting in getting this
patch upstreamed.
=== Plans ===
* Once basic functionality is veriried uplevel the patch to 3.8 and
complete testing (especially as regards Thumb).
* Determine if it is possible to work with the patch originator, or
push for this patch independently.
=== Issues ===
* Eventually I will need hardware other than Panda for testing. For
now Panda works well enough, and QEMU is (theoretically) an option.
-dl
=== Highlights ===
* Lots of practice and refining of slides for ABS talk
* Sent out android upstreaming subteam mail
* Synced with Zach/Deepak
* Mailed a bit with Zach on hotplug and volatile ranges
* Submitted discussion proposal for lsf/mm-minisummit on volatile ranges
(and pinged Anton to maybe do so for mempressure cg)
* Pinged Arve on Serban's ashmem compat_ioctl patches
* Emailed briefly with Tom and Sumit about dmabuf-fences
* Pinged Erik again on my proposal to move sync driver to staging
* Mailed Maarten and Daniel about dmabuf-fences. Trying to see how we
can get folks talking on how to unify sync with dmabuf-fences.
=== Plans ===
* Give Android talk on Monday at ABS
* Follow up on additional sync/dmabuf-fences discussion
* Possibly submit sync upstream to staging
* Try to refocus back on volatile ranges some
=== Issues ===
* NA
With this patch userland applications that want to maintain the
interactivity/memory allocation cost can use the new pressure level
notifications. The levels are defined like this:
The "low" level means that the system is reclaiming memory for new
allocations. Monitoring reclaiming activity might be useful for
maintaining overall system's cache level. Upon notification, the program
(typically "Activity Manager") might analyze vmstat and act in advance
(i.e. prematurely shutdown unimportant services).
The "medium" level means that the system is experiencing medium memory
pressure, there is some mild swapping activity. Upon this event
applications may decide to analyze vmstat/zoneinfo/memcg or internal
memory usage statistics and free any resources that can be easily
reconstructed or re-read from a disk.
The "critical" level means that the system is actively thrashing, it is
about to out of memory (OOM) or even the in-kernel OOM killer is on its
way to trigger. Applications should do whatever they can to help the
system. It might be too late to consult with vmstat or any other
statistics, so it's advisable to take an immediate action.
The events are propagated upward until the event is handled, i.e. the
events are not pass-through. Here is what this means: for example you have
three cgroups: A->B->C. Now you set up an event listener on cgroup A and
cgroup B, and suppose group C experiences some pressure. In this
situation, only group B will receive the notification, i.e. group A will
not receive it. This is done to avoid excessive "broadcasting" of
messages, which disturbs the system and which is especially bad if we are
low on memory or thrashing. So, organize the cgroups wisely, or propagate
the events manually (or, ask us to implement the pass-through events,
explaining why would you need them.)
The file mempressure.level is used to show the current memory pressure
level, and cgroups event control file can be used to setup an eventfd
notification with a specific memory pressure level threshold.
Signed-off-by: Anton Vorontsov <anton.vorontsov(a)linaro.org>
Acked-by: Kirill A. Shutemov <kirill(a)shutemov.name>
---
Hi all,
Here comes another iteration of the memory pressure saga. The previous
version of the patch (and discussion) can be found here:
http://lkml.org/lkml/2013/1/4/55
And here are changes in this revision:
- Andrew Morton was concerned that the mempressure stuff was tied to
memcg, which was non-issue since mempressure wasn't actually bolted into
memcg at that time. But now it is. :) So now you need memcg to use
mempressure. Why? It makes things easier, simpler (e.g. this ends any
questions on how two different cgroups would interact, which can be
complex when two are distinct entities). Plus, as I understood it,
that's how cgroup folks want to see it eventually;
- Only cgroups API implemented. Let's start with making memcg people
happy, i.e. handling the most complex cases, and then we can start with
any niche solutions;
- Implemented Minchan Kim's idea of checking gfp mask. Unfortunately, it
is not as simple as checking '__GFP_HIGHMEM | __GFP_MOVABLE', since we
also need to account files caches and kswapd reclaim. But even so we can
filter out DMA or atomic allocations, which are not interesting for
userland. Plus it opens doors for other gfp tuning, so definitely a good
stuff;
- Per Leonid Moiseichuk's comments decreased vmpressure_level_critical to
95. I didn't look close enough, but it seems that we the minimum step is
indeed ~3%, and 99% makes it actually 100%. 95% should be fine;
- Per Kamezawa Hiroyuki added some words into documentation about that
it's always a good idea to consult with vmstat/zoneinfo/memcg statistics
before taking any action (with the exception of critical level). Also
added 'TODO' wrt. automatic window adjustment;
- Documented events propagation strategy;
- Removed ulong/uint usage, per Andrew's comments;
- Glauber Costa didn't like too short and non-descriptive mpc_ naming,
suggesting mempressure_ instead. And Andrew suggested mpcg_. I went with
something completely different: vmpressure_/vmpr_. :) Also renamed
xxx2yyy() to xxx_to_yyy() per Glauber Costa suggestion.
- _OOM level renamed to _CRITICAL. Andrew wanted _HIGH affix, but by using
'critical' I want to denote that this level is the last one (e.g. we
might want to introduce _HIGH some time later, if we can find a good
definition for it);
- This patch does not include shrinker interface. In the last series I
showed that implementing shrinker is possible, and that it actually can
be useful. At the same time I explained that shrinker is not a
substitution for the pressure levels. So, once we settle on the simple
thing, I might continue my shrinker efforts (which, btw, QEMU guys found
interesting and potentionally useful).
For those who curious, the shrinker patch is here:
http://lkml.org/lkml/2013/1/4/56
- Now tested with various debugging & preempt checks enabled, plus added
small comments on locks usage, thanks to Andrew;
- Rebased onto the current linux-next;
- While the thing somewhat changed, I preserved Kirill's ack. Kirill at
least liked the idea, and I desperately need Acks. :-D
Thanks!
Anton
Documentation/cgroups/memory.txt | 66 ++++++++-
init/Kconfig | 13 ++
mm/Makefile | 1 +
mm/internal.h | 34 +++++
mm/memcontrol.c | 25 ++++
mm/vmpressure.c | 300 +++++++++++++++++++++++++++++++++++++++
mm/vmscan.c | 6 +
7 files changed, 444 insertions(+), 1 deletion(-)
create mode 100644 mm/vmpressure.c
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index addb1f1..006ef58 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -40,6 +40,7 @@ Features:
- soft limit
- moving (recharging) account at moving a task is selectable.
- usage threshold notifier
+ - memory pressure notifier
- oom-killer disable knob and oom-notifier
- Root cgroup has no limit controls.
@@ -65,6 +66,7 @@ Brief summary of control files.
memory.stat # show various statistics
memory.use_hierarchy # set/show hierarchical account enabled
memory.force_empty # trigger forced move charge to parent
+ memory.pressure_level # show the memory pressure level
memory.swappiness # set/show swappiness parameter of vmscan
(See sysctl's vm.swappiness)
memory.move_charge_at_immigrate # set/show controls of moving charges
@@ -778,7 +780,69 @@ At reading, current status of OOM is shown.
under_oom 0 or 1 (if 1, the memory cgroup is under OOM, tasks may
be stopped.)
-11. TODO
+11. Memory Pressure
+
+To maintain the interactivity/memory allocation cost, one can use the
+pressure level notifications, and the levels are defined like this:
+
+The "low" level means that the system is reclaiming memory for new
+allocations. Monitoring reclaiming activity might be useful for
+maintaining overall system's cache level. Upon notification, the program
+(typically "Activity Manager") might analyze vmstat and act in advance
+(i.e. prematurely shutdown unimportant services).
+
+The "medium" level means that the system is experiencing medium memory
+pressure, there is some mild swapping activity. Upon this event
+applications may decide to analyze vmstat/zoneinfo/memcg or internal
+memory usage statistics and free any resources that can be easily
+reconstructed or re-read from a disk.
+
+The "critical" level means that the system is actively thrashing, it is
+about to out of memory (OOM) or even the in-kernel OOM killer is on its
+way to trigger. Applications should do whatever they can to help the
+system. It might be too late to consult with vmstat or any other
+statistics, so it's advisable to take an immediate action.
+
+The events are propagated upward until the event is handled, i.e. the
+events are not pass-through. Here is what this means: for example you have
+three cgroups: A->B->C. Now you set up an event listener on cgroup A and
+cgroup B, and suppose group C experiences some pressure. In this
+situation, only group B will receive the notification, i.e. group A will
+not receive it. This is done to avoid excessive "broadcasting" of
+messages, which disturbs the system and which is especially bad if we are
+low on memory or thrashing. So, organize the cgroups wisely, or propagate
+the events manually (or, ask us to implement the pass-through events,
+explaining why would you need them.)
+
+The file mempressure.level is used to show the current memory pressure
+level, and cgroups event control file can be used to setup an eventfd
+notification with a specific memory pressure level threshold.
+
+ Read:
+ Reads mempory presure levels: low, medium or critical.
+ Write:
+ Not implemented.
+ Test:
+ Here is a script: make a new cgroup, set up a memory limit, set up a
+ notification on the parent cgroup, make child cgroup experience a
+ critical pressure. Expected result is that the parent cgroup gets a
+ notification:
+
+ (Note that we are seting up a listener on parent's cgroup, and then
+ creating a child cgroup, showing how event propagation works.)
+
+ # cd /sys/fs/cgroup/memory/
+ # cgroup_event_listener memory.pressure_level low &
+ # mkdir foo
+ # cd foo
+ # echo 8000000 > memory.limit_in_bytes
+ # echo $$ > tasks
+ # dd if=/dev/zero | read x
+
+ (Expect a bunch of notifications, and eventually, the oom-killer will
+ trigger.)
+
+12. TODO
1. Add support for accounting huge pages (as a separate controller)
2. Make per-cgroup scanner reclaim not-shared pages first
diff --git a/init/Kconfig b/init/Kconfig
index ccd1ca5..6d61ef5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -908,6 +908,19 @@ config MEMCG_DEBUG_ASYNC_DESTROY
This is a developer-oriented debugging facility only, and no
guarantees of interface stability will be given.
+config MEMCG_PRESSURE
+ bool "Memory Resource Controller Pressure Monitor"
+ help
+ The memory pressure monitor provides a facility for userland
+ programs to watch for memory pressure on per-cgroup basis. This
+ is useful if you have programs that want to respond to the
+ pressure, possibly improving memory management.
+
+ For more information see Memory Pressure section in
+ Documentation/cgroups/memory.txt.
+
+ If unsure, say N.
+
config CGROUP_HUGETLB
bool "HugeTLB Resource Controller for Control Groups"
depends on RESOURCE_COUNTERS && HUGETLB_PAGE
diff --git a/mm/Makefile b/mm/Makefile
index 3a46287..51f7f52 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -51,6 +51,7 @@ obj-$(CONFIG_MIGRATION) += migrate.o
obj-$(CONFIG_QUICKLIST) += quicklist.o
obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o
obj-$(CONFIG_MEMCG) += memcontrol.o page_cgroup.o
+obj-$(CONFIG_MEMCG_PRESSURE) += vmpressure.o
obj-$(CONFIG_CGROUP_HUGETLB) += hugetlb_cgroup.o
obj-$(CONFIG_MEMORY_FAILURE) += memory-failure.o
obj-$(CONFIG_HWPOISON_INJECT) += hwpoison-inject.o
diff --git a/mm/internal.h b/mm/internal.h
index 1c0c4cc..eb50685 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -374,4 +374,38 @@ unsigned long reclaim_clean_pages_from_list(struct zone *zone,
#define ALLOC_CPUSET 0x40 /* check for correct cpuset */
#define ALLOC_CMA 0x80 /* allow allocations from CMA areas */
+struct vmpressure {
+#ifdef CONFIG_MEMCG_PRESSURE
+ unsigned int scanned;
+ unsigned int reclaimed;
+ /* The lock is used to keep the scanned/reclaimed above in sync. */
+ struct mutex sr_lock;
+
+ struct list_head events;
+ /* Have to grab the lock on events traversal or modifications. */
+ struct mutex events_lock;
+
+ struct work_struct work;
+#endif /* CONFIG_MEMCG_PRESSURE */
+};
+
+struct mem_cgroup;
+#ifdef CONFIG_MEMCG_PRESSURE
+extern void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
+ unsigned long scanned, unsigned long reclaimed);
+extern void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio);
+extern void vmpressure_init(struct vmpressure *vmpr);
+extern struct vmpressure *memcg_to_vmpr(struct mem_cgroup *memcg);
+extern struct cgroup_subsys_state *vmpr_to_css(struct vmpressure *vmpr);
+extern struct vmpressure *css_to_vmpr(struct cgroup_subsys_state *css);
+extern void __init enable_pressure_cgroup(void);
+#else
+static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
+ unsigned long scanned, unsigned long reclaimed) {}
+static inline void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg,
+ int prio) {}
+static inline void vmpressure_init(struct vmpressure *vmpr) {}
+static inline void __init enable_pressure_cgroup(void) {}
+#endif /* CONFIG_MEMCG_PRESSURE */
+
#endif /* __MM_INTERNAL_H */
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 25ac5f4..60f277a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -370,6 +370,9 @@ struct mem_cgroup {
atomic_t numainfo_events;
atomic_t numainfo_updating;
#endif
+
+ struct vmpressure vmpr;
+
/*
* Per cgroup active and inactive list, similar to the
* per zone LRU lists.
@@ -575,6 +578,26 @@ static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg)
return (memcg == root_mem_cgroup);
}
+/* Some nice accessors for the vmpressure. */
+#ifdef CONFIG_MEMCG_PRESSURE
+struct vmpressure *memcg_to_vmpr(struct mem_cgroup *memcg)
+{
+ if (!memcg)
+ memcg = root_mem_cgroup;
+ return &memcg->vmpr;
+}
+
+struct cgroup_subsys_state *vmpr_to_css(struct vmpressure *vmpr)
+{
+ return &container_of(vmpr, struct mem_cgroup, vmpr)->css;
+}
+
+struct vmpressure *css_to_vmpr(struct cgroup_subsys_state *css)
+{
+ return &mem_cgroup_from_css(css)->vmpr;
+}
+#endif /* CONFIG_MEMCG_PRESSURE */
+
/* Writing them here to avoid exposing memcg's inner layout */
#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM)
@@ -6291,6 +6314,7 @@ mem_cgroup_css_alloc(struct cgroup *cont)
memcg->move_charge_at_immigrate = 0;
mutex_init(&memcg->thresholds_lock);
spin_lock_init(&memcg->move_lock);
+ vmpressure_init(&memcg->vmpr);
return &memcg->css;
@@ -7018,6 +7042,7 @@ static int __init mem_cgroup_init(void)
{
hotcpu_notifier(memcg_cpu_hotplug_callback, 0);
enable_swap_cgroup();
+ enable_pressure_cgroup();
mem_cgroup_soft_limit_tree_init();
memcg_stock_init();
return 0;
diff --git a/mm/vmpressure.c b/mm/vmpressure.c
new file mode 100644
index 0000000..7922503
--- /dev/null
+++ b/mm/vmpressure.c
@@ -0,0 +1,300 @@
+/*
+ * Linux VM pressure
+ *
+ * Copyright 2012 Linaro Ltd.
+ * Anton Vorontsov <anton.vorontsov(a)linaro.org>
+ *
+ * Based on ideas from Andrew Morton, David Rientjes, KOSAKI Motohiro,
+ * Leonid Moiseichuk, Mel Gorman, Minchan Kim and Pekka Enberg.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include <linux/cgroup.h>
+#include <linux/fs.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/vmstat.h>
+#include <linux/eventfd.h>
+#include <linux/swap.h>
+#include <linux/printk.h>
+#include "internal.h"
+
+/*
+ * Generic VM Pressure routines (no cgroups or any other API details)
+ */
+
+/*
+ * The window size is the number of scanned pages before we try to analyze
+ * the scanned/reclaimed ratio (or difference).
+ *
+ * It is used as a rate-limit tunable for the "low" level notification,
+ * and for averaging medium/critical levels. Using small window sizes can
+ * cause lot of false positives, but too big window size will delay the
+ * notifications.
+ *
+ * TODO: Make the window size depend on machine size, as we do for vmstat
+ * thresholds.
+ */
+static const unsigned int vmpressure_win = SWAP_CLUSTER_MAX * 16;
+static const unsigned int vmpressure_level_med = 60;
+static const unsigned int vmpressure_level_critical = 95;
+static const unsigned int vmpressure_level_critical_prio = 3;
+
+enum vmpressure_levels {
+ VMPRESSURE_LOW = 0,
+ VMPRESSURE_MEDIUM,
+ VMPRESSURE_CRITICAL,
+ VMPRESSURE_NUM_LEVELS,
+};
+
+static const char *vmpressure_str_levels[] = {
+ [VMPRESSURE_LOW] = "low",
+ [VMPRESSURE_MEDIUM] = "medium",
+ [VMPRESSURE_CRITICAL] = "critical",
+};
+
+static enum vmpressure_levels vmpressure_level(unsigned int pressure)
+{
+ if (pressure >= vmpressure_level_critical)
+ return VMPRESSURE_CRITICAL;
+ else if (pressure >= vmpressure_level_med)
+ return VMPRESSURE_MEDIUM;
+ return VMPRESSURE_LOW;
+}
+
+static unsigned long vmpressure_calc_level(unsigned int win,
+ unsigned int s, unsigned int r)
+{
+ unsigned long p;
+
+ if (!s)
+ return 0;
+
+ /*
+ * We calculate the ratio (in percents) of how many pages were
+ * scanned vs. reclaimed in a given time frame (window). Note that
+ * time is in VM reclaimer's "ticks", i.e. number of pages
+ * scanned. This makes it possible to set desired reaction time
+ * and serves as a ratelimit.
+ */
+ p = win - (r * win / s);
+ p = p * 100 / win;
+
+ pr_debug("%s: %3lu (s: %6u r: %6u)\n", __func__, p, s, r);
+
+ return vmpressure_level(p);
+}
+
+void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
+ unsigned long scanned, unsigned long reclaimed)
+{
+ struct vmpressure *vmpr = memcg_to_vmpr(memcg);
+
+ /*
+ * So far we are only interested application memory, or, in case
+ * of low pressure, in FS/IO memory reclaim. We are also
+ * interested indirect reclaim (kswapd sets sc->gfp_mask to
+ * GFP_KERNEL).
+ */
+ if (!(gfp & (__GFP_HIGHMEM | __GFP_MOVABLE | __GFP_IO | __GFP_FS)))
+ return;
+
+ if (!scanned)
+ return;
+
+ mutex_lock(&vmpr->sr_lock);
+ vmpr->scanned += scanned;
+ vmpr->reclaimed += reclaimed;
+ mutex_unlock(&vmpr->sr_lock);
+
+ if (scanned < vmpressure_win || work_pending(&vmpr->work))
+ return;
+ schedule_work(&vmpr->work);
+}
+
+void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio)
+{
+ if (prio > vmpressure_level_critical_prio)
+ return;
+
+ /* OK, the prio is below the threshold, we're about to oom. */
+ vmpressure(gfp, memcg, vmpressure_win, 0);
+}
+
+static struct vmpressure *wk_to_vmpr(struct work_struct *wk)
+{
+ return container_of(wk, struct vmpressure, work);
+}
+
+static struct vmpressure *cg_to_vmpr(struct cgroup *cg)
+{
+ return css_to_vmpr(cgroup_subsys_state(cg, mem_cgroup_subsys_id));
+}
+
+struct vmpressure_event {
+ struct eventfd_ctx *efd;
+ enum vmpressure_levels level;
+ struct list_head node;
+};
+
+static bool vmpressure_event(struct vmpressure *vmpr,
+ unsigned long s, unsigned long r)
+{
+ struct vmpressure_event *ev;
+ int level = vmpressure_calc_level(vmpressure_win, s, r);
+ bool signalled = 0;
+
+ mutex_lock(&vmpr->events_lock);
+
+ list_for_each_entry(ev, &vmpr->events, node) {
+ if (level >= ev->level) {
+ eventfd_signal(ev->efd, 1);
+ signalled++;
+ }
+ }
+
+ mutex_unlock(&vmpr->events_lock);
+
+ return signalled;
+}
+
+static struct vmpressure *vmpressure_parent(struct vmpressure *vmpr)
+{
+ struct cgroup *cg = vmpr_to_css(vmpr)->cgroup->parent;
+
+ if (!cg)
+ return NULL;
+ return cg_to_vmpr(cg);
+}
+
+static void vmpressure_wk_fn(struct work_struct *wk)
+{
+ struct vmpressure *vmpr = wk_to_vmpr(wk);
+ unsigned long s;
+ unsigned long r;
+
+ mutex_lock(&vmpr->sr_lock);
+ s = vmpr->scanned;
+ r = vmpr->reclaimed;
+ vmpr->scanned = 0;
+ vmpr->reclaimed = 0;
+ mutex_unlock(&vmpr->sr_lock);
+
+ do {
+ if (vmpressure_event(vmpr, s, r))
+ break;
+ /*
+ * If not handled, propagate the event upward into the
+ * hierarchy.
+ */
+ } while ((vmpr = vmpressure_parent(vmpr)));
+}
+
+/* cgroups "frontend" for vmpressure. */
+
+static ssize_t vmpressure_read_level(struct cgroup *cg, struct cftype *cft,
+ struct file *file, char __user *buf,
+ size_t sz, loff_t *ppos)
+{
+ struct vmpressure *vmpr = cg_to_vmpr(cg);
+ unsigned int level;
+ const char *str;
+ ssize_t len = 0;
+
+ if (*ppos >= sz)
+ return 0;
+
+ mutex_lock(&vmpr->sr_lock);
+
+ level = vmpressure_calc_level(vmpressure_win,
+ vmpr->scanned, vmpr->reclaimed);
+
+ mutex_unlock(&vmpr->sr_lock);
+
+ str = vmpressure_str_levels[level];
+ len += strlen(str) + 1;
+ if (len > sz)
+ return -EINVAL;
+
+ if (copy_to_user(buf, str, len - 1))
+ return -EFAULT;
+ if (copy_to_user(buf + len - 1, "\n", 1))
+ return -EFAULT;
+
+ *ppos += sz;
+ return len;
+}
+
+static int vmpressure_register_level(struct cgroup *cg, struct cftype *cft,
+ struct eventfd_ctx *eventfd,
+ const char *args)
+{
+ struct vmpressure *vmpr = cg_to_vmpr(cg);
+ struct vmpressure_event *ev;
+ int lvl;
+
+ for (lvl = 0; lvl < VMPRESSURE_NUM_LEVELS; lvl++) {
+ if (!strcmp(vmpressure_str_levels[lvl], args))
+ break;
+ }
+
+ if (lvl >= VMPRESSURE_NUM_LEVELS)
+ return -EINVAL;
+
+ ev = kzalloc(sizeof(*ev), GFP_KERNEL);
+ if (!ev)
+ return -ENOMEM;
+
+ ev->efd = eventfd;
+ ev->level = lvl;
+
+ mutex_lock(&vmpr->events_lock);
+ list_add(&ev->node, &vmpr->events);
+ mutex_unlock(&vmpr->events_lock);
+
+ return 0;
+}
+
+static void vmpressure_unregister_level(struct cgroup *cg, struct cftype *cft,
+ struct eventfd_ctx *eventfd)
+{
+ struct vmpressure *vmpr = cg_to_vmpr(cg);
+ struct vmpressure_event *ev;
+
+ mutex_lock(&vmpr->events_lock);
+ list_for_each_entry(ev, &vmpr->events, node) {
+ if (ev->efd != eventfd)
+ continue;
+ list_del(&ev->node);
+ kfree(ev);
+ break;
+ }
+ mutex_unlock(&vmpr->events_lock);
+}
+
+static struct cftype vmpressure_cgroup_files[] = {
+ {
+ .name = "pressure_level",
+ .read = vmpressure_read_level,
+ .register_event = vmpressure_register_level,
+ .unregister_event = vmpressure_unregister_level,
+ },
+ {},
+};
+
+void vmpressure_init(struct vmpressure *vmpr)
+{
+ mutex_init(&vmpr->sr_lock);
+ mutex_init(&vmpr->events_lock);
+ INIT_LIST_HEAD(&vmpr->events);
+ INIT_WORK(&vmpr->work, vmpressure_wk_fn);
+}
+
+void __init enable_pressure_cgroup(void)
+{
+ WARN_ON(cgroup_add_cftypes(&mem_cgroup_subsys,
+ vmpressure_cgroup_files));
+}
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 88c5fed..34f09b9 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1982,6 +1982,10 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc)
}
memcg = mem_cgroup_iter(root, memcg, &reclaim);
} while (memcg);
+
+ vmpressure(sc->gfp_mask, sc->target_mem_cgroup,
+ sc->nr_scanned - nr_scanned, nr_reclaimed);
+
} while (should_continue_reclaim(zone, sc->nr_reclaimed - nr_reclaimed,
sc->nr_scanned - nr_scanned, sc));
}
@@ -2167,6 +2171,8 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
count_vm_event(ALLOCSTALL);
do {
+ vmpressure_prio(sc->gfp_mask, sc->target_mem_cgroup,
+ sc->priority);
sc->nr_scanned = 0;
aborted_reclaim = shrink_zones(zonelist, sc);
--
1.8.1.1
== Linus Walleij linusw ==
=== Highlights ===
* Finalized AB8500 GPIO pathes, tested and obtained working IRQs.
Merged some of these into the MFD tree, some into the pinctrl tree
and some into a patch set targeted at ARM SoC.
* GPIO maintenance:
- Handed working tree over to Grant, who picked it and added
some more.
- Reviewed some of the nice GPIO descriptor rework patches,
and Grant started merging some of them.
* Pinctrl maintenance:
- Requested Torvalds to pull in the last two pinctrl fixes. He pulled
them in.
- Merged the ABx500 pinctrl stuff.
- Merged a bunch of lantiq patches.
* Reviewed some PXA SPI DMA stuff, they are basically splitting
the custom DMA API from the dmaengine API to optionally
compile out the former and eventually delete it, and this is
nice stuff. The PXA SPI is apparently also used by all the
Intel SoC:s so this is a big win.
* Cooked two fix-up patches agains the compile regression
introduced in the ux500 due to the <mach/id.h> removal
patches. Sent two patches fixing it up:
http://marc.info/?l=linux-arm-kernel&m=136051407426331&w=2http://marc.info/?l=linux-arm-kernel&m=136051407826332&w=2
Hopefully these can get merged. Still no clue how I managed
to screw things up like this, I know for sure I compiled this
branch, but maybe new support was introduced somewher in
the v3.7 cycle and I missed it.
* Russell merged the Versatile QEMU PCI fix.
* Interviewed a potential KWG assignee on Deepak's request.
* Got fed up with people not fixing the NO_IRQ business
(i.e. using Linux IRQ 0), so I sent two attack-patches bumping
fixed Linux IRQ offsets to 64 for mach-netx and mach-ep93xx.
netx patch ACKed, merging through Russell.
* Bystanding Fabio while he was root-casing an issue on the
DMA40 DMA controller. He found the culprit and everyone is
happy.
* Debated heavy subjects:
- Is virtio or dmaengine the best way forward for OMAPs
odd USB acceleration.
- Status of the HSI subsystem.
- Deferred probe is completing after __init sections have
been discarded, on the assumption nothing needing these
sections will be around. That doesn't work for the console
set-up calls, d'oh. Haojian has an interesting pending patch:
http://marc.info/?l=linux-kernel&m=136042916203488&w=2
=== Plans ===
* Finalize a GPIO+pinctrl presentation for the Embedded Linux
Conference next week. My presentation will be first day of the
conference. It's all fun! I will be travelling and hanging out at
ELC the whole next week, monday 18th thru monday the 25th.
* Attack the remaining headers in arch/arm/mach-ux500
so we can move forward with multiplatform for v3.9.
* Convert Nomadik pinctrl driver to register GPIO ranges
from the gpiochip side.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Get hands dirty with regmap.
=== Issues ===
* Some stress still but feels better when thing have started
working and regressions get fixed.
Thanks,
Linus Walleij
== Ulf Hansson ==
=== Highlights ===
Storage:
* Monitoring patches on mmc-list.
* Patches for fixing signal voltage switch procedure for SD card UHS
mode ready. Acked and tested by different host driver authors.
* Patch for improve dma handling for mmci host driver accepted for 3.9.
* Cooperating with internal STE colleague, Johan Rudholm, with regards
to rework parts of the HS200 and SDR104 support in the mmc protocol
layer.
* Received another eMMC -> SD card adapter with corresponding eMMC 4.5
samples, this time from Toshiba via Pär Andersson. Really great to
have another vendor to test with, thanks Toshiba!
Clk:
* Still high focus doing internal work for STE ux500. Started to
prepare a patchset for upstream this work, some dependencies to Lee
Jones upstream work for mfd driver related parts which complicates it
a bit. The patches will add support for abx500 clocks, update
different driver's clk support and include ux500 clk optimizations.
* Follow up on patchset for fixing clk_set_parent API.
* Follow up on patchset for disable unsed prepared clks.
=== Plans ===
Storage:
* Follow up on Idle time BKOPS patches on mmc list. Will soon send a
skeleton patch which the work can be based upon, related to runtime
PM.
* Doing an overall analyse about the eMMC 4.5/4.6 features. Check what
can be considered finished, what needs further fixing and point out
the new features for which we should spend our focus on in Linaro
storage team. As also stated above, rework of HS200/SDR104 support
started.
* Push patches for mmci host driver to support UHS cards.
* Push patches for mmci host driver to further extend the power
management support.
* Push patches for mmci host driver to add new features like CMD23
support and more.
* Push patches for mmci host driver to add support for new STE 8540 variant.
Clk:
* Upstreaming of internal work for ux500.
=== Issues ===
* Still need to increase focus towards storage, all work related to
clks has been given give higher prio for a while now.
Kind regards
Ulf Hansson
=== Highlights ===
* Got my current timekeeping queue merged into -tip for 3.9
* Got my plane tickets for ABS
* Got my ABS slides finished (including charts that were annoying hard
to create)
* Sent out android upstreaming subteam mail
* Synced with Deepak
* Agreed to help run the Android miniconf at LPC
* Reviewed and queued patch for NTP/RTC update issue
* Started looking at Android Sync driver, pinged Erik on his plans, and
pinged Maarten on dmabuf-fences
* Reworked Android Sync driver so it could be merged with staging
(pending feedback from Erik)
=== Plans ===
* Submit ABS slides
* Rehearsing for ABS talk & any last polishing of the slides
* Hopefully continue discussions around dmabuf-fence/android-sync and
possibly submit sync to staging.
=== Issues ===
* NA
== Linus Walleij linusw ==
=== Highlights ===
* Working on AB8500 GPIO as it is a
roadblock for the multiplatform, as it is a SPARSE_IRQ
regression.
https://blueprints.launchpad.net/linux-linaro/+spec/ab8500-gpio-shapeup
Working on Lee Jones' cleanup and IRQ fixup series.
Finally aquired a hardware that can actually fire these IRQs.
* Requested Torvalds to pull in a bunch of pinctrl fixes and he pulled
them in. One outstanding patch needs to be sent still :-(
* GPIO maintenance:
- Got PCA GPIO cleanups back from maintainer, modified and
working, merged them.
- Merged ACPI extensions for gpiolib from Mathias Nyman, the
build robot found issues, have asked Mathias to fix them.
- Finalizing tree for the merge window.
* Pinctrl maintenance:
- Merged a few allwinner pinctrl patches. More yet queued.
- Finalizing tree for the merge window.
* Arnd found a bug in the Nomadik (mach-nomadik) device tree
patch set: need to select USE_OF over just OF. Made a patch
and sent it.
* Got an ACK for the missing <mach/id.h> removal dependency
from the MFD maintainer. Send a pull request for it, and it has
landed in linux-next. However I seem to have screwed up the
patch set somehow and now I must fix it :-(
* Fixed a regression in the Versatile QEMU PCI code.
(I don't know if anyone is actually using the QEMU Versatile
PCI on real hardware, or if that even really works. There are
rumors that it does not.)
The patch is in Russell's patch tracker:
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7635/1
=== Plans ===
* First fix the AB8500 GPIO mess.
* Large pinctrl single patch set in the INBOX.
* Large GPIO descriptor rework patch set in the INBOX.
* Attack the remaining headers in arch/arm/mach-ux500
so we can move forward with multiplatform for v3.9.
* Convert Nomadik pinctrl driver to register GPIO ranges
from the gpiochip side.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Get hands dirty with regmap.
=== Issues ===
* The constant overload and still a feeling of not doing progress
make me do stupid mistakes like the bug in the Nomadik patch
set and the <mach/id.h> removal bugs. Maybe I should drop some
stuff from the merge window to avoid more stupid mistakes.
Thanks,
Linus Walleij
=== Highlights ===
* Sent out mqueue timer/nohz performance regression fix for 2.6.32-stable
* Reviewed Appala's logger test plan
* Updated blueprints and held bi-weekly Android upstreaming meeting,
synced with Zach, Deepak, Jakub in other meetings.
* Sent Axel the alarm-dev-test, and after some feedback from him,
reworked it a touch and resent it.
* Reviewed Serban's new ashmem interface/compat_ioctl changes
* Got on the AOSP contributers list
* Submitted fix to ashmem.h inconsistent ioctl that Dmitry noticed to AOSP
* Attended local portland Android lecture series, trying to learn more
about Android userland details
* Discussed potential license issues with unit-test development
* Started generating slides for my ABS talk.
* Continued working on tmpfs enablment in Minchan's patch but ran into
more troubles.
* Repinged tglx on 3.9 patches
=== Plans ===
* Continue tmpfs volatile anonymous range work
* Continue working on ABS talk
=== Issues ===
NA
Sorry this is late!
=== Highlights ===
* Discussed possible common infrastructure for arm/x86 on using
clocksource like counters for measuring suspendtime.
* Contributed to discussion around HZ/clocksource/clockevent/jiffies
functionality, so a common HZ value can be found for multi-arch kernels.
* Discussed android-upstreaming subteam process with Jakub and Deepak
* Sent git pull for 3.9 timekeeping items
* Sent out weekly android upstreaming subteam status mail
* Found and fixed a reported timekeeping related performance regression
found in 2.6.32.60
* Took first pass at adding tmpfs support to Minchan's current patchset.
Not yet fully working.
=== Plans ===
* Continue tmpfs volatile anonymous range work
* Reping tglx on 3.9 patches
* Start working on ABS talk
=== Issues ===
NA
==== Activity Summary ====
* "Kernel crash-Snowball board": Rootcaused and fixed kernel crash
issue on snowball board, patch has been
communicated for review.
* Multiplatform Support for ux500: Had a syncup with linuswalleij on
MPCONFIG/ARCH_MULTIPLATFORM
enablement, linusw provided pointers to blueprints and current work
status through git repos. I have started to
work on the same.
* Weekly singlezImage meeting: analyzing static overhead for the
platforms with the single ones
* Task: Combined kernel config across vexpress-QEMU and i.MX: Spent
some time on debugging vexpress for not booting to prompt,
found that DTB file is not the culprit.Meanwhile, "peter maydell"
and others have confirmed about the successful boot of VExpress-QEMU
with DTB from the linaro nightly build, cross checking the reason
for failure at my end.
==== Plan ====
* Continue Adding Multiplatform Config support
* Combined kernel analysis
==== Issues ====
One day internal office work
==== Activity Summary ====
* Updated runtime size "Multiplatform Config data" information for
i.mx platform.
* Discussed with linusw on Multiplatform Config, linusw suggested to
edit u8500 driver to filter out dependency on ./mach* folder
Note: Found some regressions(kernel crash) on u8500 board, details
in the "issues" below.
* Discussed with arnd regarding combined kernel verification,
currently verifying on "VExpress-QEMU and i.MX" platform,
Note: Vexpress-QEMU does not boots to prompt, found "division by
zero" error, hence falling back to v3.7 for verification and
backporting "i.mx multiplatform config" patches to v3.7 so
that we can expect it to boot across "VExpress-QEMU and i.MX
platform".
During backporing i observed that commits/patches does not
apply directly, needs manual merge.
==== Plan ====
* Continue Adding Multiplatform Config support
* Syncup with Arnd on combined kernel verification
==== Issues ====
* Observed kernel crash(https://pastebin.linaro.org/1370/) on 3.8-rc2
version with respect to pincontrol, found to be fixed in rc3
and ab8500-DT related kernel
crash(https://pastebin.linaro.org/1391/) on rc3, currently rootcausing
the issue
* Vexpress-QEMU: with and without "combined kernel config" 3.8-rcX
kernel with DT does not boots to prompt, however, understood from tixy
that kernel boots on RealHardware, found error "Division by zero in
kernel" during the crash. Yet to start fixing the issue
== Linus Walleij linusw ==
=== Highlights ===
* Working on AB8500 GPIO as it is a
roadblock for the multiplatform, as it is a SPARSE_IRQ
regression.
https://blueprints.launchpad.net/linux-linaro/+spec/ab8500-gpio-shapeup
Second iteration of the patch pushed to linux-next thru pinctrl.
Next step is to merge Lee Jones' IRQ fixup patches and test.
* Merged pinctrl device core grabbing patch after a final touch-up
by Stephen Warren and following Greg's ACK. Now we know we
will definately have this nice infrastructure in v3.9.
https://blueprints.launchpad.net/linux-linaro/+spec/pinctrl-corehog
* Requested Torvalds to pull in a bunch of GPIO fixes and he pulled
them in.
* Reviewed and stacked up a few GPIO patches. Proposed two
minor cleanups to the pca driver.
* Reviewed and stacked up not-so-few pinctrl patches, including
some ACKing of the big SH pinctrl business going on.
* Requested pull for three ux500 v3.8 fixes.
* Requested pull for Nomadik (mach-nomadik) device tree patch set.
* Iterated a patch form Nomadik I2C pinctrl. Wolfram merged it,
after fixing my mistakes, and he wrote yet another cleanup patch
as well, nice!
* Iterated a patch to U-Boot enabling device tree on the
Integrator.
=== Plans ===
* First fix the AB8500 GPIO mess.
* Get and ACK for the missing <mach/id.h> removal dependency
from the MFD maintainer.
* Attack the remaining headers in arch/arm/mach-ux500
so we can move forward with multiplatform for v3.9.
* Convert Nomadik pinctrl driver to register GPIO ranges
from the gpiochip side.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Get hands dirty with regmap.
=== Issues ===
* N/A (just overly busy as usual)
Thanks,
Linus Walleij
== Ulf Hansson ==
=== Highlights ===
Storage:
* Reviewing patches on mmc-list, different stuff.
* Patches on mmc-list for fixing signal voltage switch procedure for
UHS mode ready. Acked and tested by different host driver authors.
Still not merged yet, hopefully they will go in 3.9.
* Sent updated patch for dma handling in mmci host driver.
Clk:
* Quite much internal work done. Needed to be able to prepare a patchset to
implement abx500 clocks. Found out issues with clk_set_parent API.
* Resent patchset for clk framework, to make an unsued clk unprepared at
late_init. Now also includes a patch for ux500 to make use of this feature.
* Send patchset for fixing clk_set_parent API.
=== Plans ===
Storage:
* Follow up on Idle time BKOPS patches on mmc list. Intend to send a
skeleton patch which the work can be based upon. Related to runtime
PM.
* Doing an overall analyse about the eMMC 4.5/4.6 features. Check what
can be considered finished, what needs further fixing and point out
the new features for which we should spend our focus on in Linaro
storage team.
* Push patches for mmci host driver to support for UHS cards.
* Push patches for mmci host driver to further extend the power
management support.
* Push patches for mmci host driver to add new features like CMD23
support and more.
Clk:
* Upstream internal ux500 clock work related to abx500 clk driver.
=== Resolved Issues ===
* Major issue resolved when Micron, via Luca Porzio, sent me an eMMC
-> SD card adapter for their eMMC 4.5 samples I already got from them.
Now I am able to boost up focus on eMMC 4.5 features an actually do
some real testing. Thanks Luca and Micron!
=== Issues ===
* The quite intensive work for the internal development track for
ux500 clocks, has temporary made me drop some focus on storage. I will
correct that when coming back from the one week of ski-vacation which
starts tomorrow. :-)
Kind regards
Ulf Hansson
Hi,
I'm struggling to find a git repository in which I could checkout the
kernel state used for particular release (eg. 12.11, 12.12).
All I've found is:
https://wiki.linaro.org/Resources/HowTo/Git/LinaroGitTrees
but it's not solving my problem. I'm browsing git.linaro.org and can't
find anything like this.
Can anyone point me in the right direction?
Regards,
--
Dawid Ciężarkiewicz
== Linus Walleij linusw ==
=== Highlights ===
* Working on AB8500 GPIO as it is a
roadblock for the multiplatform, as it is a SPARSE_IRQ
regression.
https://blueprints.launchpad.net/linux-linaro/+spec/ab8500-gpio-shapeup
* Iterated the pinctrl device core pin grabbing:
https://blueprints.launchpad.net/linux-linaro/+spec/pinctrl-corehoghttp://marc.info/?l=linux-kernel&m=135879594515932&w=2
* Concluded that the reported errors with device tree and sparse
IRQ were due to regression fixes not being merged to the
MFD tree. See below on issues.
* Looked over some pending GPIO and pinctrl patch queue.
* Advanced Nomadik (mach-nomadik) device tree patch set.
* Pushed a patch to U-Boot enabling device tree on the
Integrator.
=== Plans ===
* First fix the AB8500 GPIO mess.
* Attack the remaining headers in arch/arm/mach-ux500
so we can move forward with multiplatform for v3.9.
* Convert Nomadik pinctrl driver to register GPIO ranges
from the gpiochip side.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Get hands dirty with regmap.
=== Issues ===
* Not getting response from the MTD maintainer.
Filed two regressions, one of them before christmas (!)
http://marc.info/?l=linux-kernel&m=135880464619562&w=2http://marc.info/?l=linux-kernel&m=135820251519490&w=2
Don't know what to do. Shall I send the patches to
Torvalds directly or what...
Thanks,
Linus Walleij
=== Highlights ===
* Build system arrived and got it setup w/ my git trees and test kvm
environments
* Updated linaro-android tree to address __devinit issue Tixy pointed out.
* Ran bi-weekly meeting, and synced with Serban on compat_ioctl work
* Android alarm-dev compat_ioctl patches were merged into GregKH's tree
for 3.9
* Got harangued into presenting a Android status update at ABS
* Queued some community 3.9 patches
* Asked Google Android team about Dmitry's inconsistent ashmem ioctl
issue, got a response on how to solve it.
* Pinged Jason Wessel on FIQ KDB work (end up he's been on sabbatical)
* Initial review and testing of Minchans' v8 patch. Sent feedback on a
few bugs I found.
=== Plans ===
* Take a stab at tmpfs volatile anonymous ranges
* Sync w/ tglx and send initial git pull for 3.9
* Merge a handful of community timekeeping patches & sync w/ tglx
* Start work on my slides for my ABS talk
=== Issues ===
Hi all,
Here is another round of the mempressure cgroup. This time I dared to
remove the RFC tag. :)
In this revision:
- Addressed most of Kirill Shutemov's comments. I didn't bother
implementing per-level lists, though. It would needlessly complicate the
logic, and the gain would be only visible with lots of watchers (which
we don't have for our use-cases). But it is always an option to add the
feature;
- I've split the pach into two: 'shrinker' and 'levels' parts. While the
full-fledged userland shrinker is an interesting idea, we don't have any
users ready for it, so I won't advocate for it too much.
And since at least Kirill has some concerns about it, I don't want the
shrinker to block the pressure levels.
So, these are now separate. At some point, I'd like to both of them
merged, but if anything, let's discuss them separately;
- Rebased onto v3.8-rc2.
RFC v2 (http://lkml.org/lkml/2012/12/10/128):
- Added documentation, describes APIs and the purpose;
- Implemented shrinker interface, this is based on Andrew's idea and
supersedes my "balance" level idea;
- The shrinker interface comes with a stress-test utility, that is what
Andrew was also asking for. A simple app that we can run and see if the
thing works as expected;
- Added reclaimer's target_mem_cgroup handling;
- As promised, added support for multiple listeners, and fixed some other
comments on the previous RFC.
RFC v1 (http://lkml.org/lkml/2012/11/28/109)
--
Documentation/cgroups/mempressure.txt | 97 +++++
Documentation/cgroups/mempressure_test.c | 213 ++++++++++
include/linux/cgroup_subsys.h | 6 +
include/linux/vmstat.h | 11 +
init/Kconfig | 13 +
mm/Makefile | 1 +
mm/mempressure.c | 487 +++++++++++++++++++++++
mm/vmscan.c | 4 +
8 files changed, 832 insertions(+)
=== Highlights ===
* Pestered infrastructure and HR folks with tons of annoying questions
(thanks everyone! :)
* Got access to hackbox.linaro.org and as a temporary build system
* Got a test environment & cross compiler working
* Merged fixes from Tixy and Tushar to linaro.android branch
* Talked with Jakub and Zach about tree management plans
* Generated patches for alarm-dev compat_ioctl work & sent out to lkml
* Booked travel to Hong Kong for Connect
* Couple of community issues
=== Plans ===
* Get alarm-dev compat_ioctl work merged
* Sync w/ Serban on other compat_ioctl work
* Review Minchan's patches (still!)
* Merge a handful of community timekeeping patches & sync w/ tglx
=== Issues ===
* Still chasing some infrastructure issues
== Linus Walleij linusw ==
=== Highlights ===
* Handled the ux500 cpufreq and clksrc patches queued up
from Ulfs and Fabios side. Pushed Rafael Wysocki and
Sam Ortiz to obtain ACKs and after succeeding with that
send a pull request to the ARM SoC tree, Olof pulled it in.
* As explained last week working on AB8500 GPIO as it is a
roadblock for the multiplatform, as it is a SPARSE_IRQ
regression.
https://blueprints.launchpad.net/linux-linaro/+spec/ab8500-gpio-shapeup
* Backmerged a set of patches for GPIO ranges into the internal
kernel tree to use as a base when preparing the new nice AB8500
driver.
* Had a report on the v3.8 not booting properly using DT for
some reason, maybe SPARSE_IRQ-related. Investigation
ongoing.
* Had a stab at the pinctrl and gpio subsystem backlog from the
mailing lists. Much remains, I have some week of backlog.
* Helped Lee a bit with advice & such ... the usual. Looked
into the charging patches a bit, looked at other stuff floating
by a bit. Both Lee & Fabio are doing great stuff at high speed
for ux500.
=== Plans ===
* First fix the AB8500 mess.
* Attack the remaining headers in arch/arm/mach-ux500
so we can move forward with multiplatform for v3.9.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Look into regmap. Try something out, get to know it.
=== Issues ===
* N/A
Thanks,
Linus Walleij
== Ulf Hansson ==
=== Highlights ===
* Spend two weeks of christmas holidays has in Sweden. I should be
full of energy right. :-)
Storage:
* Reviewing patches on mmc-list related to SDIO suspend/resume when
using SDIO IRQ as wakeup.
* Continue reviewing patches on mmc-list for Idle time BKOPS.
* Patches on mmc-list for fixing signal voltage switch procedure for
UHS mode seems ready. Acked and tested by different host driver
authors.
* Several patches sent for discussion for mmci host driver. Some has
been merged for 3.9.
Clk:
* Internal work done. Needed to be able to prepare a patchset to
implement abx500 clocks.
* Sent patchset for clk framework, to make an unsued clk unprepared at
late_init. Tested with a ux500 temporary patch.
=== Plans ===
Storage:
* Follow up on Idle time BKOPS patches on mmc list. Might help out in
sending a skeleton patch which the work can be based upon. Related to
runtime PM.
* Doing an overall analyse about the eMMC 4.5/4.6 features. Check what
can be considered finished, what needs further fixing and point out
the new features for which we should spend our focus on in Linaro
storage team.
* Push patches for mmci host driver to support for UHS cards.
* Push patches for mmci host driver to further extend the power
management support.
* Push patches for mmci host driver to add new features like CMD23
support and more.
Clk:
* Add support for new clk-types in abx500 clock driver for the ux500 platform.
* Send patch to let ux500 clks be unprepared at late_init. Depending
on the patches on the clk framework for this.
=== Issues ===
* Been trying for several month to get a hold of eMMC 4.5 device with
an SD-card adapter. Extremely important for the storage work in Linaro
to fully test eMMC4.5 features. Still no luck.
Kind regards
Ulf Hansson
==== Activity Summary ====
* Shawn Guo updated me on Runtime Size information for i.mx platform
* Additional 2 patch of ab8500 DT has been accepted by anton
* Working on MULTIPLATFORM enablement, presently looking into mach
folder segregation and populating include/linux/platform_data/ folder
accordingly
* Discussion with ShawnGuo on MULTIPLATFORM config.
==== Plan ====
* Continue Adding Multiplatform Config support
* Syncup with Linusw on Multiplatform Config
==== Issues ====
1 Day holiday
==== Activity Summary ====
* Completed "runtime size" data gathering across Vexpress-QEMU, i.MX
and U8500 platforms
* 3.7 is the kernel version verified across the said platforms
* Thanks to Shawn Guo for providing statistics on i.MX platform
* Google doc has been created and shared across relevant members
* Looking into adding Multiplatform Config support for U8500 platform
* Support for Rajagopal on Snowball board setup with tiny rootfs for
his testing/verification.
==== Plan ====
* Collect inputs from linusw on MultiPlatform work done so far and
continue to work
==== Issues ====
--- NA---
Hello Andrew, Russell,
Just resending this once again...
(Also rebased onto v3.8-rc2, and since there were some irqdomain changes,
I had to drop VIC changes from the series, and place the IRQ rerouting
code into the board code. But that is even better, so far we don't need it
anywhere else.)
Short description of the KDB/FIQ debugger:
The FIQ debugger is a facility that can be used to debug situations when
the kernel stuck in uninterruptable sections, e.g. the kernel infinitely
loops or deadlocked in an interrupt or with interrupts disabled. On some
development boards there is even a special NMI button, which is very
useful for debugging weird kernel hangs.
And FIQ is basically an NMI, it has a higher priority than IRQs, and upon
IRQ exception FIQs are not disabled. It is still possible to disable FIQs
(as well as some "NMIs" on other architectures), but via special means.
Old changelogs and a full rationale for these patches can be found here:
v1-v5, rationale: http://lkml.org/lkml/2012/9/10/2
v6: http://lkml.org/lkml/2012/9/10/2
v7: http://lkml.org/lkml/2012/9/13/367
v8: http://lkml.org/lkml/2012/9/19/525
v9: http://lkml.org/lkml/2012/9/24/538
Thanks!
Anton
--
arch/arm/Kconfig | 19 ++++
arch/arm/include/asm/kgdb.h | 7 ++
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/entry-armv.S | 167 +---------------------------
arch/arm/kernel/entry-header.S | 170 +++++++++++++++++++++++++++++
arch/arm/kernel/kgdb_fiq.c | 118 ++++++++++++++++++++
arch/arm/kernel/kgdb_fiq_entry.S | 87 +++++++++++++++
arch/arm/mach-versatile/Makefile | 1 +
arch/arm/mach-versatile/kgdb_fiq.c | 55 ++++++++++
9 files changed, 459 insertions(+), 166 deletions(-)
=== Highlights ===
* Now a Linaro Employee!
* Fresh installed my client VM and personal netbook, got most of my work
environment set up (still some minor tweaking to do).
* Got local git trees re-generated
* Generated base testing VM image
* Ordered a build/test workstation for development
* Talked with Ryan & emailed with Jakub about tree management plans
* Generated a test branch updating the linaro.android tree to 3.8-rc2+
and sent it out for testing
* Generated a new blueprint for alarm-dev compat_ioctl work
=== Plans ===
* Continue tweaking work environment config
* Take a first pass swing at alarm-dev compat_ioctl work
* Apply/review Minchan's latest anon volatile patch
=== Issues ===
* Having difficulty getting access to hackbox.linaro.org
== Linus Walleij linusw ==
=== Highlights ===
* Sent pinctrl patches for v3.8 to Torvalds and he pulled them
in.
* Sent a first batch of updates for the -rc series for pinctrl as well
and Torvalds has pulled in these too.
* Grant has brough the pending GPIO patches upstream through
his tree.
* Inquiry into the state of CodeAurora's CoreSight patch set spurred
a fruitful discussion and the author has posted a first patch set.
* Working on multiplatform. So we have to take a step back:
When the platform was migrated to SPARSE_IRQ all drivers
should nominally have been converted to use irqdomain first.
This was not the case: the AB8500 GPIO driver was missed
(drivers/gpio/gpio-ab8500.c) So now it needs to be fixed.
However it turns out that this driver has a number of problems,
apart from being marked broken. So now I am working with
Patrice Chotard and Lee Jones to reshape this driver into
a proper pinctrl driver and put it into the pinctrl subsystem for
v3.9. Created a blueprint for this:
https://blueprints.launchpad.net/linux-linaro/+spec/ab8500-gpio-shapeup
* Reviewed and back-merged a number of irqdomain and DT
patches to the internel v3.4 baseline while interacting with the
landing team. Now only AB8500 GPIO remains.
* Reviewed and back-merged the timer-based delay patches that
Fabio from the landing team has been working on. We have a
pending patch series for these, which will be sent to ARM SoC
ASAP.
* Reviewed and back-merged Fabios sync work for the DMA40
driver.
* Sent two fixes for the Nomadik post-v3.8 so it boots again.
* Worked a bit on U300 cleanups.
=== Plans ===
* First fix the AB8500 mess.
* Attack the remaining headers in arch/arm/mach-ux500
so we can move forward with multiplatform for v3.9.
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Look into other Ux500 stuff in need of mainlining...
using an internal tracking sheet for this.
* Look into regmap. Try something out, get to know it.
=== Issues ===
* Some internal stir and vacation has affected productivity the
last month.
Thanks,
Linus Walleij
Hi everyone,
When building a kernel with the Linaro ARM toolchain I have two
seemingly simple questions, however I have been getting some very
different advice depending on who I talk to and what I read online,
study in gits etc. Hardware specific optimizations are confusing and
hard to test in a kernel since it such a multi-purpose conglomeration of
code. I just want to make sure I am using the correct general approach
before moving forward with trying things and testing. Our project is all
about testing and researching ways to increase kernel/Android
performance, so please don't reply with "just use an -O2 compilation and
forget about it" unless you have data you can provide that suggest that
this will give better performance than adding specific hardware
compilation flags.
Hopefully this is the right crowd to ask, wasn't sure if I should try
the kernel or Android list. I posted in the NEON list, but my message is
the only one from December! That leaves me with little hope there, so
we'll see how it goes here. If anyone can help me with part 1 or part 2,
I would be delighted!
Background:
* 3.4.x Android kernel
* Qualcomm APQ8064 quad core CPU (Cortex A15-like SoC with NEON/vfpv4
per core support).
* We are using the Linaro ARM toolchain 4.7.3 release 2012.11 on Linux
(arm-linux-gnueabihf).
Part 1) Which hardware and floating point compiler flags are
recommended/applicable for the above mentioned SoC when building kernel
itself?
-mtune=cortex-a15 (is this really doing anything for us in the
tool-chain's current state?)
Which -mfpu flag and other associated flags should we use in the Linaro
12.11 toolchain?
-mfpu=-neon-vfpv4
-mfpu=-vfpv4
-mfpu=-neon
-mvectorize-with-neon-quad
-funsafe-math-optimizations (is this required for -neon-vfpv4 and
-vfpv4 like we would use it for plain old -neon?)
Part 2) Next, which kernel Makefiles should be optimized using the
hardware specific flags from Q1? From my research thus far, this is our
current setup and we currently doing an -O2 build.
/Makefile:
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
-Wno-format-security \
-fno-delete-null-pointer-checks -mno-unaligned-access \
-march=armv7-a -mtune=cortex-a15 \
-fpredictive-commoning -fgcse-after-reload -ftree-vectorize \
-fipa-cp-clone -fsingle-precision-constant -pipe \
-funswitch-loops -floop-interchange \
-floop-strip-mine -floop-block
CFLAGS_MODULE = (BLANK, but some say we should have flags here)
AFLAGS_MODULE = (BLANK, but some say we should have flags here)
LDFLAGS_MODULE =
CFLAGS_KERNEL = (BLANK, but some say we should have flags here)
AFLAGS_KERNEL = (BLANK, but some say we should have flags here)
/arch/arm/Makefile
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call
cc-option,-mtune=cortex-a15 -march=armv7-a -mfpu=neon-vfpv4
-ftree-vectorize -funsafe-math-optimizations,-march=armv7-a
-Wa$(comma)-march=armv7-a)
/arch/arm/vfp/Makefile
KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=neon-vfpv4
-ftree-vectorize -funsafe-math-optimizations)
If you can give any advice, it would be greatly appreciated.
Thanks and have a Happy New Year!