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=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 D74F5C433DF for ; Fri, 3 Jul 2020 00:15:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7A0B3207CD for ; Fri, 3 Jul 2020 00:15:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LSEdiF8O" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A0B3207CD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B32A66B00AA; Thu, 2 Jul 2020 20:15:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ABC866B00AB; Thu, 2 Jul 2020 20:15:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9AAD56B00AC; Thu, 2 Jul 2020 20:15:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0237.hostedemail.com [216.40.44.237]) by kanga.kvack.org (Postfix) with ESMTP id 8254D6B00AA for ; Thu, 2 Jul 2020 20:15:43 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 229AA52AD for ; Fri, 3 Jul 2020 00:15:43 +0000 (UTC) X-FDA: 76994846166.27.spy13_5002e7926e8d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id F027B3D663 for ; Fri, 3 Jul 2020 00:15:42 +0000 (UTC) X-HE-Tag: spy13_5002e7926e8d X-Filterd-Recvd-Size: 4886 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2020 00:15:42 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id b92so13202666pjc.4 for ; Thu, 02 Jul 2020 17:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=nuJRvdB0NXvVZz7pZcV4N1oDW2dnoBAuVAW0OAoXK2w=; b=LSEdiF8O8c0k36FJz+J/p1Xm+032fT22eON16GPFoOrZL6GDx9jPsHusIL7FEU0XAV lLDoHY9NSZfpcd5oNSgz7AXGqRLd1dfAW9ad86/buGeCa4uTE/vU9OPIKwfaZyBXfnsJ uG05dXYdVlfndLY83LDfB7lzK6ZqRQP5RvYyTLEoAscx9LtDbk1kTfrj/Cwbbvqz6uxW IUIYgXT0pd0DwhOqvL6wEv82lwldnFjq8WUAnvh0BthjGb+v++4h6R72lTgxl5Ir5SPV KaijBTzwUbf0D6ex6rU/rFRlvvyVHMSFetaS1LKZRTYt3D1mhdMNSiJCFStkUNFQKfnS w0+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=nuJRvdB0NXvVZz7pZcV4N1oDW2dnoBAuVAW0OAoXK2w=; b=TJ2Owrt4p9XRqbrN05V1SYnvcMFDHlUiMdSJ8/8Kss7md3bebCN7wxEJeNFyrqaE7n Ksb7PZ42Dhzd+SaPKOK28x07QatVtqnwY+rBytuNz2UXFjE21KOVvbVYCx3STeGCINpj e1JM1PbpNP3uks5RFvIqGBAUuxn5zV0OhdVI+sWRjbcjYZ2tA9su7gJWh7y0tH7iwbqh GACtYItEMiUhiqfqHLAv4KF0167Y8Flsa03Z6NgUONvJdxGTTu+ZG1KHMifmQ5IKqrsb IVihKfRdTZj1bcZXLCZh/KBdDXWMwCm7Z4wgfEIjHcm8LnPm6keG7+rRmzHbaeHQ06sZ p6fQ== X-Gm-Message-State: AOAM531nzfu0wr/AOwroUUZ83FOdjT6RgITJQwDq3jd1IkMed7tHgtWn tWK/grGZWd7YGmxGgshTpATNVI3C X-Google-Smtp-Source: ABdhPJzVARbnUoiUECgH/rt6gF7oxr/jO/Or3UFnEeEEE5zO8Q2uC+eAackVR4Z456AOo0TJ+H99Rw== X-Received: by 2002:a17:902:b78a:: with SMTP id e10mr28875186pls.34.1593735341316; Thu, 02 Jul 2020 17:15:41 -0700 (PDT) Received: from localhost (61-68-186-125.tpgi.com.au. [61.68.186.125]) by smtp.gmail.com with ESMTPSA id b11sm10202251pfr.179.2020.07.02.17.15.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 17:15:40 -0700 (PDT) Date: Fri, 03 Jul 2020 10:15:34 +1000 From: Nicholas Piggin Subject: Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings To: linux-mm@kvack.org, Zefan Li Cc: =?iso-8859-1?q?Borislav=0A?= Petkov , Catalin Marinas , "H. Peter Anvin" , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Ingo Molnar , =?iso-8859-1?q?Thomas=0A?= Gleixner , Will Deacon , x86@kernel.org References: <20200413125303.423864-1-npiggin@gmail.com> <20200413125303.423864-5-npiggin@gmail.com> In-Reply-To: MIME-Version: 1.0 Message-Id: <1593735251.svr5r5cxle.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: F027B3D663 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: Excerpts from Zefan Li's message of July 1, 2020 5:10 pm: >> static void *__vmalloc_node(unsigned long size, unsigned long align, >> - gfp_t gfp_mask, pgprot_t prot, >> - int node, const void *caller); >> + gfp_t gfp_mask, pgprot_t prot, unsigned long vm_flags, >> + int node, const void *caller); >> static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask= , >> - pgprot_t prot, int node) >> + pgprot_t prot, unsigned int page_shift, >> + int node) >> { >> struct page **pages; >> + unsigned long addr =3D (unsigned long)area->addr; >> + unsigned long size =3D get_vm_area_size(area); >> + unsigned int page_order =3D page_shift - PAGE_SHIFT; >> unsigned int nr_pages, array_size, i; >> const gfp_t nested_gfp =3D (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO; >> const gfp_t alloc_mask =3D gfp_mask | __GFP_NOWARN; >> const gfp_t highmem_mask =3D (gfp_mask & (GFP_DMA | GFP_DMA32)) ? >> - 0 : >> - __GFP_HIGHMEM; >> + 0 : __GFP_HIGHMEM; >> =20 >> - nr_pages =3D get_vm_area_size(area) >> PAGE_SHIFT; >> + nr_pages =3D size >> page_shift; >=20 > while try out this patchset, we encountered a BUG_ON in account_kernel_st= ack() > in kernel/fork.c. >=20 > BUG_ON(vm->nr_pages !=3D THREAD_SIZE / PAGE_SIZE); >=20 > which obviously should be updated accordingly. Thanks for finding that. We may have to change this around a bit so=20 nr_pages still appears to be in PAGE_SIZE units for anybody looking. Thanks, Nick