Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1409916pxk; Mon, 31 Aug 2020 19:41:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvBlTlV8cAPR1qoAW2go9OBqa3d4/4tHmwFyre8I267Linsdx4Sdru8bXkQwTzkPnAhV7N X-Received: by 2002:a17:906:480a:: with SMTP id w10mr1914631ejq.372.1598928102286; Mon, 31 Aug 2020 19:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598928102; cv=none; d=google.com; s=arc-20160816; b=ow6slJVlXcMTT7S96vC8f26mu25q5Z2qihhpdemagLFe4XU+4l++nEO2hrEOgJsobg VaExmwhG7m+pUyww1JOM9hGJykk4aiBoqXsHNf2uRUv6ttYN2b0B/lAosMgRkZeJLDHV RBqn50thVVexZDksLY5KwJwTf8HkgnnQ0Nppk/2Ocof65Dcgvj74oRKF6omTF4Z8fkdm wao7B7DW0HZKd4nBPTZ1fkuKv/0XNb/OKTbMK/aBmVg0dBlbQYx82zYebnJoIwxHu72h 7oS1Wg+ZxDd/pw0cGCK5PTnCZetqtQmX5L0l26eqqF/YGRnIqb+ppjGzFLPcW3iVBAWv UZtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=8lX4poE02ajQJGxjNbAWozayzDOLmpEFUCaK0JJrN7w=; b=ot6ld/EV9ltmZ1+8VtLFnj/rOmMGyvDsrkN1uk4ToUTsNEixcY1A3a90epKUZsRvN9 FcnhjSWZtmKkgZlYjHuVr/hFPcPIbylxxI0AUWaL/KnIjKYPeBw4OJLm9gkluf3sn/5W d4ecYZ35BHKQdqTQJDGlBjQ/Nhp89KQMuS2NktsA8SSdgwglV61CS2l+NuinmIdC3Gsk AKQNr9D9qox7CPFRaEIEnR+rLELq77PHJVbWGJ3uRjI72hD1uC7sbl0JciRL2IDjpxVB wQzQLovzu3j65T3jdR3uhcTqtZSNcaPqBaPkZN2VIjEKYwdwKfjDdDRK14Recnazyiuh Mnxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L7IuRCf+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si477240ejm.344.2020.08.31.19.41.19; Mon, 31 Aug 2020 19:41:42 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L7IuRCf+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726173AbgIACks (ORCPT + 99 others); Mon, 31 Aug 2020 22:40:48 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:43908 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726020AbgIACks (ORCPT ); Mon, 31 Aug 2020 22:40:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598928046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8lX4poE02ajQJGxjNbAWozayzDOLmpEFUCaK0JJrN7w=; b=L7IuRCf+MPAFLRBEtERKEt/sSMBXRHMpa9L5fFPLsmF62cX4igVBk60rVzyA2n/EVeQNJ3 fnc04YIav2+KqkWmhqJaFwtzuk/b2uc13LEVCRcu4TjUQkI1lrwB3XYl6FGoph+Quk12q5 SEjpo5mIhbOZacPbKGJ35/Bqlc/RgwQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-297-RQlift-JMi2mLXeNomZVug-1; Mon, 31 Aug 2020 22:40:44 -0400 X-MC-Unique: RQlift-JMi2mLXeNomZVug-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E7A21007B01; Tue, 1 Sep 2020 02:40:43 +0000 (UTC) Received: from [10.72.13.164] (ovpn-13-164.pek2.redhat.com [10.72.13.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF580747B0; Tue, 1 Sep 2020 02:40:31 +0000 (UTC) Subject: =?UTF-8?B?UmU6IOetlOWkjTog562U5aSNOiBbUEFUQ0ggVjJdIHZmaW8gZG1hX21h?= =?UTF-8?Q?p/unmap=3a_optimized_for_hugetlbfs_pages?= To: Peter Xu , "Maoming (maoming, Cloud Infrastructure Service Product Dept.)" Cc: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "alex.williamson@redhat.com" , "cohuck@redhat.com" , "Zhoujian (jay)" , "Huangweidong (C)" , "aarcange@redhat.com" , wangyunjian References: <20200814023729.2270-1-maoming.maoming@huawei.com> <20200825205907.GB8235@xz-x1> <8B561EC9A4D13649A62CF60D3A8E8CB28C2D9ABB@dggeml524-mbx.china.huawei.com> <20200826151509.GD8235@xz-x1> <8B561EC9A4D13649A62CF60D3A8E8CB28C2DBE7A@dggeml524-mbx.china.huawei.com> <20200828142400.GA3197@xz-x1> From: Jason Wang Message-ID: Date: Tue, 1 Sep 2020 10:40:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200828142400.GA3197@xz-x1> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/8/28 下午10:24, Peter Xu wrote: > On Fri, Aug 28, 2020 at 09:23:08AM +0000, Maoming (maoming, Cloud Infrastructure Service Product Dept.) wrote: >> In hugetlb_put_pfn(), I delete unpin_user_pages_dirty_lock() and use some simple code to put hugetlb pages. >> Is this right? > I think we should still use the APIs because of the the same reason. However > again I don't know the performance impact of that to your patch, but I still > think that could be done inside gup itself when needed (e.g., a special path > for hugetlbfs for [un]pinning continuous pages; though if that's the case that > could be something to be discussed on -mm then as a separate patch, imho). > > Thanks, +1, we should make this as a generic optimization instead of VFIO specific consider there're a lot of GUP users. Thanks