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.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 A5497C636C8 for ; Tue, 20 Jul 2021 23:29:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 595E0600D4 for ; Tue, 20 Jul 2021 23:29:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 595E0600D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 119A26B0011; Tue, 20 Jul 2021 19:29:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0CA616B0036; Tue, 20 Jul 2021 19:29:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E84856B006C; Tue, 20 Jul 2021 19:29:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id BB69E6B0011 for ; Tue, 20 Jul 2021 19:29:35 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4C0A220BF4 for ; Tue, 20 Jul 2021 23:29:34 +0000 (UTC) X-FDA: 78384560268.19.E5407F2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf25.hostedemail.com (Postfix) with ESMTP id DC153B0001BC for ; Tue, 20 Jul 2021 23:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626823773; h=from:from:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uTqg20WbE9gq4F17Yo+qpQ8PdWyA4fi/jLu09X5Zs0U=; b=DLoOeKleWnAtgKw44F2hXA72zg85S4XhPrODUtVQLcUABiVwdikQ/NOn2/F9Vn36l6Hwku mN1q5KNWCQ3JHE5A9UFRgKmMAbDI9llUMbS1MlPvU/j/FiGVROX/d82tJa00CvcFQKRGrr HkYR0qVe0hwlO206lho23XeVVz6xyZU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-HjSFoRXSMlqFdx9I2L3GFQ-1; Tue, 20 Jul 2021 19:29:31 -0400 X-MC-Unique: HjSFoRXSMlqFdx9I2L3GFQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6273C362F8; Tue, 20 Jul 2021 23:29:30 +0000 (UTC) Received: from [10.64.54.195] (vpn2-54-195.bne.redhat.com [10.64.54.195]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5551B19C59; Tue, 20 Jul 2021 23:29:27 +0000 (UTC) Reply-To: Gavin Shan Subject: Re: [PATCH v2 01/12] mm/debug_vm_pgtable: Introduce struct pgtable_debug_args To: Anshuman Khandual , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, akpm@linux-foundation.org, chuhu@redhat.com, shan.gavin@gmail.com References: <20210719054138.198373-1-gshan@redhat.com> <20210719054138.198373-2-gshan@redhat.com> <8d754894-5c21-1287-82b6-7ac3b064af3d@redhat.com> From: Gavin Shan Message-ID: <1d8c1b0f-3102-5a4a-f3fb-a0fc50d281cc@redhat.com> Date: Wed, 21 Jul 2021 09:29:43 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DLoOeKle; spf=none (imf25.hostedemail.com: domain of gshan@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=gshan@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: rn674ymjyiyz8k8zwor93hpuoyaepsg7 X-Rspamd-Queue-Id: DC153B0001BC X-Rspamd-Server: rspam01 X-HE-Tag: 1626823773-12208 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 7/20/21 4:42 PM, Anshuman Khandual wrote: > On 7/19/21 6:31 PM, Gavin Shan wrote: >>> +=C2=A0=C2=A0=C2=A0 if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 has_transparent_hugepage(= )) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 page =3D alloc_pages(GFP_= KERNEL, HPAGE_PMD_ORDER); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (page) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 a= rgs->pmd_pfn =3D page_to_pfn(page); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 a= rgs->pte_pfn =3D args->pmd_pfn; >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 r= eturn 0; >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> +=C2=A0=C2=A0=C2=A0 } >>> + >> >> As syzbot reported against v1 series, we could allocate pages larger t= han (1 << (MAX_ORDER - 1)) here. >> So __GFP_NOWARN is needed here. I will fix it in v3 series. >=20 > I could find the following build error reported from lkp on V2. >=20 > mm/debug_vm_pgtable.c:445:8: warning: variable 'pud' set but not used [= -Wunused-but-set-variable] >=20 Yes, The following line is missed in PATCH[v2 09/12] and fixed in PATCH[v3 09/12]: WARN_ON(!pud_none(pud)). With this line added, the variable @pud is used in v3. > Could you please point to the syzbot reported problem on V1 as you > have mentioned above. Are there configs where HPAGE_[PMD|PUD]_ORDER > is greater than (MAX_ORDER - 1) ? If yes, how adding __GFP_NOWARN > solves the problem ? >=20 https://syzkaller.appspot.com/bug?extid=3D8730ec44a441a434a2c8 https://syzkaller.appspot.com/x/.config?x=3D29a82c885e192046 The kernel config has the following options: CONFIG_X86_64=3Dy CONFIG_TRANSPARENT_HUGEPAGE=3Dy CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=3Dy #define PUD_SHIFT 30 #define PMD_SHIFT 21 CONFIG_FORCE_MAX_ZONEORDER=3Dn #define MAX_ORDER 11 (HPAGE_PUD_SHIFT - PAGE_SHIFT) >=3D (1 << MAX_ORDER) (HPAGE_PMD_ORDER) < (1 << MAX_ORDER) The warning is triggered in the following path, __GFP_NOWARN helps to avoid the WARNING_ON_ONCE(), but NULL is returned as expected. alloc_pages __alloc_pages if (unlikely(order >=3D MAX_ORDER)) { WARN_ON_ONCE(!(gfp & __GFP_NOWARN)); return NULL; } Thanks, Gavin