Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2124406pxa; Mon, 24 Aug 2020 06:02:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwy9ge33u8vtpBfUgIZrnS7qrvmgn30yjlFT60TCc6WoVOj+zsb2cntQoktI7NTNUBrjCNo X-Received: by 2002:a17:906:e0e:: with SMTP id l14mr5160039eji.398.1598274137565; Mon, 24 Aug 2020 06:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598274137; cv=none; d=google.com; s=arc-20160816; b=FUjfDHsyBwJLHHA6Ol8vp0OzuZpE6kblOf5VmPW+a6W4vLhBHQrqq89QaOIUcmcX03 byLMLtvEhtXG8hqLUd+q/S4YrpthuxNx/6kTsvrp8a5EVt7gVfXYB5m7Ra0mmB3rknfq GuRLm7TuXCzDiS5Q4EAd2PMj4FPUeB4iUzqOI28ufasckcRSRE+/52vhLmX8uqfvig7Q hm4H5siBovhedGqCgBKBMakiXJPvM9IWCQ+FAnh2LfpvgY4IB9QfrHoIKkzwLc5a5FrT 0nwx4ow4oz0mzQXLbT6nWeCxcJ3Tc1rfAqk6jWiPwu8zaeTednaYhwVCRJU30k1SB2qQ oelw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=PtSlp+xr3Hz5Se9YRvdkaZ7xHCR2YacuUrm7ctLjizE=; b=DasQg4rOTH5/LNNOBisSy+BGXpSsgu+G7hqyiELjGiUy8evA0kPIfbxknCV4vuow+h pXJDyGR4B5gw68rjVeMwVouK1K+J9tf5zePsVrfC9O3/gEsVVlVkrcDH4eoYiAepGB/U SzlF7X5LYdkOzEH0j6TVM/MQ0Tnb6klcd4ziHzdYW1TjbB1r+YMLWQrxERbEjuLXurBV 9mW28QUzFz6GYQbV71omYX75OwvvOloc8UxMybTtiiOOuzvZUgv+zeTvMbLB09XZFm4W 1bPutGrSRxgVy2OrQQE0aywawiBw3NGN9vao0XKEsezTqnO4yNwBQ8vd9Wt0wKlKRUwN UE/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si3151292eju.654.2020.08.24.06.01.54; Mon, 24 Aug 2020 06:02:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728161AbgHXM6T (ORCPT + 99 others); Mon, 24 Aug 2020 08:58:19 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:52891 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727079AbgHXMzV (ORCPT ); Mon, 24 Aug 2020 08:55:21 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R641e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07425;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0U6k9-bl_1598273712; Received: from aliy80.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U6k9-bl_1598273712) by smtp.aliyun-inc.com(127.0.0.1); Mon, 24 Aug 2020 20:55:17 +0800 From: Alex Shi To: akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, willy@infradead.org, hannes@cmpxchg.org, lkp@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, shakeelb@google.com, iamjoonsoo.kim@lge.com, richard.weiyang@gmail.com, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com, mhocko@suse.com, vdavydov.dev@gmail.com, shy828301@gmail.com Cc: Michal Hocko Subject: [PATCH v18 11/32] mm/memcg: add debug checking in lock_page_memcg Date: Mon, 24 Aug 2020 20:54:44 +0800 Message-Id: <1598273705-69124-12-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598273705-69124-1-git-send-email-alex.shi@linux.alibaba.com> References: <1598273705-69124-1-git-send-email-alex.shi@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a debug checking in lock_page_memcg, then we could get alarm if anything wrong here. Suggested-by: Johannes Weiner Signed-off-by: Alex Shi Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Andrew Morton 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 5974b449d783..505f54087e82 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2098,6 +2098,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