Received: by 10.192.165.156 with SMTP id m28csp516438imm; Wed, 11 Apr 2018 03:01:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx486AEqwQ4jALsIAIhxEDdXlObZcAnItguSM9Jqus9+X8ZlaOcuv9Cw2gZBhK6yBHAYzYBZ5 X-Received: by 10.101.69.198 with SMTP id m6mr2930085pgr.244.1523440915585; Wed, 11 Apr 2018 03:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523440915; cv=none; d=google.com; s=arc-20160816; b=SvCqmMPZjyX18Oiqnsgh+ME5RaIKyY5Q4+EaJdKtTj1AJZWbACvk9ldw7Wrt8OetIH v26rwtXUVkZpYiMRnYOyKNRSD0XVO9ervCs8/lBlHXP+YFmX5hRvYe03UwljmaEPglkx 2Ov8TSe9E1HTV5EJTy3Ev5lb/l2btjhLW4iXui6jpc3QZZYEJ2X/Zoe30tHX0Owwd7N5 PygqxLp91mnRAEAUDlqgY0CRzmogt4WhW5RaQ5X2Te3gw1kqtnWjDmG8XAbMe3x7MKz5 iX4kDOPR7B/hKFA2/y1EoiSJTLmBnGmGEh6b0sFVUGSHYO5hDrVTfWFImtjtZqmz2jZe 1R+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=v2okcYLjDIlCvh/YkKhXo/VCN6EppuYXH3CSNK6o89s=; b=aDCyplSb3xT+uL2kE8+vDjge4gYhxshuBbg3D/ibY/TZPleY7RZ5X6FitCnMKlR2dG nwyKJErFoAfn9UY/aeneGYzRdx1MsD/JnWvhyGepueKOFykq5rUzrW6X+IG9Hm9h67DC 2wiAw84vkVwKjQVtccGCe6KPKoABTjcFykXlnF8JjY9sLhapTJtzo6oxPppdlErcwBK4 RhLFNpUzc4POHf/K3iEbEFet91vXRrPKSv33yDwuJQcnDWJiRut1ikNzX9aVBKPYde7Q EEZSuigTLo2+sCswAuQeEvZ/jhPbAi05A1Ri34r8vleyulaAyMOTMNkT8nI1y+fU8Yq6 0cjw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a33-v6si793520pld.125.2018.04.11.03.01.18; Wed, 11 Apr 2018 03:01:55 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752412AbeDKJ6C (ORCPT + 99 others); Wed, 11 Apr 2018 05:58:02 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:57141 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751546AbeDKJ6A (ORCPT ); Wed, 11 Apr 2018 05:58:00 -0400 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1f6CVq-0007NG-0k; Wed, 11 Apr 2018 11:57:58 +0200 From: Sebastian Andrzej Siewior To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, Sebastian Andrzej Siewior , "Steven J . Hill" , Tejun Heo , Andrew Morton Subject: [PATCH] Revert mm/vmstat.c: fix vmstat_update() preemption BUG Date: Wed, 11 Apr 2018 11:57:57 +0200 Message-Id: <20180411095757.28585-1-bigeasy@linutronix.de> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch reverts commit c7f26ccfb2c3 ("mm/vmstat.c: fix vmstat_update() preemption BUG"). Steven saw a "using smp_processor_id() in preemptible" message and added a preempt_disable() section around it to keep it quiet. This is not the right thing to do it does not fix the real problem. vmstat_update() is invoked by a kworker on a specific CPU. This worker it bound to this CPU. The name of the worker was "kworker/1:1" so it should have been a worker which was bound to CPU1. A worker which can run on any CPU would have a `u' before the first digit. smp_processor_id() can be used in a preempt-enabled region as long as the task is bound to a single CPU which is the case here. If it could run on an arbitrary CPU then this is the problem we have an should seek to resolve. Not only this smp_processor_id() must not be migrated to another CPU but also refresh_cpu_vm_stats() which might access wrong per-CPU variables. Not to mention that other code relies on the fact that such a worker runs on one specific CPU only. Therefore I revert that commit and we should look instead what broke the affinity mask of the kworker. Cc: Steven J. Hill Cc: Tejun Heo Cc: Andrew Morton Signed-off-by: Sebastian Andrzej Siewior --- mm/vmstat.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/vmstat.c b/mm/vmstat.c index 33581be705f0..40b2db6db6b1 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1839,11 +1839,9 @@ static void vmstat_update(struct work_struct *w) * to occur in the future. Keep on running the * update worker thread. */ - preempt_disable(); queue_delayed_work_on(smp_processor_id(), mm_percpu_wq, this_cpu_ptr(&vmstat_work), round_jiffies_relative(sysctl_stat_interval)); - preempt_enable(); } } =20 --=20 2.17.0