Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1401994ybm; Tue, 21 May 2019 13:31:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqkzBQD9H453n3jcnnsPkC4H5S+wNzSXTNet1BiZXDlu5ZXqbxAWb/pfDVoqjWtHLcHKCw X-Received: by 2002:a62:4ed8:: with SMTP id c207mr91389926pfb.241.1558470717347; Tue, 21 May 2019 13:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558470717; cv=none; d=google.com; s=arc-20160816; b=A+XmcWKX2RcvAplgX1JvmaIjtrMN64rN902iYmRfdK5J32uvaJVBRK+mYclRaCSXV/ NlLRZ24LnfL/PvpwipUjV1lWyK9o7Hmyf+53lQESBBN1ATIGX2twrGxn3HYnYVoz8/L8 RqvUkbTtrYCYSyMmWB7O1QOEjSBX7C5uLTuOnbA4HHYHHYAQsM7IzDDMIpZhzfa+mjPZ fGaQTZUydV9IkFpJxazOraiiv4xEGklYsTqBGSGmGjvM2JlMZtoXd1e+pXtN4lS8fTAL A8yBmy1ONivr37sbY4xSkhVlzL8adwV5JBRlozlQLBcZPfA5qZq4BQfjoBpEEeWAsMnt pOmg== 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:dkim-signature; bh=nWtU54S/AlDT7qsEIiPBtbUXaUC/TQ5AZRXgMuRXRY0=; b=04OXkvAVKOHW7U96MNkmbnx/S2W/+OsMxLsDiXLvYj1OaTv7DQJ/pwmxWULcHIP9Db GRCZlf/vBWHzfXk5pWTemoL+3d6n3Ysu+fdDWNZJ0HtQBNlVtsRvObZTwh37UguOo+K0 SfBnHkyuoLVrizWWplnd0D1jcZdb+r7yMnWpTi9Y4B0JudJWujyAinDE7t9/Q4cm24tq RgdAMuZ3WFA0WsEaQAPAwbgf1Hjh2jaNP81aiqn+nSI4VKes9EVScwqMKDxjmpzIOzJF BF1c+6A3V0MfGyZaP5lS8jJWWo2HmNvuc/Af5KlhTaZaBsnzApcj78NiJy/nVSaBgH+H E92g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="bab7/Ako"; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d34si23264234pld.58.2019.05.21.13.31.40; Tue, 21 May 2019 13:31:57 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b="bab7/Ako"; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727341AbfEUU2d (ORCPT + 99 others); Tue, 21 May 2019 16:28:33 -0400 Received: from mail.skyhub.de ([5.9.137.197]:46270 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726766AbfEUU2d (ORCPT ); Tue, 21 May 2019 16:28:33 -0400 Received: from cz.tnic (unknown [165.204.77.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id CB3441EC0513; Tue, 21 May 2019 22:28:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1558470511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=nWtU54S/AlDT7qsEIiPBtbUXaUC/TQ5AZRXgMuRXRY0=; b=bab7/AkoSjJQEgR3rABmbMdDtzPvBurqhLi2+Tc0eUhxqIwlT4oE8T2WsndzhrrnTJ/+kI wVQaC7zAdmWBgt8D5hf6EJK4PbBWKAfqnX1QNZIfiwapmuIu8Hd+fACXZw/5KcR7d26BcG eJYxuh7AKx/93AEX+xH5GpNZy0VzSiU= Date: Tue, 21 May 2019 22:29:02 +0200 From: Borislav Petkov To: "Ghannam, Yazen" Cc: "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "tony.luck@intel.com" , "x86@kernel.org" Subject: Re: [PATCH v3 4/6] x86/MCE: Make number of MCA banks per_cpu Message-ID: <20190521202902.GC7793@cz.tnic> References: <20190430203206.104163-1-Yazen.Ghannam@amd.com> <20190430203206.104163-5-Yazen.Ghannam@amd.com> <20190518112530.GA26276@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 21, 2019 at 05:52:42PM +0000, Ghannam, Yazen wrote: > This message comes from ___might_sleep() which checks the > system_state. > > On CPU0, system_state=SYSTEM_BOOTING. > > On every other CPU, system_state=SYSTEM_SCHEDULING, and that's the > only system_state where the message is shown. Right, the check in ___might_sleep(). > Changing GFP_KERNEL to GFP_ATOMIC seems to be a fix. Is this > appropriate? Or do you think there's something else we could try? From: Documentation/core-api/memory-allocation.rst * If you think that accessing memory reserves is justified and the kernel will be stressed unless allocation succeeds, you may use ``GFP_ATOMIC``. I don't think the MCA banks representation justifies accessing memory reserves. Can we do instead: -static DEFINE_PER_CPU_READ_MOSTLY(struct mce_bank *, mce_banks_array); +static DEFINE_PER_CPU_READ_MOSTLY(struct mce_bank, mce_banks_array[MAX_NR_BANKS]); which should be something like 9*32 = 288 bytes per CPU. Unless you have a better idea... Thx. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. Srsly.