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;