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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham 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 4212FECE58F for ; Tue, 15 Oct 2019 18:42:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EF3DE21835 for ; Tue, 15 Oct 2019 18:42:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="ih4zeCbn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF3DE21835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 97EE28E0005; Tue, 15 Oct 2019 14:42:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 92F4A8E0001; Tue, 15 Oct 2019 14:42:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F5FE8E0005; Tue, 15 Oct 2019 14:42:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id 548248E0001 for ; Tue, 15 Oct 2019 14:42:06 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id E008982E4547 for ; Tue, 15 Oct 2019 18:42:05 +0000 (UTC) X-FDA: 76046888610.16.vase85_86a62e6fd103f X-HE-Tag: vase85_86a62e6fd103f X-Filterd-Recvd-Size: 7431 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Oct 2019 18:42:05 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id u40so32017218qth.11 for ; Tue, 15 Oct 2019 11:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=YXiUOqo8ETclVClbFsr4YOWOeJ7XlxA5Qh2JOUOHtn0=; b=ih4zeCbnEW9LSQmgDID0erLrP4wKSRd4quPFdjB7jDfMBRahOCBa+C67Dy1NqHkrCv VJSNTqSrY43O2EJhupvXVshQ0BC82dIhxESVHTwLHkCEPN42OBS3yBTYdKusIr1FPyqX wpUPZ/cGTRy5YK2T6ObGKxHp1+6vi2CjoWlyTCo/dPXrhBn0tNseTwJyJuKrduDqfttY fd4SW/I4j0BpnaIdz6zO9hqQf6+agjiuheLCXQaQrYEDCeHJq0DF3gEtcT6Uvp1RF+B9 gDgx+ctEQBhsj7GuizlLnNWuM5pbIfjPRVvTdcRA7Ese4V0mQHl7lb1qg7KFEBXx5acS G4wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=YXiUOqo8ETclVClbFsr4YOWOeJ7XlxA5Qh2JOUOHtn0=; b=DtvG25YhqcMzNWggQ/njQ+WMK1SZSsbvwGxCVfXrIu6KlZpw7PnJ+LvqcY/DVu3anK v5eKhVK9gSRK3Y6mpH+/kNXcKv2UgYLxViPXMHa6n4VJd5q5TGsi13AJrsqB6XwSt5tb n5umb4NDmBP5bAinVPnUZBHX9HAC1ddjyf24/INEhUSjFxQbE8HfQyCRu007T4t0usTC WfxUQQfRuWNzcyloPOaypGdFAt8xN0/dpIA36v87Y7A94dJdEvxtZiGcGSW1bSGjlk0f SmTx6EKU0pSusWyQ5wdJGt4H9GsciUH8eZtyn4Ds/sa630Q/r7qffQpm3fNuizhDF54K QJFg== X-Gm-Message-State: APjAAAWha0dHZwxqk7Mn7OFDWIgItgdobo1LTpxgVSWUEfkYGrjsvOJH SmnIOHWttRu/NVyigEUtx4WBxA== X-Google-Smtp-Source: APXvYqwar5I/V60pS57/UcDUw1cogFuq6+7hHVlNRpscniqz5EATufxt8kONpUilAAyTNCHiUcXZ9w== X-Received: by 2002:ac8:1c49:: with SMTP id j9mr41218038qtk.364.1571164924491; Tue, 15 Oct 2019 11:42:04 -0700 (PDT) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id o28sm9204198qkk.106.2019.10.15.11.42.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Oct 2019 11:42:03 -0700 (PDT) Message-ID: <1571164920.5937.45.camel@lca.pw> Subject: Re: [PATCH V6 0/2] mm/debug: Add tests validating architecture page table helpers From: Qian Cai To: Anshuman Khandual , linux-mm@kvack.org Cc: Andrew Morton , Vlastimil Babka , Greg Kroah-Hartman , Thomas Gleixner , Mike Rapoport , Jason Gunthorpe , Dan Williams , Peter Zijlstra , Michal Hocko , Mark Rutland , Mark Brown , Steven Price , Ard Biesheuvel , Masahiro Yamada , Kees Cook , Tetsuo Handa , Matthew Wilcox , Sri Krishna chowdary , Dave Hansen , Russell King - ARM Linux , Michael Ellerman , Paul Mackerras , Martin Schwidefsky , Heiko Carstens , "David S. Miller" , Vineet Gupta , James Hogan , Paul Burton , Ralf Baechle , "Kirill A . Shutemov" , Gerald Schaefer , Christophe Leroy , Mike Kravetz , linux-snps-arc@lists.infradead.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Date: Tue, 15 Oct 2019 14:42:00 -0400 In-Reply-To: References: <1571131302-32290-1-git-send-email-anshuman.khandual@arm.com> <1571150502.5937.39.camel@lca.pw> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: On Tue, 2019-10-15 at 20:51 +0530, Anshuman Khandual wrote: >=20 > On 10/15/2019 08:11 PM, Qian Cai wrote: > > The x86 will crash with linux-next during boot due to this series (v5= ) with the > > config below plus CONFIG_DEBUG_VM_PGTABLE=3Dy. I am not sure if v6 wo= uld address > > it. > >=20 > > https://raw.githubusercontent.com/cailca/linux-mm/master/x86.config > >=20 > > [=C2=A0=C2=A0=C2=A033.862600][=C2=A0=C2=A0=C2=A0=C2=A0T1] page:ffffea= 0009000000 is uninitialized and poisoned > > [=C2=A0=C2=A0=C2=A033.862608][=C2=A0=C2=A0=C2=A0=C2=A0T1] raw: ffffff= ffffffffff ffffffffffffffff ffffffffffffffff > > ffffff871140][=C2=A0=C2=A0=C2=A0=C2=A0T1]=C2=A0=C2=A0? _raw_spin_unlo= ck_irq+0x27/0x40 > > [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1]=C2=A0=C2=A0= ? rest_init+0x307/0x307 > > [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1]=C2=A0=C2=A0= kernel_init+0x11/0x139 > > [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1]=C2=A0=C2=A0= ? rest_init+0x307/0x307 > > [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1]=C2=A0=C2=A0= ret_from_fork+0x27/0x50 > > [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1] Modules lin= ked in: > > [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1] ---[ end tr= ace e99d392b0f7befbd ]--- > > [=C2=A0=C2=A0=C2=A033.871140][=C2=A0=C2=A0=C2=A0=C2=A0T1] RIP: 0010:a= lloc_gigantic_page_order+0x3fe/0x490 >=20 > Hmm, with defconfig (DEBUG_VM=3Dy and DEBUG_VM_PGTABLE=3Dy) it does not= crash but > with the config above, it does. Just wondering if it is possible that t= hese > pages might not been initialized yet because DEFERRED_STRUCT_PAGE_INIT=3D= y ? Yes, this patch works fine. diff --git a/init/main.c b/init/main.c index 676d8020dd29..591be8f9e8e0 100644 --- a/init/main.c +++ b/init/main.c @@ -1177,7 +1177,6 @@ static noinline void __init kernel_init_freeable(vo= id) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0workqueue_init(); =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0init_mm_internals(); -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0debug_vm_pgtable(); =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_pre_smp_initcalls(); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0lockup_detector_init(); @@ -1186,6 +1185,8 @@ static noinline void __init kernel_init_freeable(vo= id) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0sched_init_smp(); =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0page_alloc_init_late(); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0debug_vm_pgtable(); + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* Initialize page ext af= ter all struct pages are initialized. */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0page_ext_init(); >=20 > [ 13.898549][ T1] page:ffffea0005000000 is uninitialized and poiso= ned > [ 13.898549][ T1] raw: ffffffffffffffff ffffffffffffffff fffffffff= fffffff ffffffffffffffff > [ 13.898549][ T1] raw: ffffffffffffffff ffffffffffffffff fffffffff= fffffff ffffffffffffffff > [ 13.898549][ T1] page dumped because: VM_BUG_ON_PAGE(PagePoisoned= (p)) > [ 13.898549][ T1] ------------[ cut here ]------------ > [ 13.898549][ T1] kernel BUG at ./include/linux/mm.h:1107! > [ 13.898549][ T1] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KA= SAN PTI > [ 13.898549][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-= rc3-next-20191015+ #