From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753967AbcGLNdS (ORCPT ); Tue, 12 Jul 2016 09:33:18 -0400 Received: from szxga04-in.huawei.com ([58.251.152.52]:24199 "EHLO szxga04-in.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752162AbcGLNdO (ORCPT ); Tue, 12 Jul 2016 09:33:14 -0400 Message-ID: <5784ED97.1080807@huawei.com> Date: Tue, 12 Jul 2016 21:16:07 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Linux MM , LKML Subject: why not add __GFP_HIGHMEM directly in alloc_migrate_target()? Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.5784F191.01CF,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6e7ff35218dae27f16400c0d83b12f93 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org alloc_migrate_target() is called from migrate_pages(), so the page is always from user space, so why not add __GFP_HIGHMEM directly, instead of the following code. if (PageHighMem(page)) // it always return false in x86_64 gfp_mask |= __GFP_HIGHMEM; Another question, when we do migration, why should split THP first? e.g. 2M(512*4kb) should flush 512 times TLB, and 2M(2M*1) only need one. I find flush TLB takes a lot of time, especially multithreaded app. Thanks, Xishi Qiu