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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 211FFC432BE for ; Tue, 27 Jul 2021 17:31:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 839A36101D for ; Tue, 27 Jul 2021 17:31:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 839A36101D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 020C86B005D; Tue, 27 Jul 2021 13:31:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F17196B006C; Tue, 27 Jul 2021 13:31:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFF956B0070; Tue, 27 Jul 2021 13:31:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id C24DE6B005D for ; Tue, 27 Jul 2021 13:31:03 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6E856181C9D39 for ; Tue, 27 Jul 2021 17:31:03 +0000 (UTC) X-FDA: 78409058406.03.EE8007A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf28.hostedemail.com (Postfix) with ESMTP id F1AC69002971 for ; Tue, 27 Jul 2021 17:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=/5u/kL2/B/88RazFOk7B7gT7fQ27YXJaLficWp9tFRI=; b=Hjg1TmZsbkN99YT4XrirMDJZie rtGlKFshaHEmcn4QefRePBIAVjUnHmU5WBGSUDqvwKQD2kBtLwkyS2UIPh8LjOv28Z3iC1V+FWf/m c6NbPv/sBQ11DWVv98i/ZySUrDvupkI2btcB3x60SaNT5q3CfSGaoVgY8pNqeZXotnAZrMzYuR8tc 1jrmV4GZ3hyqDl4J5071b/Z1qFv3MT/TepEuuWsWytdq73QlqnpHXm/Kv70MXNQkBfYzb5ys/QC/H LK8X+ndEWMXMQFP77qhJKok1s94ZFuVQg6icJyd0u/M65RZFqUgzsDnHz70OwGEfAFyoaKQIhEt5x ztkQ/uWQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8QuS-00FF5H-Ri; Tue, 27 Jul 2021 17:30:36 +0000 Date: Tue, 27 Jul 2021 18:30:28 +0100 From: Matthew Wilcox To: Chen Wandun Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, wangkefeng.wang@huawei.com, weiyongjun1@huawei.com Subject: Re: [PATCH] mm/vmalloc: add missing __GFP_HIGHMEM flag for vmalloc Message-ID: References: <20210726032333.3404164-1-chenwandun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: F1AC69002971 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Hjg1TmZs; dmarc=none; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: 55yo7qdiwxwbi9umwj9pqzqwcbydrc79 X-HE-Tag: 1627407062-810017 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 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 >=20 > pages that allocated for vmalloc mapping in vmap_pages_range, it does't= need to kmap. >=20 >=20 > The main idea of this patch is come from: >=20 > 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_shift, 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_gfp,= 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)