Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1383430imm; Tue, 22 May 2018 03:15:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpYx/7i8wk9Z0lLOWaeqLQsn2mGfDwcJCQFr+LmYg73LvoWLcbabtgUnFM81Qdi+gXMtIKX X-Received: by 2002:a17:902:14cb:: with SMTP id y11-v6mr23651108plg.229.1526984102440; Tue, 22 May 2018 03:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526984102; cv=none; d=google.com; s=arc-20160816; b=pYfqSaY+NxF8MsKhLy9u1RqhTEfaYdB6vZsDHj/eNUPSB6mN5l52+mZ9CA9OAC+D3f EcAhHQZxoBQZVsMPef1Rmwx+/G2tHhd8iaIjDE4+G0LfFs4LMFQLwivRxP8azSPX9cd3 mr86W9Di7zXSNJ4lZBlQNuukZWO/kQ0X3cb8og8NrHoT4IRAcDjxjclR6twfg9DPRvjk 2fzLdeSPh9AKBZ/A57jdGRbMw41VWmHfTdxv7nn9uZbPtA6hNE5YWqH0kjlDZv0jQqX0 NkHcz+oDXbcVNZk6ZT9Gl8MxRwJkTYX8euK2ZcVMzrrbidjVx+/c/o19IqNbliTsLjwg BQZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=OE2ZNcDMdUMy1P8TkYlLPgSwHBVfU0dOj0AcnkyEaqM=; b=gFFzughV4RqGIKvO8B2BGgdVxSP7kjhovBnC3/ECa+X65Z5+IevWcxDY+HuVa41Rrr VmeaIAnOEvCLKPeSQIVx8oorEnYMPk6mq0ok63kNvKCqAWYsx0BrmcDdc5o9Uhn3IZZb WHZr9ePJUBTQFgdbP4rXwQHEePv65JkfGHmEa0A3gnGLYVxaAXvZUUSW2SwZLRueURNR jp4Bs4iD9qMnQucPUPAkolAgy+3l11i8Evoouf2rJUav/yeBKI0kQl5vR14+T8Vu/baz F09CqNNBePpzQZCz/4jQgCPwCuKvkx8eEV8RVkF/V8NN5eWiV+8OHnCakd6O+Nl9yuj5 j6fQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9-v6si12389984pgv.330.2018.05.22.03.14.47; Tue, 22 May 2018 03:15:02 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751635AbeEVKOj (ORCPT + 99 others); Tue, 22 May 2018 06:14:39 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33540 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751821AbeEVKIE (ORCPT ); Tue, 22 May 2018 06:08:04 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E8CBF40122AA; Tue, 22 May 2018 10:08:03 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-125.ams2.redhat.com [10.36.117.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D75A1134CCC; Tue, 22 May 2018 10:08:02 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, David Hildenbrand , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com (open list:KASAN) Subject: [PATCH v2 2/2] kasan: fix memory hotplug during boot Date: Tue, 22 May 2018 12:07:56 +0200 Message-Id: <20180522100756.18478-3-david@redhat.com> In-Reply-To: <20180522100756.18478-1-david@redhat.com> References: <20180522100756.18478-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 22 May 2018 10:08:03 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 22 May 2018 10:08:03 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using module_init() is wrong. E.g. ACPI adds and onlines memory before our memory notifier gets registered. This makes sure that ACPI memory detected during boot up will not result in a kernel crash. Easily reproducable with QEMU, just specify a DIMM when starting up. Signed-off-by: David Hildenbrand --- mm/kasan/kasan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index 53564229674b..a8b85706e2d6 100644 --- a/mm/kasan/kasan.c +++ b/mm/kasan/kasan.c @@ -892,5 +892,5 @@ static int __init kasan_memhotplug_init(void) return 0; } -module_init(kasan_memhotplug_init); +core_initcall(kasan_memhotplug_init); #endif -- 2.17.0