From patchwork Tue Jan 14 09:16:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Xinhai X-Patchwork-Id: 11331637 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EE88138D for ; Tue, 14 Jan 2020 09:18:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1AF452084D for ; Tue, 14 Jan 2020 09:18:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sylEV5Zp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AF452084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 44A4A8E0005; Tue, 14 Jan 2020 04:18:12 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3F9148E0003; Tue, 14 Jan 2020 04:18:12 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 30F5B8E0005; Tue, 14 Jan 2020 04:18:12 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id 1D2148E0003 for ; Tue, 14 Jan 2020 04:18:12 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 9FEEF181AC9B6 for ; Tue, 14 Jan 2020 09:18:11 +0000 (UTC) X-FDA: 76375688382.12.point33_4779eeecdf35a X-Spam-Summary: 2,0,0,a17e1ae036f2289b,d41d8cd98f00b204,lixinhai.lxh@gmail.com,::akpm@linux-foundation.org:mhocko@suse.com:mike.kravetz@oracle.com,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1345:1437:1534:1540:1711:1714:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3351:3865:3866:3867:3868:3870:5007:6261:6653:7514:9413:10004:11026:11473:11658:11914:12043:12297:12438:12517:12519:12555:12895:13069:13311:13357:14096:14181:14384:14394:14687:14721:21080:21444:21451:21627:21666:21990:30054:30064:30070,0,RBL:error,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:28,LUA_SUMMARY:none X-HE-Tag: point33_4779eeecdf35a X-Filterd-Recvd-Size: 3565 Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Jan 2020 09:18:11 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id m30so9216325lfp.8 for ; Tue, 14 Jan 2020 01:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Yc0y8uz463x5qAhsWUWV2N6lRVpOZxjM4JWnGEym7+c=; b=sylEV5Zpn5pNSuN31wane98hYJzuCwmbgy+PrTgk59AEQMR2lMCk/Uz4k4P6Zk7jRP D9PZUocfF7ZDZIq7Sptbf0z0dqboOYitRFvx5enV2/LFtWbwpiy7TucQ5LdPFvBoFnAp T4nF1gtNi26yClhZcp5T/3DpmnbXGcZgtD4lwL311FlkGotzO8LA5u84Z0ijSSeo6So5 pHUzVBcmSWLQvXJmDH4GcTaxgHFtDweISiUoQiHPv1G3Z70GNj2gbfkpWvJmh5EyQkV7 xxuD7dCZIxLJrr58cj5/qnXqBu1as1CatDzqbnoFaagi/IcbGD0B75V2WT0aLRiuXt/h Xwpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Yc0y8uz463x5qAhsWUWV2N6lRVpOZxjM4JWnGEym7+c=; b=Je9AUbIZ8yUzfnml3rxQS8hqDqBVchvxbvQEt6gK8PasabJ814Gduc1jnH9aQQqgO0 hNOVsfZJR1TLOqswv+v6Tb1/laD99SJ9DE7Yn/eCdCvfuaaJUZAYduxEXMLoMk2Wrxjh qp8gAMRafawmTCNmUPRfTvxdtUpMoLK+4OurIMt8pGmBLwmm6dZNy833FEYc0YqI+SF1 z5Y/uEm+cewATjufTY0fvFqXM29WXweZ4+0q55oN1F9rlGlb2ehUXe22ZAtl8uA1TEkW q8esbIAJ24+Q4CX/LFLg30sRVKDCkhKkHd53ydz3w2d1kqL5vfqBvJbmcB+7b9AK86Pl QEUw== X-Gm-Message-State: APjAAAVsamjP2W53yavIhs3Ssf0KRIDwZRZZN5Ir+u/OXZylSLvqq5uX bzftEcaIWnyT23HQkBDew1SSD51v X-Google-Smtp-Source: APXvYqwCU0VT/+g4VJV7cy19ZspeXnrWJ8Kdrj0EjOuxfQEBdpJuqS1sIMYWVa/IhZMs1GQ8D3PDYQ== X-Received: by 2002:ac2:46c2:: with SMTP id p2mr1027193lfo.139.1578993489360; Tue, 14 Jan 2020 01:18:09 -0800 (PST) Received: from localhost.localdomain.localdomain ([131.228.2.21]) by smtp.gmail.com with ESMTPSA id d25sm7231907ljj.51.2020.01.14.01.18.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2020 01:18:08 -0800 (PST) From: Li Xinhai To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, Michal Hocko , Mike Kravetz Subject: [PATCH 1/2] mm/mempolicy: Checking hstate for hugetlbfs page in vma_migratable Date: Tue, 14 Jan 2020 09:16:17 +0000 Message-Id: <1578993378-10860-1-git-send-email-lixinhai.lxh@gmail.com> X-Mailer: git-send-email 1.8.3.1 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: Checking hstate at early phase when isolating page, instead of during unmap and move phase, to avoid useless isolation. Signed-off-by: Li Xinhai Cc: Michal Hocko Cc: Mike Kravetz Reviewed-by: Mike Kravetz --- include/linux/mempolicy.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 5228c62..986e51d 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h @@ -185,10 +185,9 @@ static inline bool vma_migratable(struct vm_area_struct *vma) if (vma_is_dax(vma)) return false; -#ifndef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION - if (vma->vm_flags & VM_HUGETLB) + if (is_vm_hugetlb_page(vma) && + !hugepage_migration_supported(hstate_vma(vma))) return false; -#endif /* * Migration allocates pages in the highest zone. If we cannot