Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2653418imj; Mon, 11 Feb 2019 06:31:17 -0800 (PST) X-Google-Smtp-Source: AHgI3IZpwmvIVVuaq461ezcZQG47pDjIt7F/fKslin8pZrNi83DubAgOPN4bXu9zFhqC/W5Uxare X-Received: by 2002:a17:902:a50a:: with SMTP id s10mr36075949plq.278.1549895477115; Mon, 11 Feb 2019 06:31:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895477; cv=none; d=google.com; s=arc-20160816; b=C9eVLRPgVKkze1j/LaDngmWbaRIB58RUw/Wvpx/IBu8lhC+GvfRGWm/QoWT97OECDH oZScf6aS8knLUqQKXUx/jyaCtvnvaNOrDL/sXfWt77E81ZYg9dY6UKJrkr1xFMoiq9bH PPkuVNlT2j4NX6qa2lTzSV9F+C8E5Wb8JB5tyWBt0G+QwenHs0EGOHsJT48ItiT06Ddr CTHo4/A550R5p7IlW7TONf+4q/umtMpixJZNuBM2s49IX0YXtfqbAdMO7salGKMraCtM X5ACAYolIMbN84qto/z94jPJHs3lyP3kLfzTCZHseFbts6YgDmASAHJh5Sz6t22LHpeQ rMmA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G1yPJ0MCoo+1/yEkmG/b1XNYcjW2CjIh7YtREtg70XU=; b=H+CxRYkkRjUyLS2bdUJa+UTeMHF6RnjWv9Dup3YHM8K0PGiQLyajuo7fPxxty6Sasa E4xyIQnwPEk/YqGNXpcCXkMQjx00gXj94VAqQLvZ6sfZn28FvfGRD4Aw9X1sQvC4GkCF KY2MidVWKWYFv6xxi6oDR9ziCbCKwT8Y5d7LkaftHmhmBSpUACsJf3yUHW+bUvjETFFS EtdKl+EBcau7iOA4l0bT4kHMQeCVytlKxi1wf3ffgXgJaPpN/EVn9iJhP1vv/L3GGucl mfFDXA4z5GDxPs5vha9QteVImLO+JUpIlyVDTNFBRRXFjaqbLpURRT6OS3f+VulrNRIl 5Wdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J42ohHTl; 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 l93si2225134plb.433.2019.02.11.06.31.00; Mon, 11 Feb 2019 06:31:17 -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=J42ohHTl; 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 S1730149AbfBKOaf (ORCPT + 99 others); Mon, 11 Feb 2019 09:30:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:37024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730138AbfBKOae (ORCPT ); Mon, 11 Feb 2019 09:30:34 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CC9612075C; Mon, 11 Feb 2019 14:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895433; bh=ydFcyEfFoX8ofVlD4LAgaVfiDQyFC9KLX/K6sdCvw+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J42ohHTlO0CylHLGc4DcO7Kx5KLnAdDdXliKnyQs1bApBpXfcDUTAk5Rxl/y7CfGV 91QtzfgNyWHY02QZgdWHk1B8pQPiVZnyKkwtebsBBA1pOp4GWureLLp7YDCYay3QA7 7pVggtTEyCtCoQZskDxabuNK7VGs9f/ihI9YjEAw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tejun Heo , Dennis Zhou , Sasha Levin , Michael Cree Subject: [PATCH 4.20 203/352] percpu: convert spin_lock_irq to spin_lock_irqsave. Date: Mon, 11 Feb 2019 15:17:10 +0100 Message-Id: <20190211141900.062774329@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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