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.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,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 2BB74C4338F for ; Wed, 28 Jul 2021 01:13:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 867BA60FBF for ; Wed, 28 Jul 2021 01:13:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 867BA60FBF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id A751D6B0036; Tue, 27 Jul 2021 21:13:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D4576B005D; Tue, 27 Jul 2021 21:13:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89BC68D0001; Tue, 27 Jul 2021 21:13:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0071.hostedemail.com [216.40.44.71]) by kanga.kvack.org (Postfix) with ESMTP id 6B9546B0036 for ; Tue, 27 Jul 2021 21:13:50 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1C71E1802E8D3 for ; Wed, 28 Jul 2021 01:13:50 +0000 (UTC) X-FDA: 78410224620.16.F838FBA Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf21.hostedemail.com (Postfix) with ESMTP id 40B66D01B0E8 for ; Wed, 28 Jul 2021 01:13:49 +0000 (UTC) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4GZFrj5Mf4z1CPZd; Wed, 28 Jul 2021 09:07:49 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 28 Jul 2021 09:13:45 +0800 Received: from [10.174.179.191] (10.174.179.191) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 28 Jul 2021 09:13:44 +0800 Subject: Re: [PATCH] mm/vmalloc: add missing __GFP_HIGHMEM flag for vmalloc To: Matthew Wilcox CC: , , , , References: <20210726032333.3404164-1-chenwandun@huawei.com> From: Chen Wandun Message-ID: <0b6dc5ae-14ca-e5c1-e6be-771063e6ef34@huawei.com> Date: Wed, 28 Jul 2021 09:13:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed X-Originating-IP: [10.174.179.191] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=chenwandun@huawei.com; dmarc=pass (policy=none) header.from=huawei.com X-Rspamd-Server: rspam02 X-Stat-Signature: onreozhh5ixyty6j5nroayuioaeomt98 X-Rspamd-Queue-Id: 40B66D01B0E8 X-HE-Tag: 1627434829-181544 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: =E5=9C=A8 2021/7/28 1:30, Matthew Wilcox =E5=86=99=E9=81=93: > On Mon, Jul 26, 2021 at 12:05:44PM +0800, Chen Wandun wrote: >> =E5=9C=A8 2021/7/26 11:25, Matthew Wilcox =E5=86=99=E9=81=93: >>> On Mon, Jul 26, 2021 at 11:23:33AM +0800, Chen Wandun wrote: >>>> struct page array can also be allocated in highmem during vmalloc, >>>> that will ease the low memory stress in 32bit system. >>> Huh? Where does it get kmapped in order to access it? > (i misread your patch, apologies) > >> The struct page array contain numbers of pointer of struct page, it is= used to save >> >> pages that allocated for vmalloc mapping in vmap_pages_range, it does'= t need to kmap. >> >> >> The main idea of this patch is come from: >> >> https://lore.kernel.org/lkml/20170307141020.29107-1-mhocko@kernel.org/ > you've misunderstood that patch. think about it: > > static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask= , > pgprot_t prot, unsigned int page_shif= t, > int node) > { > const gfp_t nested_gfp =3D (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO; > (now nested_gfp has neither DMA nor DMA32 set) > > gfp_mask |=3D __GFP_NOWARN; > if (!(gfp_mask & (GFP_DMA | GFP_DMA32))) > gfp_mask |=3D __GFP_HIGHMEM; > (we set HIGHMEM if DMA and DMA32 are both not set) > > area->pages =3D __vmalloc_node(array_size, 1, nested_g= fp, node, > area->caller); > (we don't need to set HIGHMEM here because it will be set for us in > the second call to __vmalloc_area_node) Oh yes=EF=BC=8CI misunderstood about this. Thanks Wandun > .