Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp176135ybl; Tue, 7 Jan 2020 16:38:53 -0800 (PST) X-Google-Smtp-Source: APXvYqyDJ29gdC6ptpuqjaBFbuoJIAeSPFdmHQo9QHDHsuS/+vN18ZHN6DR7irWfFfGcatonoQTb X-Received: by 2002:a9d:7ac9:: with SMTP id m9mr2200937otn.80.1578443933174; Tue, 07 Jan 2020 16:38:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578443933; cv=none; d=google.com; s=arc-20160816; b=xPTq2gEY/C4elkYgbLnlvu2pE/M92vjwBlQJedzObUCA1eLgZJeytXjVcUT5na/3Gp DjiKCS/em1YYEyYfTT8mn4oyAxerpY5WjVo8TwEzsN7qHU2tdpWIItEnTBBKsizDpR32 HEghIbHP8306rTQFHxFBEm6OKTvIn7gnI/NsXt91bOtev+eBEtZTL12xCiY8FXW9yh6F qUd0XZ3L4aK2yWNPkrSWtvCbcjb/sO77PkEFnBpkp00GQNKx/4srgMJCFerfDx9w2BHU fRFAFVJPmu8Q/ho9Eav81Hoe9MGiafC/jwZkAl4JdsVA0Cvf0wwR/OFcMHurERyogQd0 y7gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=Eea6+qKFP2miR0h8T6ASbyy7O47WTnpw+0gsRt7KMjo=; b=t925oG2MpZrQ4QfT41nTvV7PnngSlk6gpD4n/yHWZ7fOzvGTjWRI02SDRcwKxC4Gmt IV7VIOf350Qq0REMYtdEFnbrMK+ycS9/2XAtrOA5GOAUnz3CeBFa06eHb6A+n5wTcaz8 LUFqogX76x8o1aKiChjEd465X3yE578m4w4k/xeVPXmJlKwuUx1yxLJrWVegfKY0atVu e7nlVtrEerxc87+kLfbCC1r1H1yqzPvK26VIT0htRjqbmJ3T8+Sa05U/Ehcyy5H3wLrc jbm5W++7zzlGTgGpW0k84uvrTYJY4hRpuZkNcXMScJ8lj/IxdluMSB5h77/p0aCIEXkz m8mQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si825898otn.202.2020.01.07.16.38.39; Tue, 07 Jan 2020 16:38:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726814AbgAHAg4 (ORCPT + 99 others); Tue, 7 Jan 2020 19:36:56 -0500 Received: from mga12.intel.com ([192.55.52.136]:39303 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbgAHAgz (ORCPT ); Tue, 7 Jan 2020 19:36:55 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2020 16:36:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,407,1571727600"; d="scan'208";a="215785978" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga008.jf.intel.com with ESMTP; 07 Jan 2020 16:36:53 -0800 Date: Wed, 8 Jan 2020 08:36:56 +0800 From: Wei Yang To: "Kirill A. Shutemov" Cc: Wei Yang , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kirill.shutemov@linux.intel.com, willy@infradead.org Subject: Re: [Patch v2] mm/rmap.c: split huge pmd when it really is Message-ID: <20200108003656.GB13943@richard> Reply-To: Wei Yang References: <20191223222856.7189-1-richardw.yang@linux.intel.com> <20200103071846.GA16057@richard> <20200103130554.GA20078@richard> <20200103132650.jlyd37k6fcvycmy7@box> <20200103140128.GA26268@richard> <20200107120333.ncvds3atyfiilxi3@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200107120333.ncvds3atyfiilxi3@box> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 07, 2020 at 03:03:33PM +0300, Kirill A. Shutemov wrote: >On Fri, Jan 03, 2020 at 10:01:28PM +0800, Wei Yang wrote: >> On Fri, Jan 03, 2020 at 04:26:50PM +0300, Kirill A. Shutemov wrote: >> >On Fri, Jan 03, 2020 at 09:05:54PM +0800, Wei Yang wrote: >> >> On Fri, Jan 03, 2020 at 03:18:46PM +0800, Wei Yang wrote: >> >> >On Tue, Dec 24, 2019 at 06:28:56AM +0800, Wei Yang wrote: >> >> >>When page is not NULL, function is called by try_to_unmap_one() with >> >> >>TTU_SPLIT_HUGE_PMD set. There are two cases to call try_to_unmap_one() >> >> >>with TTU_SPLIT_HUGE_PMD set: >> >> >> >> >> >> * unmap_page() >> >> >> * shrink_page_list() >> >> >> >> >> >>In both case, the page passed to try_to_unmap_one() is PageHead() of the >> >> >>THP. If this page's mapping address in process is not HPAGE_PMD_SIZE >> >> >>aligned, this means the THP is not mapped as PMD THP in this process. >> >> >>This could happen when we do mremap() a PMD size range to an un-aligned >> >> >>address. >> >> >> >> >> >>Currently, this case is handled by following check in __split_huge_pmd() >> >> >>luckily. >> >> >> >> >> >> page != pmd_page(*pmd) >> >> >> >> >> >>This patch checks the address to skip some work. >> >> > >> >> >I am sorry to forget address Kirill's comment in 1st version. >> >> > >> >> >The first one is the performance difference after this change for a PTE >> >> >mappged THP. >> >> > >> >> >Here is the result:(in cycle) >> >> > >> >> > Before Patched >> >> > >> >> > 963 195 >> >> > 988 40 >> >> > 895 78 >> >> > >> >> >Average 948 104 >> >> > >> >> >So the change reduced 90% time for function split_huge_pmd_address(). >> > >> >Right. >> > >> >But do we have a scenario, where the performance of >> >split_huge_pmd_address() matters? I mean, it it called as part of rmap >> >walk, attempt to split huge PMD where we don't have huge PMD should be >> >within noise. >> >> Sorry for my poor English. >> >> I don't catch the meaning of the last sentence. "within noise" here means >> non-huge PMD is an expected scenario and we could tolerate this? > >Basically, I doubt that this change would bring any measurable perfromance >benefits on a real workload. > Ok, let's leave it now. >-- > Kirill A. Shutemov -- Wei Yang Help you, Help me