Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1895101ybt; Thu, 2 Jul 2020 17:16:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZv/Z5Z6SGKnn33uQUNGuQ6Z9Mgs0V9StrqFCNARGgTPBzuEGuOJaQGdu3J7XTmqyjSpVK X-Received: by 2002:a17:906:5f98:: with SMTP id a24mr28883698eju.241.1593735386381; Thu, 02 Jul 2020 17:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593735386; cv=none; d=google.com; s=arc-20160816; b=WiLXk+ka84MKKHeIB5Sz8i6MUIOnZkjxCmPI2YNimr7lsjErhLfiKKMXdTUBQYbmlN AsmiNQPiM4DiSHnrGX2R6iDy4K2X46oKKLoJZhkAXwI5xqrV4umV3F0mJfYyYhjX0TVQ 1EGOBpHiZCP3RRYyppwqWFQcEa63danC+Qst60PRU+19o1WkaqfzpupJiOE2Xwc840x1 EJIbDaZuhBJQjxDl5RC7gEavaEHyBUwXUfhPchGXTgvJEDPmS1xhQ71w+SP1MPf9KZwn ZpeqzCi6FTVchip2odb4kR9CbmhHRKnahE5IylU+ymYaeyPFWoSkFnDGaUvhH/m4JvvE /gxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id :mime-version:in-reply-to:references:cc:to:subject:from:date :dkim-signature; bh=nuJRvdB0NXvVZz7pZcV4N1oDW2dnoBAuVAW0OAoXK2w=; b=Vtpwt98ch0ZsoggqWictp1vfkX0sUs9TaNjeR9Yrtg096uWywK/mno3/sHEF9mZcrd 2u2+QeNUT7N3LXJhyUnBnv3Zq30gJ2CLrAbqcT+oMPVh1D1YvnHZWxEB+LlI4mIkDELO VQ/Cy+PYV56fQrW2a8ajubnQp85t+NFCM7Oa/BNXwVd23DykTjK4XVicS0xcxc9qpL9x z9Sv5KBAZsae0tYXHz/T/tDUcJKhXbfNXHyXQsZstCOFnoyCJv7h1Z8PEqDUGDVxKGlB zOSAOzMQxugT4N8RWYreVkt4t9LowVPtwuAY2q8CsVYHCI+tldlcZCsBCpLOUYeqAMx3 yZWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LSEdiF8O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l22si6515969eji.104.2020.07.02.17.16.02; Thu, 02 Jul 2020 17:16:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LSEdiF8O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726098AbgGCAPm (ORCPT + 99 others); Thu, 2 Jul 2020 20:15:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725937AbgGCAPm (ORCPT ); Thu, 2 Jul 2020 20:15:42 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCE52C08C5C1; Thu, 2 Jul 2020 17:15:41 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id s14so11934616plq.6; Thu, 02 Jul 2020 17:15:41 -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=Hz5uPoOmI34jNibxFQgzG8dcvyTpPuwttGzgdY/dGS6GK8euGDlfSxLRaOd54uwZ7e wg1iiQ1X2096xLB0jcr6U3QIZMnPvBS8sNWAwADZWzEAu7D8NKhAnoUq62vCcS6uwXAu /WqcPecuG/yIXPQznZMzrrVoyJ5a0k8+GD8XSyIxviX+1bcoEwxfqJEDD3ENPhPrN3wS 80c7jzkC8CbweoPS71I664qGUHr7W0l4GNgVbip/eVDHWsTt23mSguKcinRIzVT0/4+7 WWapd1+dgB0ICBKKTBZpwu+F3gZWnFCqpzb7gX6mw3OSq8+WQFmkeKWYPfvBx1g8Mlkm sq1A== X-Gm-Message-State: AOAM532WY+cpTtymdk9IBnjP7f1YFDQiWTyXYeWI9wDg38bzd1wrpoJE GyZKyYga0cxBZwowUHIi4lGqmzE3 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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