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 From patchwork Tue Jan 14 09:16:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Xinhai X-Patchwork-Id: 11331639 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 75295138D for ; Tue, 14 Jan 2020 09:18:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 366452187F for ; Tue, 14 Jan 2020 09:18:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="STm9ULob" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 366452187F 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 02D428E0006; Tue, 14 Jan 2020 04:18:14 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EF75D8E0003; Tue, 14 Jan 2020 04:18:13 -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 E37268E0006; Tue, 14 Jan 2020 04:18:13 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0221.hostedemail.com [216.40.44.221]) by kanga.kvack.org (Postfix) with ESMTP id C690A8E0003 for ; Tue, 14 Jan 2020 04:18:13 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 7DBFA181AC9B6 for ; Tue, 14 Jan 2020 09:18:13 +0000 (UTC) X-FDA: 76375688466.07.pest56_47bd7c3f0af3c X-Spam-Summary: 2,0,0,e5c7dfee57db44e0,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:1359:1437:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3867:3871:3874:4250:5007:6261:6653:7514:9413:10004:11026:11473:11658:11914:12043:12297:12438:12517:12519:12555:12679:12895:13069:13076:13161:13180:13229:13255:13311:13357:14096:14181:14384:14394:14687:14721:21080:21094:21323: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: pest56_47bd7c3f0af3c X-Filterd-Recvd-Size: 3891 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Jan 2020 09:18:12 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id y6so13509362lji.0 for ; Tue, 14 Jan 2020 01:18:12 -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:in-reply-to:references; bh=mOqY5UipXKOJqky7LlBUnVkjHwPw7umGYYdq6LVQsAM=; b=STm9ULobFlRM6YV3AnwgaPzmoyKwQxiO48ycEUjKKo2nSiaUYO8FB+a+hYB9ppKbCS SW6qPymOwdDCZqsl7ni42l732MOdUtmBXkGV6aWG35AUr2AM5glFKJ9EGajAxqOFQBYp UTvXXRqW00rkfAw4BdNf3JYcqt6yJdVkZSUm2i0EL9+MgwOlLwX5Ec2CB66+KI7Sp9Zp EXNK168KN35w2qCydW+VMWixPhhwRs5N1GFvbrhEcOlkGKi7pUOP6JqTMZ0OBNqoGovU 5hDqFbVJQamy/79G0IB1LHuG0ngOseAH/YT73GZHRwg5pLTNU6PyZ9x7sMerIhWgHwgI AWUw== 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:in-reply-to :references; bh=mOqY5UipXKOJqky7LlBUnVkjHwPw7umGYYdq6LVQsAM=; b=Pgyaw4q0o4MFaZl6azaXKOIZt2mBfAW17XB4OdQa/MAguZH8aD21Ia5ZbZ605VYhLU np/gXEb57EsLN12wNFBlPoqZKp6ZrwZ/6/MkrDKucjHgmn9LSM2OJpVG74S/h8B5SfHd uzc+GXgdnQA2c2vWBSHBFv/OLvtDCB9CDRefstfAbSThJpAjx2TJ5Q311QXA6pXsU+OJ XpKUyu24mIqbkeMm4916VWlwsEmHkINaIYrdQCunZIreaEnihufANAwrW2VCRRcbpe7/ OXDk7FkJUgrL+5XEw6gqvQr7vyCIDMuT/2XgZeyV9kcVJOi1wqLOT2t6jVkkS37XG2xN VNtg== X-Gm-Message-State: APjAAAWVOvC9EVyrqNEzhjtt9AGNNIy3pD1Gc5VfIEQm2yTHxpVVklqh p8smFALd+5KbKl0DIQusZumTTlNn X-Google-Smtp-Source: APXvYqxZ2D+4X9Ym62ugcdOSB2bpIkEsPkBCdzqHE08NArlF6DKBYozFpr1rfHTtjJYPnXyRoSmzWQ== X-Received: by 2002:a2e:a168:: with SMTP id u8mr13926314ljl.5.1578993491503; Tue, 14 Jan 2020 01:18:11 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2020 01:18:10 -0800 (PST) From: Li Xinhai To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, Michal Hocko , Mike Kravetz Subject: [PATCH 2/2] mm/mempolicy: Skip walking HUGETLB vma if MPOL_MF_STRICT is specified alone Date: Tue, 14 Jan 2020 09:16:18 +0000 Message-Id: <1578993378-10860-2-git-send-email-lixinhai.lxh@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1578993378-10860-1-git-send-email-lixinhai.lxh@gmail.com> References: <1578993378-10860-1-git-send-email-lixinhai.lxh@gmail.com> 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 MPOL_MF_STRICT is ignored for HUGETLB vma according to mbind man page: Notes MPOL_MF_STRICT is ignored on huge page mappings. If MPOL_MF_STRICT is specified alone without any MOVE flag, we should indicate, from test_walk, that walking this vma should be skipped even if there are misplaced pages. Signed-off-by: Li Xinhai Cc: Michal Hocko Cc: Mike Kravetz Reviewed-by: Yang Shi --- mm/mempolicy.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 067cf7d..c117b5f 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -656,6 +656,13 @@ static int queue_pages_test_walk(unsigned long start, unsigned long end, return 1; } + /* MPOL_MF_STRICT is ignored for huge page, skip checking + * misplaced pages + */ + if ((flags & MPOL_MF_VALID) == MPOL_MF_STRICT && + is_vm_hugetlb_page(vma)) + return 1; + /* queue pages from current vma */ if (flags & MPOL_MF_VALID) return 0;