Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3699557imu; Mon, 28 Jan 2019 09:15:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN7SN2tg1BNahULERAwheKUpdZwCTlsy1TgmWV46cnbkoHUR3oVi6Gnn61SdjXrTKMmi7eO2 X-Received: by 2002:a17:902:a58a:: with SMTP id az10mr22975837plb.10.1548695704307; Mon, 28 Jan 2019 09:15:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695704; cv=none; d=google.com; s=arc-20160816; b=MQQ9osR+FEOr2S4oMXboWBAyqM/Pl6piFcxwvRy7wfKmaBCtkmNtsStvGs3PtECb8C 4i565Z/F3NX5JzUU+eQD0EWRMcqeeNT/G0uGx8OCqHEQ19oFA/C37Gn5NR7Ejc1QF0HT 8U3xVINpkGCb72ED2Zl3/Phok5r5kS8RWlvE7e6J8GdlPtTBEO3IxyG2vsR1LZOJN94p X/dt9QoLzhpR5dhmwcQckToJgOmWk/6h/jB+excdAjkQOZALkVH9ANuXeb63SYUMCGB9 6JCZDp7gwC6Tq6SG/vAalSPDA6qjhU0SUqQnh5ZJ8A/bOBecKmdySRkdjW4W6RL37O4d HHTw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TBgzcU+QM8oQkU+TUSLXH1qqIRWFo/d97fxNJnnwyPY=; b=moxLk9IZ23Asyh1z8egUm/m+hHFqXvAU9gM1xveRLVqlIX8OMo7hn6N6RDNlsrK2Cr 8A4ydsBZFsrWALAnheQnzDGnGZDMRYMJbKTsTxXkhqaSMwwc9k1ofhCyME6djRkdk7Ns 1vOUFKBYVq+gLM81ykUzYvm2etvXuFinyc+seEHvIGPZQbT4vlpMGlC3d/bIQO+pSFpo 4HzNhl15mJN1hOvlCcWloVA6rV8v2hwLWEc2IWW5jjCS5CnvalWNnL+vJaFxAfQqTFqc uKJGQAEgMK1g37R6r0s+DZNVkRK25lHd5kMBRVplaYENtDAk7ijfk+eCvN8xTkAUA1tg XCXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qzdgx7D4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x186si33070726pfx.269.2019.01.28.09.14.44; Mon, 28 Jan 2019 09:15:04 -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; dkim=pass header.i=@kernel.org header.s=default header.b=qzdgx7D4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732281AbfA1QHy (ORCPT + 99 others); Mon, 28 Jan 2019 11:07:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:58980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732274AbfA1QHv (ORCPT ); Mon, 28 Jan 2019 11:07:51 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B4B820989; Mon, 28 Jan 2019 16:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691670; bh=Cl1eTko4iUGK2WU8wbodBAejJ2Crw/a+kDLMWX2LUgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qzdgx7D4pVEDjkybXiQ7iTrAWqZpSoh4fm30/m+uuC9/hTuRr9/LCQk63b+y+sD4/ VQiACvV+13nUPEwTjrt5nmxnRxyXvbIePsgS9fAdIt7M+JiJrguqEGgIivp+f4oL+q 7dljUd4yr+IUwHwGURySH7pSU6cZPm9RX+pj5Fik= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dennis Zhou , Sasha Levin , linux-mm@kvack.org Subject: [PATCH AUTOSEL 4.19 180/258] percpu: convert spin_lock_irq to spin_lock_irqsave. Date: Mon, 28 Jan 2019 10:58:06 -0500 Message-Id: <20190128155924.51521-180-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dennis Zhou [ Upstream commit 6ab7d47bcbf0144a8cb81536c2cead4cde18acfe ] From Michael Cree: "Bisection lead to commit b38d08f3181c ("percpu: restructure locking") as being the cause of lockups at initial boot on the kernel built for generic Alpha. On a suggestion by Tejun Heo that: So, the only thing I can think of is that it's calling spin_unlock_irq() while irq handling isn't set up yet. Can you please try the followings? 1. Convert all spin_[un]lock_irq() to spin_lock_irqsave/unlock_irqrestore()." Fixes: b38d08f3181c ("percpu: restructure locking") Reported-and-tested-by: Michael Cree Acked-by: Tejun Heo Signed-off-by: Dennis Zhou Signed-off-by: Sasha Levin --- mm/percpu-km.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/percpu-km.c b/mm/percpu-km.c index 38de70ab1a0d..0f643dc2dc65 100644 --- a/mm/percpu-km.c +++ b/mm/percpu-km.c @@ -50,6 +50,7 @@ static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp) const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT; struct pcpu_chunk *chunk; struct page *pages; + unsigned long flags; int i; chunk = pcpu_alloc_chunk(gfp); @@ -68,9 +69,9 @@ static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp) chunk->data = pages; chunk->base_addr = page_address(pages) - pcpu_group_offsets[0]; - spin_lock_irq(&pcpu_lock); + spin_lock_irqsave(&pcpu_lock, flags); pcpu_chunk_populated(chunk, 0, nr_pages, false); - spin_unlock_irq(&pcpu_lock); + spin_unlock_irqrestore(&pcpu_lock, flags); pcpu_stats_chunk_alloc(); trace_percpu_create_chunk(chunk->base_addr); -- 2.19.1