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.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 C422CC35240 for ; Thu, 23 Jan 2020 23:25:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 78C4E218AC for ; Thu, 23 Jan 2020 23:25:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="gP8RS8xo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78C4E218AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2704D6B0294; Thu, 23 Jan 2020 18:25:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F9FD6B0296; Thu, 23 Jan 2020 18:25:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 09A756B0297; Thu, 23 Jan 2020 18:25:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id E3B7B6B0294 for ; Thu, 23 Jan 2020 18:25:09 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 7FC7B180AD802 for ; Thu, 23 Jan 2020 23:25:09 +0000 (UTC) X-FDA: 76410481938.14.twig61_84428db058026 X-HE-Tag: twig61_84428db058026 X-Filterd-Recvd-Size: 5326 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Jan 2020 23:25:08 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00NNI42B186116; Thu, 23 Jan 2020 23:24:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=JNYTi+4wtzGG54UMhGWm1PWY4jctYyvZ2U+9XyD9PVI=; b=gP8RS8xoUUvyJtnfP7vkf5l7gYqHTQVn1WKckEiiSeknkZ4M/q/Ria31x7kOMsnxHWwz BBfUpAPNHK3lJkpoB4gZAzRIhSujLY9pvtU07B9boaksl2p9YT6Tg8OmmASyb2wwuiUP G7Cqv9QrZwOBJlqHpWc69cX7kNx7qcJPmxJf65XGryHZwId9gXjvUVWvq2gle2FzxpaM 5rv2vygqWO1xSPcsVAs5tTGiOL+d34YrMBIokrrmXnRnXkm7Hz8o1M+j+JrPzog49knA CaE3mz9bUffYV+CkDKORC6HkQPvZjDd/sqE4XJHUFbc48Yuh9CDxVY0600d5DT0euFSp kw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2xkseuwqsf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Jan 2020 23:24:59 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00NNItId192268; Thu, 23 Jan 2020 23:24:58 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2xqmudguxb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Jan 2020 23:24:58 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 00NNOu2x004328; Thu, 23 Jan 2020 23:24:56 GMT Received: from [192.168.1.206] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 23 Jan 2020 15:24:55 -0800 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 , Anshuman Khandual , Naoya Horiguchi References: <1579786179-30633-1-git-send-email-lixinhai.lxh@gmail.com> From: Mike Kravetz Message-ID: <1dec1a81-0b67-b356-f31c-8c87ae15f14c@oracle.com> Date: Thu, 23 Jan 2020 15:24:54 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.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-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9509 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001230175 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9509 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001230175 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 1/23/20 5:29 AM, 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 Thanks for continuing to refine this! The commit message looks much better. Un-inlining vma_migratable() should not be an issue as no hot paths make use of the routine. Reviewed-by: Mike Kravetz -- Mike Kravetz