From patchwork Tue May 22 10:07:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10417841 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D02A76016C for ; Tue, 22 May 2018 10:08:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0B3E1FF60 for ; Tue, 22 May 2018 10:08:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4F5D27DA4; Tue, 22 May 2018 10:08:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52E9B1FF60 for ; Tue, 22 May 2018 10:08:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4546D6B000C; Tue, 22 May 2018 06:08:05 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3E1DB6B000D; Tue, 22 May 2018 06:08:05 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28CCC6B000E; Tue, 22 May 2018 06:08:05 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f199.google.com (mail-qt0-f199.google.com [209.85.216.199]) by kanga.kvack.org (Postfix) with ESMTP id D9D856B000C for ; Tue, 22 May 2018 06:08:04 -0400 (EDT) Received: by mail-qt0-f199.google.com with SMTP id y7-v6so18535255qtn.3 for ; Tue, 22 May 2018 03:08:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=OE2ZNcDMdUMy1P8TkYlLPgSwHBVfU0dOj0AcnkyEaqM=; b=MbLm7VNeuGWEy/8Vmso4ySEDBLYnUD8LDafysceCadOpZ5Aj89BmgZPdeZybPG60XN CV8+0prKpT5BrH4hLCy4vX6DEYWfaEydWbbhtCDy4nQT7KskbLIl+VUiGfZc9CepiHOq mXWy/sSVHUyJF43+m2+s8y2tD+B6vEPm6hSNTJVQnPXAUtY1b6t/t+85np1IN/5/DVn1 B/yiSTLkXf+8dfa1TC3ZAXKxiuP5alLj3d3kcHSqFc3Sf/0rrfVEKGGovnv5q7wQ35Js sYj5Vv/IKy/IFQO4HWog51lIOXjB+iCHpqHuCclGQiReieUwBEibhdATKrl+g+KadvGI nSzQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: ALKqPwc049MDV1W4sIYhzZHGbaYpoa56lPKOWEn2Z6LbKad3uk+AAccy MS8QHJghFe7cLR6HhQLKcdJqIIqrlnvCLCBP8SCng2TixS5M5NkPEWQZ4RPhhfikTZoc0R2XQzb Yz1L1Mh4RjLr5vrAnE9tEu6Q3fYbECuWXTE7ZJPk/SQlaeKNQ3aKPRZBR8f6DIa06Tw== X-Received: by 2002:ae9:c013:: with SMTP id u19-v6mr4619773qkk.57.1526983684697; Tue, 22 May 2018 03:08:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoUefMrHO0bRQZji4DIxNJZ0549PWDajQoS8NfPB8U6YMw3Y6FkTy9hiMxVq3OKuPuJh33N X-Received: by 2002:ae9:c013:: with SMTP id u19-v6mr4619750qkk.57.1526983684267; Tue, 22 May 2018 03:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526983684; cv=none; d=google.com; s=arc-20160816; b=Aj4FhKiUHONYo5r/MRD3hNUOtCdURTSb2VJeYDL1ubxu4IsHipJ2EdKyezteuwdwsD 1GjSGoATRM/SePvBZfMAyw5wl5oqpVXT4snZ+KJuHHq17lfgJZyVCYh6l/WO+FC9A8Kp yoKXphcz/FcX0Ju+uCBVb7Zwmx0K56XBgL5F6T4EPNOGyp0XSRoNWowDFxs8xYmxIJBT eIhS0FdrjcXKGDxTRQNYJ6/6qg8Zrpluzsj9iGsAfT6C9auJS354eU0BCoit3WN1XYf2 2fRU97SXOMcgY/fapz1KS//B5pbyYFc6aqD5qt6m9fTp2sQ4oVXcEzyziybSyfCMRbwg uCTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=OE2ZNcDMdUMy1P8TkYlLPgSwHBVfU0dOj0AcnkyEaqM=; b=tpuwd51naOnekAvDMadjqYQoGoPxhdV7JDKRxzt1ZIBojLK2pjM5v6W17AYmpCjkNw 4SD7lErdCW1juU4jfndIcP2LJ0E5pLFfqV6OGeHZzBJ5wdm/I+ExFfwyIG5vC9HbJcBZ 1Eae03//lWDfapYSeUH1gYZNtvJdSIutmchzyCFrSiy6rIHv22EqF0xWURZ/HjLOuSlC T2MKgpsXSFxxG5jLXKL0X7pvuOsJBoqFfi36xQsAUmUYlbuv0F3rta05mVpM0ZCtkiIL Du3cA7do2Phsd1zupgqFA1P2pYiOj9vRii5sDb2SdLNqhhkGuCwvY/a3nPAhU6F1Hr9V DbMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id r10-v6si4572707qvb.223.2018.05.22.03.08.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 03:08:04 -0700 (PDT) Received-SPF: pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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:'' X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Andrey Ryabinin --- 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