Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752292AbdI2POB (ORCPT ); Fri, 29 Sep 2017 11:14:01 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:44698 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751920AbdI2PN7 (ORCPT ); Fri, 29 Sep 2017 11:13:59 -0400 X-Google-Smtp-Source: AOwi7QAvgZUFYIwGpuD7OMYCNfP+fYps4exgB/IjgPoNnVM44lJz8hXkoe0YRN6ZrIGxEqYaVFnUqw== Date: Fri, 29 Sep 2017 17:13:39 +0200 From: Alexandru Moise <00moses.alexander00@gmail.com> To: akpm@linux-foundation.org Cc: mike.kravetz@oracle.com, mhocko@suse.com, n-horiguchi@ah.jp.nec.com, aneesh.kumar@linux.vnet.ibm.com, punit.agrawal@arm.com, gerald.schaefer@de.ibm.com, aarcange@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kirill@shutemov.name Subject: [PATCH] mm, hugetlb: fix "treat_as_movable" condition in htlb_alloc_mask Message-ID: <20170929151339.GA4398@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 891 Lines: 26 If hugepage_migration_supported() returns true, this renders the hugepages_treat_as_movable sysctl completely pointless. Let's keep this behavior optional by switching the if() condition from || to &&. Signed-off-by: Alexandru Moise <00moses.alexander00@gmail.com> --- mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 424b0ef08a60..ab28de0122af 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -926,7 +926,7 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, /* Movability of hugepages depends on migration support. */ static inline gfp_t htlb_alloc_mask(struct hstate *h) { - if (hugepages_treat_as_movable || hugepage_migration_supported(h)) + if (hugepages_treat_as_movable && hugepage_migration_supported(h)) return GFP_HIGHUSER_MOVABLE; else return GFP_HIGHUSER; -- 2.14.2