lkml.org 
[lkml]   [2009]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: memory-controller patch fails to boot in qemu [mmotm]
    * Hugh Dickins <hugh.dickins@tiscali.co.uk> [2009-08-01 23:09:09]:

    > I've just finished chasing something similar (without qemu),
    > and was about to post this:
    >
    > [PATCH mmotm] memory controller: soft limit organize cgroups v9 fix
    >
    > CONFIG_CGROUP_MEM_RES_CTLR=y CONFIG_PREEMPT=y mmotm fails to boot:
    > Kernel panic - not syncing: No init found; after lots of scheduling
    > while atomics, starting from when async_thread does sd_probe_async.
    >
    > mem_cgroup_soft_limit_check() was doing an unbalanced get_cpu():
    > don't get_cpu if we won't need it, and put_cpu if we did get_cpu.
    >
    > Hmm, this a weird function, passed an argument just to tell it to do
    > nothing. Perhaps a placeholder for something more sensible to come?
    >
    > Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
    > ---
    > Fix to memory-controller-soft-limit-organize-cgroups-v9.patch
    >
    > mm/memcontrol.c | 4 +++-
    > 1 file changed, 3 insertions(+), 1 deletion(-)
    >
    > --- mmotm/mm/memcontrol.c 2009-08-01 05:48:08.000000000 +0100
    > +++ linux/mm/memcontrol.c 2009-08-01 21:45:37.000000000 +0100
    > @@ -375,19 +375,21 @@ static bool mem_cgroup_soft_limit_check(
    > bool over_soft_limit)
    > {
    > bool ret = false;
    > - int cpu = get_cpu();
    > + int cpu;
    > s64 val;
    > struct mem_cgroup_stat_cpu *cpustat;
    >
    > if (!over_soft_limit)
    > return ret;
    >
    > + cpu = get_cpu();
    > cpustat = &mem->stat.cpustat[cpu];
    > val = __mem_cgroup_stat_read_local(cpustat, MEM_CGROUP_STAT_EVENTS);
    > if (unlikely(val > SOFTLIMIT_EVENTS_THRESH)) {
    > __mem_cgroup_stat_reset_safe(cpustat, MEM_CGROUP_STAT_EVENTS);
    > ret = true;
    > }
    > + put_cpu();
    > return ret;
    > }
    >

    I can confirm that this fixes the problem with CONFIG_PREEMPT enabled.

    Tested-by: Balbir Singh <balbir@linux.vnet.ibm.com>
    Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>


    --
    Balbir


    \
     
     \ /
      Last update: 2009-08-02 00:47    [W:0.025 / U:59.180 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site