From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49539C4338F for ; Fri, 20 Aug 2021 12:28:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 277B5610CF for ; Fri, 20 Aug 2021 12:28:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbhHTM2u (ORCPT ); Fri, 20 Aug 2021 08:28:50 -0400 Received: from mail.skyhub.de ([5.9.137.197]:33530 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234564AbhHTM2u (ORCPT ); Fri, 20 Aug 2021 08:28:50 -0400 Received: from zn.tnic (p200300ec2f107b00008ff220e59d9b99.dip0.t-ipconnect.de [IPv6:2003:ec:2f10:7b00:8f:f220:e59d:9b99]) (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 B5B151EC0246; Fri, 20 Aug 2021 14:28:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1629462487; 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=laUj2sSr+v6xXMrCF2u5SlBS0ZZzRYETUmrem4xszY4=; b=GBO8pTvAHd53n0rwNr5KdbXcnRERqRc+6sIA7jTTruA3OGUMcEjZEXlnpxv9ol27Sfbz4t m/qfrlS2zR1k1NmM+YMdj52FAzYEAVI6D4863/3GPRFGcZfQ641yPRAMXmKk6rMsLktphq LNx++OI5s2uPY3gxnhUJg0WfaBBIRYY= Date: Fri, 20 Aug 2021 14:28:45 +0200 From: Borislav Petkov To: Tony Luck Cc: x86@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Sumanth Kamatala Subject: Re: [PATCH] x86/mce/dev-mcelog: Call mce_register_decode_chain() much earlier Message-ID: References: <20210819224452.1619400-1-tony.luck@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210819224452.1619400-1-tony.luck@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org On Thu, Aug 19, 2021 at 03:44:52PM -0700, Tony Luck wrote: > which made sure that the logs were not lost completely by printing > to the console. But parsing console logs is error prone. Users > of /dev/mcelog should expect to find any early errors logged to > standard places. Yes, and for that matter, *all* consumers which register on the decoding chain should get a chance to look at those records... > Split the initialization code in dev-mcelog.c into: > 1) an "early" part that registers for mce notifications. Call this > directly from mcheck_init() because early_initcall() is still too late. > This allocation is too early for kzalloc() so use memblock_alloc(). > 2) "late" part that registers the /dev/mcelog character device. ... but this looks like a hack to me: why aren't we adding those early records to the gen_pool and kick the work to consume them *only* *after* all consumers have been registered properly and everything is up and running? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette