Received: by 10.192.165.156 with SMTP id m28csp819641imm; Wed, 11 Apr 2018 07:45:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+hf0mJtoyd3IRLsDNRUa+gWTXu42UmBeSOkEnnyfRwOTdhMznapnOzK2cqXU22HhdXtTek X-Received: by 10.98.9.72 with SMTP id e69mr4340327pfd.197.1523457959841; Wed, 11 Apr 2018 07:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523457959; cv=none; d=google.com; s=arc-20160816; b=YKmbgPkRXK53X7HH1Jl+Q7ksmM8V5EsWTNMHt/DvsTkcHr8Mn8Ul7P5m8OsJtrdms2 bUshUtpxQbjbQWJQj8xLzdeJUKWKsOAN5e2bmj6TfsTLlVyoJ9kBGg11DD8kS156/eHw s7rA8QF9a1CGBp62gMMWk+3TeWKG3RrQPPNRhd6wLmg/04WmPfnhKHTnRkrZ099hMv+b ni94/dprOmML31ZJCLlWpqTpjFoGGo1SkmvfuDKTu9cUVYoWfSjJVNI55vRB6Neh7Z3A vIDREUOTamIJamFkWh9P/heQIdih8IgVtyJrUpq0iMP5AaGDKYYE/l2KdDg9Xe04nkGR bRlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=hRHkIHkk+lm1CmfzsAUOHyS2P9wl44ruDVjh/y/YhdA=; b=zzXYMX5/Rt7RHIdoelwhhKdieajcDezyoqMlBQFdF5Czx16zdVzDdy1lV42TA7v8NC segf4MOvbfcDKIRnyWSL4JwEjPZnHHIyy+nFssNQjSgEv3o4ZM7mRXzBPWOrNfh1iFZD +fWaaHIieDnEGaaTZ8hdBW6MBlOjXY0adYwkcPmBKiZeiaMYrgE1Mg/ZgynPbo4v3lx7 8TCNp80R+Qb8RF2N12y14NUVGXg6xD1covGHe1TNq0J2/HgkUFfIIIXtWNmZoZjStfZc PT0JI7vk3zyQquI7+iVqaEHc4gUbGG/3Ah3Bo3plrV8bT4sSUZSb134dcdIV6DESEMZH fkZw== 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 n76si970317pfi.122.2018.04.11.07.45.23; Wed, 11 Apr 2018 07:45:59 -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 S1752992AbeDKOm3 (ORCPT + 99 others); Wed, 11 Apr 2018 10:42:29 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:57881 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752351AbeDKOm2 (ORCPT ); Wed, 11 Apr 2018 10:42:28 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1f6Gx3-0003uH-RV; Wed, 11 Apr 2018 16:42:21 +0200 Date: Wed, 11 Apr 2018 16:42:21 +0200 From: Sebastian Andrzej Siewior To: Tejun Heo Cc: Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, "Steven J . Hill" , Andrew Morton , Christoph Lameter Subject: Re: [PATCH] Revert mm/vmstat.c: fix vmstat_update() preemption BUG Message-ID: <20180411144221.o3v73v536tpnc6n3@linutronix.de> References: <20180411095757.28585-1-bigeasy@linutronix.de> <20180411140913.GE793541@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180411140913.GE793541@devbig577.frc2.facebook.com> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-04-11 07:09:13 [-0700], Tejun Heo wrote: > Hello, > > On Wed, Apr 11, 2018 at 03:56:43PM +0200, Vlastimil Babka wrote: > > > 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. > > > > Oh my, and I have just been assured by Tejun that his cannot happen :) > > And yet, in the original report [1] I see: > > > > CPU: 0 PID: 269 Comm: kworker/1:1 Not tainted > > > > So is this perhaps related to the cpu hotplug that [1] mentions? e.g. is > > the cpu being hotplugged cpu 1, the worker started too early before > > stuff can be scheduled on the CPU, so it has to run on different than > > designated CPU? > > > > [1] https://marc.info/?l=linux-mm&m=152088260625433&w=2 > > The report says that it happens when hotplug is attempted. Per-cpu > doesn't pin the cpu alive, so if the cpu goes down while a work item > is in flight or a work item is queued while a cpu is offline it'll end > up executing on some other cpu. So, if a piece of code doesn't want > that happening, it gotta interlock itself - ie. start queueing when > the cpu comes online and flush and prevent further queueing when its > cpu goes down. I missed that cpuhotplug part while reading it. So in that case, let me add a CPU-hotplug notifier which cancels that work. After all it is not need once the CPU is gone. > Thanks. > Sebastian