From patchwork Sun Mar 29 08:08:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11463937 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 CC3B0159A for ; Sun, 29 Mar 2020 08:08:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B3252076A for ; Sun, 29 Mar 2020 08:08:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Acta1j8M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B3252076A 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 AAB086B0010; Sun, 29 Mar 2020 04:08:28 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A5C206B0032; Sun, 29 Mar 2020 04:08:28 -0400 (EDT) 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 94A266B0036; Sun, 29 Mar 2020 04:08:28 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id 7A35D6B0010 for ; Sun, 29 Mar 2020 04:08:28 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9A323180AD807 for ; Sun, 29 Mar 2020 08:08:28 +0000 (UTC) X-FDA: 76647672696.04.bear63_2cdc21b705735 X-Spam-Summary: 2,0,0,995efa71ca211d4f,d41d8cd98f00b204,richard.weiyang@gmail.com,,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1345:1437:1535:1543:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2559:2562:2731:2892:2898:3138:3139:3140:3141:3142:3354:3865:3867:3868:3870:3871:3872:4117:4250:4321:4385:5007:6119:6261:6653:7514:7903:9413:10004:11026:11473:11658:11914:12043:12114:12296:12297:12438:12517:12519:12555:12895:12986:13191:13192:13229:13255:14181:14394:14687:14721:21063:21080:21444:21451:21627:21666:21990:30051:30054:30056:30070:30075,0,RBL:209.85.221.68:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100,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:23,LUA_SUMMARY:none X-HE-Tag: bear63_2cdc21b705735 X-Filterd-Recvd-Size: 6302 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Sun, 29 Mar 2020 08:08:28 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id m17so17083358wrw.11 for ; Sun, 29 Mar 2020 01:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=+XfdXBS+VtHXJ6dDhCxeS+WipNF+yU7gkiw9iEz+TOc=; b=Acta1j8MpNHhBYr43x6Nm9YDQUHyK4dyioSB6UnWZ4pIDpX5INpFoFYTGqaVs0T2tL 4VuWiHgrFITpQZOJqjEFAkbZYTPh9+jl4GSR+8czIuXtSi8FOFKYAJa3eg+tvFEQYnaA G7ta6icVNrpLiJkPfiWI2Byl6Ey2vT+6vUVnufPUZcuoQdCkebLR4KHUxcc+Nf41M5WN g1XsFcY7+/bsA0AbPGHPMsWJdGIqcEtqecTMYRZpjtC//aAe2/hRNJAuDtwkm5aqure2 AQjuf/WGCvOFmKeQcrb2Erw/blgXtSOpnhwGhn2120kud1SoYokm65ZvmHO90KkmOtg9 eOYg== 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=+XfdXBS+VtHXJ6dDhCxeS+WipNF+yU7gkiw9iEz+TOc=; b=jHNuN2G+Y7Y5AM0UyJjS3clAqYKCrHvaDKgVF71lj8GwuscqLDiVOtlEJ9Us1Xjs+U MCcc/YZq7qHIRg8hg1Xx+pX477IwJ0qgxHHVfo77/DlXKa+CQ1SVGxOiOY5AGIHqJgtC AHQ/Fdr8OflDE1H2oRcEhyjvOguDrNdavcLOghmMSfhrL7hOkPWEfS2n2oTJPQVpxVKj yE28IXtT2HuCqp+DLXT5bepHMSsyN3cRjXGqAWn/0dcpdzsAL3hiDau39wBGcMbP+COA aO0bInTHdW0LhdYmGoQEG1ke5JaXE6whmqj/2EGXqHTLPS9nS5JFSn2jffGly74gGh1e ALbg== X-Gm-Message-State: ANhLgQ3aXGoUi/1gySb85UMNwZ/3ePtVmXvOdVjDAcZZ/Df77QYQoenm 6NSciODdm9Bxzyfyqw+4wRM= X-Google-Smtp-Source: ADFU+vtlRZkeX1L1RSbtoD85Sk424L2HYsEbwzkF+Nnxde1jseOPAlAxpvQ4b2L/y5Hi3I4EmsAxTw== X-Received: by 2002:adf:f404:: with SMTP id g4mr8476182wro.194.1585469306442; Sun, 29 Mar 2020 01:08:26 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id z1sm4204996wrp.90.2020.03.29.01.08.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Mar 2020 01:08:25 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH] mm: rename gfpflags_to_migratetype to gfp_migratetype for same convention Date: Sun, 29 Mar 2020 08:08:23 +0000 Message-Id: <20200329080823.7735-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 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: Pageblock migrate type is encoded in GFP flags, just as zone_type and zonelist. Currently we use gfp_zone() and gfp_zonelist() to extract related information, it would be proper to use the same naming convention for migrate type. Signed-off-by: Wei Yang Reviewed-by: Pankaj Gupta --- include/linux/gfp.h | 2 +- mm/compaction.c | 2 +- mm/page_alloc.c | 4 ++-- mm/page_owner.c | 7 +++---- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index e5b817cb86e7..7874b8e1c29f 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -305,7 +305,7 @@ struct vm_area_struct; #define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE) #define GFP_MOVABLE_SHIFT 3 -static inline int gfpflags_to_migratetype(const gfp_t gfp_flags) +static inline int gfp_migratetype(const gfp_t gfp_flags) { VM_WARN_ON((gfp_flags & GFP_MOVABLE_MASK) == GFP_MOVABLE_MASK); BUILD_BUG_ON((1UL << GFP_MOVABLE_SHIFT) != ___GFP_MOVABLE); diff --git a/mm/compaction.c b/mm/compaction.c index 672d3c78c6ab..784128c79e6f 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2089,7 +2089,7 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) INIT_LIST_HEAD(&cc->freepages); INIT_LIST_HEAD(&cc->migratepages); - cc->migratetype = gfpflags_to_migratetype(cc->gfp_mask); + cc->migratetype = gfp_migratetype(cc->gfp_mask); ret = compaction_suitable(cc->zone, cc->order, cc->alloc_flags, cc->classzone_idx); /* Compaction is likely to fail */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0e823bca3f2f..ef790dfad6aa 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4182,7 +4182,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask) alloc_flags |= ALLOC_KSWAPD; #ifdef CONFIG_CMA - if (gfpflags_to_migratetype(gfp_mask) == MIGRATE_MOVABLE) + if (gfp_migratetype(gfp_mask) == MIGRATE_MOVABLE) alloc_flags |= ALLOC_CMA; #endif return alloc_flags; @@ -4632,7 +4632,7 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order, ac->high_zoneidx = gfp_zone(gfp_mask); ac->zonelist = node_zonelist(preferred_nid, gfp_mask); ac->nodemask = nodemask; - ac->migratetype = gfpflags_to_migratetype(gfp_mask); + ac->migratetype = gfp_migratetype(gfp_mask); if (cpusets_enabled()) { *alloc_mask |= __GFP_HARDWALL; diff --git a/mm/page_owner.c b/mm/page_owner.c index 18ecde9f45b2..360461509423 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -312,8 +312,7 @@ void pagetypeinfo_showmixedcount_print(struct seq_file *m, continue; page_owner = get_page_owner(page_ext); - page_mt = gfpflags_to_migratetype( - page_owner->gfp_mask); + page_mt = gfp_migratetype(page_owner->gfp_mask); if (pageblock_mt != page_mt) { if (is_migrate_cma(pageblock_mt)) count[MIGRATE_MOVABLE]++; @@ -359,7 +358,7 @@ print_page_owner(char __user *buf, size_t count, unsigned long pfn, /* Print information relevant to grouping pages by mobility */ pageblock_mt = get_pageblock_migratetype(page); - page_mt = gfpflags_to_migratetype(page_owner->gfp_mask); + page_mt = gfp_migratetype(page_owner->gfp_mask); ret += snprintf(kbuf + ret, count - ret, "PFN %lu type %s Block %lu type %s Flags %#lx(%pGp)\n", pfn, @@ -416,7 +415,7 @@ void __dump_page_owner(struct page *page) page_owner = get_page_owner(page_ext); gfp_mask = page_owner->gfp_mask; - mt = gfpflags_to_migratetype(gfp_mask); + mt = gfp_migratetype(gfp_mask); if (!test_bit(PAGE_EXT_OWNER, &page_ext->flags)) { pr_alert("page_owner info is not present (never set?)\n");