Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp374001ybt; Wed, 1 Jul 2020 00:11:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa++mauKEP0nkvpfRJ6wXTcTIS9taSS+SrCFhpxYmr3KIyYfyyr6P1ZFvfZnEngyo9aTuj X-Received: by 2002:a17:906:eb5a:: with SMTP id mc26mr17196106ejb.42.1593587483589; Wed, 01 Jul 2020 00:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593587483; cv=none; d=google.com; s=arc-20160816; b=ymjP1HqgkiRiDW1ge4ytD9lvLjYWZ2kC5kNG79PfGtpz7ffW8JK5ecs8x8zBmbdXUk bPsUcLeXRXKjcw34UGfNUmwakYDIofMQz8K7DKAcADiIMz2tWyhmLxPSFtgohkG7M4Wi QyXnGUMUeO1TOinHdzFzVxCEjfdXuc6/8v/Pjx9OfGMRN2r/U9gGdTYTMgs45r219KVB cFcZgfQavE/DhbuUBmMKpQ2DX9WOaYmH9EFMS4T3ZsF5a1UVHDSyc1ix51qLDCLzgRe7 H6RWA+tz2diE/sJf2lWsjsbQPH3r1FqeSPOweolr+4K/3DYTGWb6bpqvh1nScH+hNQu+ jsLw== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=yOofYoprxJZaBvAYWTjKglQius2mcH6CkomvjYzY5BI=; b=ChAnvLuqYANQ/Bstjhi0mdup11tt3iW1qnvc0gnBxWApnoM8FD0zZZQ9uNaq+A8Xyy bvySSgU96pN3ayU6NwGMbm9gs9CpiJj9Igkfym8dQG9pzQG+DjGvpKTIcFv8nVh68opZ yfmISDoC58D4fnx0P9w7h0lYDfoM2DgNTsum4V5C34+QvM3FOcuBuZlCKCtKxpvy67lJ rH/A4zuJ0tMNox9AYKPqq0pIvU5Q9MWwJu7XgdXG+GlyLrDuhurrhJfoVKbaOvWTJn9w MRaThsnWqSLg8GRG/sYcXqgUVTXXuj/rtGNIAAYlQWAyjdhvrSIvesh8mHHuxFvXj+Sk tGnQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp8si4539600ejc.281.2020.07.01.00.10.58; Wed, 01 Jul 2020 00:11:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728055AbgGAHKm (ORCPT + 99 others); Wed, 1 Jul 2020 03:10:42 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:41056 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727847AbgGAHKm (ORCPT ); Wed, 1 Jul 2020 03:10:42 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B0C0A65D660C38B54DB0; Wed, 1 Jul 2020 15:10:40 +0800 (CST) Received: from [10.174.178.86] (10.174.178.86) by smtp.huawei.com (10.3.19.213) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 1 Jul 2020 15:10:36 +0800 Subject: Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings To: Nicholas Piggin , CC: , , , Catalin Marinas , Will Deacon , , "Thomas Gleixner" , Ingo Molnar , "Borislav Petkov" , , "H. Peter Anvin" References: <20200413125303.423864-1-npiggin@gmail.com> <20200413125303.423864-5-npiggin@gmail.com> From: Zefan Li Message-ID: Date: Wed, 1 Jul 2020 15:10:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200413125303.423864-5-npiggin@gmail.com> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.86] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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 = (unsigned long)area->addr; > + unsigned long size = get_vm_area_size(area); > + unsigned int page_order = page_shift - PAGE_SHIFT; > unsigned int nr_pages, array_size, i; > const gfp_t nested_gfp = (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO; > const gfp_t alloc_mask = gfp_mask | __GFP_NOWARN; > const gfp_t highmem_mask = (gfp_mask & (GFP_DMA | GFP_DMA32)) ? > - 0 : > - __GFP_HIGHMEM; > + 0 : __GFP_HIGHMEM; > > - nr_pages = get_vm_area_size(area) >> PAGE_SHIFT; > + nr_pages = size >> page_shift; while try out this patchset, we encountered a BUG_ON in account_kernel_stack() in kernel/fork.c. BUG_ON(vm->nr_pages != THREAD_SIZE / PAGE_SIZE); which obviously should be updated accordingly. > array_size = (nr_pages * sizeof(struct page *)); > > /* Please note that the recursion is strictly bounded. */ > if (array_size > PAGE_SIZE) { > pages = __vmalloc_node(array_size, 1, nested_gfp|highmem_mask, > - PAGE_KERNEL, node, area->caller); > + PAGE_KERNEL, 0, node, area->caller); > } else { > pages = kmalloc_node(array_size, nested_gfp, node); > }