Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964808AbcKXKKc (ORCPT ); Thu, 24 Nov 2016 05:10:32 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40588 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936562AbcKXKKa (ORCPT ); Thu, 24 Nov 2016 05:10:30 -0500 Subject: Re: [PATCH 5/5] mm: migrate: Add vm.accel_page_copy in sysfs to control whether to use multi-threaded to accelerate page copy. To: Zi Yan , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20161122162530.2370-1-zi.yan@sent.com> <20161122162530.2370-6-zi.yan@sent.com> Cc: akpm@linux-foundation.org, minchan@kernel.org, vbabka@suse.cz, mgorman@techsingularity.net, kirill.shutemov@linux.intel.com, n-horiguchi@ah.jp.nec.com, Zi Yan , Zi Yan From: Anshuman Khandual Date: Thu, 24 Nov 2016 15:39:12 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20161122162530.2370-6-zi.yan@sent.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16112410-0044-0000-0000-0000020874BD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16112410-0045-0000-0000-0000060CB096 Message-Id: <5836BC48.1080705@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-24_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611240179 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2101 Lines: 74 On 11/22/2016 09:55 PM, Zi Yan wrote: > From: Zi Yan > > From: Zi Yan > > Since base page migration did not gain any speedup from > multi-threaded methods, we only accelerate the huge page case. > > Signed-off-by: Zi Yan > Signed-off-by: Zi Yan > --- > kernel/sysctl.c | 11 +++++++++++ > mm/migrate.c | 6 ++++++ > 2 files changed, 17 insertions(+) > > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index d54ce12..6c79444 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -98,6 +98,8 @@ > #if defined(CONFIG_SYSCTL) > > > +extern int accel_page_copy; Hmm, accel_mthread_copy because this is achieved by a multi threaded copy mechanism. > + > /* External variables not in a header file. */ > extern int suid_dumpable; > #ifdef CONFIG_COREDUMP > @@ -1361,6 +1363,15 @@ static struct ctl_table vm_table[] = { > .proc_handler = &hugetlb_mempolicy_sysctl_handler, > }, > #endif > + { > + .procname = "accel_page_copy", > + .data = &accel_page_copy, > + .maxlen = sizeof(accel_page_copy), > + .mode = 0644, > + .proc_handler = proc_dointvec, > + .extra1 = &zero, > + .extra2 = &one, > + }, > { > .procname = "hugetlb_shm_group", > .data = &sysctl_hugetlb_shm_group, > diff --git a/mm/migrate.c b/mm/migrate.c > index 244ece6..e64b490 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -48,6 +48,8 @@ > > #include "internal.h" > > +int accel_page_copy = 1; > + So its enabled by default. > /* > * migrate_prep() needs to be called before we start compiling a list of pages > * to be migrated using isolate_lru_page(). If scheduling work on other CPUs is > @@ -651,6 +653,10 @@ static void copy_huge_page(struct page *dst, struct page *src, > nr_pages = hpage_nr_pages(src); > } > > + /* Try to accelerate page migration if it is not specified in mode */ > + if (accel_page_copy) > + mode |= MIGRATE_MT; So even if none of the system calls requested for a multi threaded copy, this setting will override every thing and make it multi threaded.