Received: by 10.213.65.68 with SMTP id h4csp416631imn; Wed, 4 Apr 2018 00:19:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx48O4GTzWlhpX0h3onIcQ5vjYglpLlOArhNs6cKZpbFmjunugEpApXCk6ogYglHtEit066rw X-Received: by 10.98.163.68 with SMTP id s65mr13043336pfe.13.1522826345325; Wed, 04 Apr 2018 00:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522826345; cv=none; d=google.com; s=arc-20160816; b=IOtLGvCkGRcqRmINyv9RMM07r1DiysXnVMouuu+olmZlohdbUQ/ICKTByirG7iAYb2 fReR3ZPQmbG7jNLtEZ5gM2tinWsBnD2CpSNDM6/p8HBw9Ax5hw+VbzJqz9Qg3hXIzErf IzJEFlV+nMM0fZkiyL8VZ4wD5QfDRhMAQ3zLZfw3l8Hg2cCtBiAMOtvLn/58WcrVPeBy PgL7OTGjHl/lLehSXcVt7llfqOSZ5VcNNVPpScY2kDpBWqw2/IL8f2V44tb6JufOSD2k tZ1FzX1sb6pS2ODOqAVqUq7hQ0+pNQ3Q78gbcniCdXT/EGVkzOs54PV0HhwzGIt5X8oU B4EA== 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:arc-authentication-results; bh=Eu2NMGQPs2U3R1ooG6dDfpvl8KMV31KL3B8FyYDPh6M=; b=Utj2wJSzYtYbX03Y4L7BNjHToTTQV6jWswgPYhboizeMkJPtuDx9kYfyHieeAaCCZz vtJtWWXrxe4lgzaUB7TR5xS9+53znhA0QCkiO1xaKGrEOU50TIr8sZNaH3C8uopr6/jG bRcgmATYUMKu+fXZbY+DhUmbsF5odHcFU1FMJPrMcn9jhKXOLcisesGvEoyTOE3H6HkQ P6qsw0FGIHYpN4cKbdfFp/z0UIhmsbhMFISbTAugvpBexpf8Kbf6fewyH0nPY4ZmW8vO YSbkIiW8RJ4jmI0XgrgmMscu5Ry4lX+6JAWq5Zd78rx0mj27qbUQa3NsUa8mPOm0QIFe VT6Q== 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=monom.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11-v6si2673474plm.19.2018.04.04.00.18.51; Wed, 04 Apr 2018 00:19:05 -0700 (PDT) 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=monom.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751439AbeDDHRX (ORCPT + 99 others); Wed, 4 Apr 2018 03:17:23 -0400 Received: from mail.monom.org ([188.138.9.77]:49550 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751306AbeDDHRS (ORCPT ); Wed, 4 Apr 2018 03:17:18 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id CF433500C40; Wed, 4 Apr 2018 09:17:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail.monom.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Received: from localhost (ppp-93-104-185-33.dynamic.mnet-online.de [93.104.185.33]) by mail.monom.org (Postfix) with ESMTPSA id 90F09500C50; Wed, 4 Apr 2018 09:17:15 +0200 (CEST) From: Daniel Wagner To: linux-kernel@vger.kernel.org Cc: linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Paul Gortmaker , Julia Cartwright , Daniel Wagner , tom.zanussi@linux.intel.com, stable@vger.kernel.org, Sebastian Andrzej Siewior Subject: [PATCH RT 6/7] Revert "memcontrol: Prevent scheduling while atomic in cgroup code" Date: Wed, 4 Apr 2018 09:16:51 +0200 Message-Id: <20180404071652.24196-7-wagi@monom.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404071652.24196-1-wagi@monom.org> References: <20180404071652.24196-1-wagi@monom.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Steven Rostedt (VMware)" The commit "memcontrol: Prevent scheduling while atomic in cgroup code" fixed this issue: refill_stock() get_cpu_var() drain_stock() res_counter_uncharge() res_counter_uncharge_until() spin_lock() <== boom But commit 3e32cb2e0a12b ("mm: memcontrol: lockless page counters") replaced the calls to res_counter_uncharge() in drain_stock() to the lockless function page_counter_uncharge(). There is no more spin lock there and no more reason to have that local lock. Cc: Reported-by: Haiyang HY1 Tan Signed-off-by: Steven Rostedt (VMware) [bigeasy: That upstream commit appeared in v3.19 and the patch in question in v3.18.7-rt2 and v3.18 seems still to be maintained. So I guess that v3.18 would need the locallocks that we are about to remove here. I am not sure if any earlier versions have the patch backported. The stable tag here is because Haiyang reported (and debugged) a crash in 4.4-RT with this patch applied (which has get_cpu_light() instead the locallocks it gained in v4.9-RT). https://lkml.kernel.org/r/05AA4EC5C6EC1D48BE2CDCFF3AE0B8A637F78A15@CNMAILEX04.lenovo.com ] Signed-off-by: Sebastian Andrzej Siewior --- mm/memcontrol.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 493b4986d5dc..56f67a15937b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1925,17 +1925,14 @@ static void drain_local_stock(struct work_struct *dummy) */ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) { - struct memcg_stock_pcp *stock; - int cpu = get_cpu_light(); - - stock = &per_cpu(memcg_stock, cpu); + struct memcg_stock_pcp *stock = &get_cpu_var(memcg_stock); if (stock->cached != memcg) { /* reset if necessary */ drain_stock(stock); stock->cached = memcg; } stock->nr_pages += nr_pages; - put_cpu_light(); + put_cpu_var(memcg_stock); } /* -- 2.14.3