lkml.org 
[lkml]   [2020]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v17 09/21] mm/memcg: add debug checking in lock_page_memcg
    Date
    Add a debug checking in lock_page_memcg, then we could get alarm
    if anything wrong here.

    Suggested-by: Johannes Weiner <hannes@cmpxchg.org>
    Signed-off-by: Alex Shi <alex.shi@linux.alibaba.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: cgroups@vger.kernel.org
    Cc: linux-mm@kvack.org
    Cc: linux-kernel@vger.kernel.org
    ---
    mm/memcontrol.c | 6 ++++++
    1 file changed, 6 insertions(+)

    diff --git a/mm/memcontrol.c b/mm/memcontrol.c
    index 5d45a9159af9..20c8ed69a930 100644
    --- a/mm/memcontrol.c
    +++ b/mm/memcontrol.c
    @@ -1983,6 +1983,12 @@ struct mem_cgroup *lock_page_memcg(struct page *page)
    if (unlikely(!memcg))
    return NULL;

    +#ifdef CONFIG_PROVE_LOCKING
    + local_irq_save(flags);
    + might_lock(&memcg->move_lock);
    + local_irq_restore(flags);
    +#endif
    +
    if (atomic_read(&memcg->moving_account) <= 0)
    return memcg;

    --
    1.8.3.1
    \
     
     \ /
      Last update: 2020-07-25 15:02    [W:10.463 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site