Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1402573ybh; Sun, 19 Jul 2020 19:02:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtCdLOMqNH2MCBjds7i1JWLN/Id+Tv7NtOsQNXt1Bq7x4wC6Depy0AWi++wFZWOiA8xNaG X-Received: by 2002:aa7:c407:: with SMTP id j7mr19278421edq.96.1595210579090; Sun, 19 Jul 2020 19:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595210579; cv=none; d=google.com; s=arc-20160816; b=PtBHQB8QrZbvxY4XG6qnTyMMzJlbL3yHdD+xwJNe5jmJGkypsDwIVrS83jKvoVGHZ0 RsgT299WIcuj2/l9aIiLYPzwH0D/SmnAzNpOsqROMqOrzT3k84kXEh8B3XiW9pB5xUZF CNeoYJpOsZjycaMDFaLyPZzkNYOmbL7sa9/NGg1HtUQC9NExLC6H35gwfmNDBuVZmLPl ElOx5K17tuEqX9RuzMlGJ34lCaQiaap0YvgIMr9aQ7QY6NjgSFFUHiwK9K8TqB4bNvjM f6IDWYEeTag+idEszsNThhpvR8ngVxEo3M18BSubZKcbJsqX/ygwdj2wOjK4VornC81z uPlQ== 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=5mB6lv0ZmdcXGsS6EKUX6jTC6DwenA6L54AOyDMa+JU=; b=JowvG1BvSqtDl2N31fFR0BPt8Wvuf5YnL61lj2XRHra42IJv5DzK/W/qRbK7PBTqMo w5VOQI/ZswNSHZrQ3S7xUmS7G5Oen48WAi4YIWoYWDNUzIGiIv6wNVRI2ofKhdL2rmIc SvfRTCrZNahwvxVzc+RwxkphOPxCbv9Rg/zcPXatbE7Q5Gw8kKcnAyahCd132gRZtQE1 YC5qLLiVSmsX9YuP8dLraWH0ExTeHjF3pSoAG3wRmzpeTl3Y2OFGlg93lQw/4aLdBf0+ LfnAdP9imsGrbObMztdodRR6a4imICLsNq9ZSoPg98L3c1/fX6RYQy1rTKvzmTDnDV/l UFuQ== 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 j18si10612009edp.389.2020.07.19.19.02.36; Sun, 19 Jul 2020 19:02:59 -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 S1726846AbgGTCCT (ORCPT + 99 others); Sun, 19 Jul 2020 22:02:19 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:50906 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726225AbgGTCCS (ORCPT ); Sun, 19 Jul 2020 22:02:18 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 543F63716F98CB272491; Mon, 20 Jul 2020 10:02:16 +0800 (CST) Received: from [10.174.178.86] (10.174.178.86) by smtp.huawei.com (10.3.19.207) with Microsoft SMTP Server (TLS) id 14.3.487.0; Mon, 20 Jul 2020 10:02:13 +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: <0e43e743-7c78-fb86-6c36-f42e6184d32c@huawei.com> Date: Mon, 20 Jul 2020 10:02:13 +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 int vmap_pages_range_noflush(unsigned long start, unsigned long end, > + pgprot_t prot, struct page **pages, > + unsigned int page_shift) > +{ > + if (page_shift == PAGE_SIZE) { Is this a typo of PAGE_SHIFT? > + return vmap_small_pages_range_noflush(start, end, prot, pages); > + } else { > + unsigned long addr = start; > + unsigned int i, nr = (end - start) >> page_shift; > + > + for (i = 0; i < nr; i++) { > + int err; > + > + err = vmap_range_noflush(addr, > + addr + (1UL << page_shift), > + __pa(page_address(pages[i])), prot, > + page_shift); > + if (err) > + return err; > + > + addr += 1UL << page_shift; > + } > + > + return 0; > + } > +} > +