Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7863417pxb; Fri, 19 Feb 2021 00:54:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5bpHvvHNcy7KFj4yaxILVdc8mSEU0GJ/boZ2QpCx3RXXY9fHW6x2W/XF+yTxtdHPN6wnA X-Received: by 2002:a17:906:4442:: with SMTP id i2mr7967330ejp.41.1613724884442; Fri, 19 Feb 2021 00:54:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613724884; cv=none; d=google.com; s=arc-20160816; b=iTyKI2k9Od5H5tQD0JLL8Thca/N6AY1VKUuy167zGDUARv44DHm52k1xSjDf6Nyb36 Rcb41LfPPd/fQL+IXurDmcOniP4UZ15hclBRLBcSus6K4mFAuhDV/FDc1/n9hL+4GOsU d3C7jSfmUwKJIGKft7cUiE9d2AvcHwiJDGYexgc06hbsJZjtoJJkrP+N70gOYe/pp3X+ d6JjyFZb0jIf7luCoJEy6mLTYoDdlLLn+9mL0Wa668iVMpmr/N2bTw4gPW/rwuTaiT/U 6MNky0r093p1Bs1V3DHjHw43YxSNibpWM9n87p0xkyfqwiAoTzh0dAwsLtxYyEUyaIlU vpag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=JQzzUJhJ2lepftcvvMZkPKdyLs/NSZyEHA6QNqBHcQY=; b=icTCcbGphjg45JZtbQklyh/TvPey7eKp1PSTY0ouTTovaLAut1kgy9W8r9Rv3noJ7V FiZqiQbvHiXbv+fQf/1otK1a3wWiQA8oLr8OgjpVy3wSzOWEgfXG241EpAodFcXoQ7C0 b3KdKpbqj8O2S7ojry4t7vYa/fjE/jdsmAj/OhCSldixEkf0l8n2ViOBM7buvtrr5QqR TOsH5DjNn+A1jyon6WcTzXKD/yCxzHmt1k/AxOzUJ/BKE+gTwZ4O43/S+RfmmbBP+632 zy381aHDGeA4hKlk+xT7nsRoxdE/gmb+QN/E4yWI/+4dkv7XSvo7Hn6u4Hx/MkTcBaWJ a6OQ== 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 eb8si7046564edb.6.2021.02.19.00.54.20; Fri, 19 Feb 2021 00:54:44 -0800 (PST) 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 S229953AbhBSIxE (ORCPT + 99 others); Fri, 19 Feb 2021 03:53:04 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:12192 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbhBSIw5 (ORCPT ); Fri, 19 Feb 2021 03:52:57 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Dhldj4s0gzlMgR; Fri, 19 Feb 2021 16:50:17 +0800 (CST) Received: from [10.174.177.80] (10.174.177.80) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Fri, 19 Feb 2021 16:52:05 +0800 Subject: Re: [PATCH v12 13/14] mm/vmalloc: Hugepage vmalloc mappings To: Nicholas Piggin , Andrew Morton , CC: Christophe Leroy , Christoph Hellwig , Jonathan Cameron , , , , Rick Edgecombe References: <20210202110515.3575274-1-npiggin@gmail.com> <20210202110515.3575274-14-npiggin@gmail.com> <1613720396.pnvmwaa8om.astroid@bobo.none> From: Ding Tianhong Message-ID: <913cd34a-453c-ae66-ff87-4b0c74c98eb6@huawei.com> Date: Fri, 19 Feb 2021 16:52:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <1613720396.pnvmwaa8om.astroid@bobo.none> Content-Type: text/plain; charset="utf-8" Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.80] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/19 15:45, Nicholas Piggin wrote: > Excerpts from Ding Tianhong's message of February 19, 2021 1:45 pm: >> Hi Nicholas: >> >> I met some problem for this patch, like this: >> >> kva = vmalloc(3*1024k); >> >> remap_vmalloc_range(xxx, kva, xxx) >> >> It failed because that the check for page_count(page) is null so return, it break the some logic for current modules. >> because the new huge page is not valid for composed page. > > Hey Ding, that's a good catch. How are you testing this stuff, do you > have a particular driver that does this? > yes, The driver would get a memory from the vmalloc in kernel space, and then the physical same memory will mmap to the user space. The drivers could not work when applying this patch. >> I think some guys really don't get used to the changes for the vmalloc that the small pages was transparency to the hugepage >> when the size is bigger than the PMD_SIZE. > > I think in this case vmalloc could allocate the large page as a compound > page which would solve this problem I think? (without having actually > tested it) > yes, i think the __GFP_COMP flag could fix this. >> can we think about give a new static huge page to fix it? just like use a a new vmalloc_huge_xxx function to disginguish the current function, >> the user could choose to use the transparent hugepage or static hugepage for vmalloc. > > Yeah that's a good question, there are a few things in the huge vmalloc > code that accounts things as small pages and you can't assume large or > small. If there is benefit from forcing large pages that could certainly > be added. > The vmalloc transparent is good, but not fit every user scenes, some guys like to use the deterministic function for performance critical area. Thanks Ding > Interestingly, remap_vmalloc_range in theory could map the pages as > large in userspace as well. That takes more work but if something > really needs that for performance, it could be done. > > Thanks, > Nick > . >