From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 957E0C35240 for ; Fri, 24 Jan 2020 02:10:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 462D521D7D for ; Fri, 24 Jan 2020 02:10:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 462D521D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D16D46B029F; Thu, 23 Jan 2020 21:10:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CA0356B02A0; Thu, 23 Jan 2020 21:10:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B686E6B02A1; Thu, 23 Jan 2020 21:10:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id 9C1F36B029F for ; Thu, 23 Jan 2020 21:10:42 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 5A27C181AEF0B for ; Fri, 24 Jan 2020 02:10:42 +0000 (UTC) X-FDA: 76410899124.30.feast43_7a7ac0c9be501 X-HE-Tag: feast43_7a7ac0c9be501 X-Filterd-Recvd-Size: 2898 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Fri, 24 Jan 2020 02:10:41 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A5FF9328; Thu, 23 Jan 2020 18:10:40 -0800 (PST) Received: from [10.162.16.32] (p8cg001049571a15.blr.arm.com [10.162.16.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 066133F68E; Thu, 23 Jan 2020 18:10:38 -0800 (PST) Subject: Re: [PATCH v5] mm/mempolicy: Checking hugepage migration is supported by arch in vma_migratable To: Li Xinhai , linux-mm@kvack.org, akpm@linux-foundation.org Cc: Michal Hocko , Mike Kravetz , Naoya Horiguchi References: <1579786179-30633-1-git-send-email-lixinhai.lxh@gmail.com> From: Anshuman Khandual Message-ID: Date: Fri, 24 Jan 2020 07:42:03 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1579786179-30633-1-git-send-email-lixinhai.lxh@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 01/23/2020 06:59 PM, Li Xinhai wrote: > vma_migratable() is called to check if pages in vma can be migrated > before go ahead to further actions. Currently it is used in below code > path: > - task_numa_work > - mbind > - move_pages > > For hugetlb mapping, whether vma is migratable or not is determined by: > - CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION > - arch_hugetlb_migration_supported > > Issue: current code only checks for CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION > alone, and no code should use it directly. (note that current code in > vma_migratable don't cause failure or bug because > unmap_and_move_huge_page() will catch unsupported hugepage and handle it > properly) > > This patch checks the two factors by hugepage_migration_supported for > impoving code logic and robustness. It will enable early bail out of > hugepage migration procedure, but because currently all architecture > supporting hugepage migration is able to support all page size, we would > not see performance gain with this patch applied. > > vma_migratable() is moved to mm/mempolicy.c, because of the circular > reference of mempolicy.h and hugetlb.h cause defining it as inline not > feasible. > > Signed-off-by: Li Xinhai > Cc: Michal Hocko > Cc: Mike Kravetz > Cc: Anshuman Khandual > Cc: Naoya Horiguchi Reviewed-by: Anshuman Khandual