Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8546639ybl; Wed, 25 Dec 2019 01:05:55 -0800 (PST) X-Google-Smtp-Source: APXvYqy4NySvV6TY3SeUeewhzL2AP9+KgWgNC418PEdBJ2L5dEWd6ZoW98MZSSe9lCe0V8sbXJpn X-Received: by 2002:a9d:6d06:: with SMTP id o6mr44314306otp.239.1577264754997; Wed, 25 Dec 2019 01:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577264754; cv=none; d=google.com; s=arc-20160816; b=XTfhFZgL5hHgDbbcV7eXdf0HPDYT3DAmplFMvUXqC86/wRHoN9fmLweseVtx1qogQT dbHfwlCDjNU2e0V4zt8cY2KRzq357ATIyfJAZIyP2heveaNcPYMZFTFyAfHcmN8eFPxS HUbhGoLuFpJ5BSrTKUCfs5afzb3Opnc92nMNE20YwdtSbUm6BWi5xuUBVIDotxVAO5xD t++yU61115Nk7HpNCWzqvH70lA8t/uREAY9pi3e5DDfANTiiGypGqP8rKv1dNcbMmJb9 0qNOurb1X0i11ydTvplTOko9w1AyJj1jODx6c5TarrsXu7QSimu6OHDyePnicdIp3aE1 08DA== 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=z1ZsV6Gy02LykVJC7/Q55z/z2ELX8oZZdlZyLf8e3JY=; b=mpbs4dtNdujictFZncddw0b9H2uY3SHt5Rn2kw0QtycMj5ZKr+erJWPle7WXe6C7pN lw19zqt1UTrX5KG56fF+SzJmu7M07TdJHlHXiVrplRy6kSWfWnVqvxs7cIYwffiDIt5l N4SDdiFZaYHFggYjyEn3hCUUE8aRVrIi6gPVEQortjKiZH2tZ3WemDhVb2zRGXfEDn49 KHFNg4LRa7oSj2LALgGhnH/0PM5ewW5GVdQD4pVwp/pMHLl1XH9MTnIsAJ3UaGVl5/w4 YWyzJzDttoZPajjKZMbig+Awp5wMoKN/KO0KtlAzL3e2p8LJ8yrpYb+wQ0GW2tki4gCO +4fQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id u12si8815682oiv.13.2019.12.25.01.05.44; Wed, 25 Dec 2019 01:05:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726971AbfLYJEz (ORCPT + 99 others); Wed, 25 Dec 2019 04:04:55 -0500 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:36593 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbfLYJEw (ORCPT ); Wed, 25 Dec 2019 04:04:52 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R831e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07487;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0TltDsSh_1577264685; Received: from localhost(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0TltDsSh_1577264685) by smtp.aliyun-inc.com(127.0.0.1); Wed, 25 Dec 2019 17:04:45 +0800 From: Alex Shi To: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, yang.shi@linux.alibaba.com, willy@infradead.org, shakeelb@google.com, hannes@cmpxchg.org Cc: Michal Hocko , Vladimir Davydov Subject: [PATCH v7 10/10] mm/memcg: add debug checking in lock_page_memcg Date: Wed, 25 Dec 2019 17:04:26 +0800 Message-Id: <1577264666-246071-11-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1577264666-246071-1-git-send-email-alex.shi@linux.alibaba.com> References: <1577264666-246071-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 This extra irq disable/enable and BUG_ON checking costs 5% readtwice performance on a 2 socket * 26 cores * HT box. So it's a temporary debugging and need to be remove finially. 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 33bf086faed0..1512be4d8bde 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2022,6 +2022,11 @@ struct mem_cgroup *lock_page_memcg(struct page *page) if (unlikely(!memcg)) return NULL; + /* temporary lockdep checking, need remove */ + local_irq_save(flags); + might_lock(&memcg->move_lock); + local_irq_restore(flags); + if (atomic_read(&memcg->moving_account) <= 0) return memcg; -- 1.8.3.1