From patchwork Fri Aug 14 17:31:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minchan Kim X-Patchwork-Id: 11715067 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 9FF58739 for ; Fri, 14 Aug 2020 17:31:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6164E20838 for ; Fri, 14 Aug 2020 17:31:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YZZzcYbQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6164E20838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B704E8D0009; Fri, 14 Aug 2020 13:31:51 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A348B8D0003; Fri, 14 Aug 2020 13:31:51 -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 85F748D0009; Fri, 14 Aug 2020 13:31:51 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0103.hostedemail.com [216.40.44.103]) by kanga.kvack.org (Postfix) with ESMTP id 66DBD8D0003 for ; Fri, 14 Aug 2020 13:31:51 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2F5425837 for ; Fri, 14 Aug 2020 17:31:51 +0000 (UTC) X-FDA: 77149866822.13.sun61_4a050a426ffe Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id DEB2F18140B67 for ; Fri, 14 Aug 2020 17:31:50 +0000 (UTC) X-Spam-Summary: 1,0,0,c42cdb1e7823344b,d41d8cd98f00b204,minchan.kim@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3870:3871:3874:4250:4321:5007:6119:6120:6261:6653:9108:10004:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12895:13069:13161:13229:13311:13357:13894:14096:14181:14384:14721:21080:21444:21451:21627:30054,0,RBL:209.85.214.196:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04yrsbj3gprbhfdd1sfzfyqryssskop7h1hf79qhkgmr1e63zcz91ki7fdtpked.wzytpq5mbjgynjdyu7qhrcoxotqmkamej9z9ibe4zp344eye5sk8wwsjmk9pqeo.e-lbl8.mailshell.net-223.238.255.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:24,LUA_SUMMARY:none X-HE-Tag: sun61_4a050a426ffe X-Filterd-Recvd-Size: 4375 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Fri, 14 Aug 2020 17:31:50 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id q19so4490758pll.0 for ; Fri, 14 Aug 2020 10:31:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KS+7WsC3qVWICgIyskO4nDMgUia5PatYrKOwFn7+XWY=; b=YZZzcYbQcL8tIkkKxXyJMAyNwsx6T8Pv0drfzreiOyigonf9yI8M1Vi5tLC6ExELfJ QdCrGKCp9LHOpdEsAEl7CPUfDGpEYmjQ28HlJQcMiRKN64NRwA/2LQxRXnkSSwXEifX3 +4SBvrSNdPPsgDw/N2nucCR2+SxQF8HE438+0Qpc+Hs9HEYcdZ5Pkdeh6HTGI7wn4Pbo yhdvCA0zDoN5BbzZLoYgJ1p3pJ3TUIbNjeHn+f9Xw7PL3aVL181TdbrJVyZA5THqjKWA nmzvQ4/fM+UcOfU4vfghOjI3ieFkOMj6yjZihEp7IhThPv88gJCSYtDIuJFG27jT1iWD h5MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KS+7WsC3qVWICgIyskO4nDMgUia5PatYrKOwFn7+XWY=; b=e5Ap6IuuJQiPm+ef/bLXffH//gRp5JyuwAky++cGdsYTzis1HX8rqH3PMQWS036RQq WNzHj5J0Ad13ntWkgdgTAgV/KYwHnFtLa/lU40m5jgNh2cPlSCeZBf/iuNidldRMHCL5 tsbOndqxuHRqUKkmi2BmlV8m7wsf2hzAE7SMljOVTjjwO/BsEZMro+C3vbPg0CBpfWa8 G0ubwN5icMf/0wDsathg6smfBb9qX+K0RDcPvocMlkmN8Y9X35F0yTTLZ8hWg0teShO5 T+ZqZWv9/3bBXgzYz8UjKjYyD84GtvRMNUqw7IzTW7JrKj8i7D9O6dLklr329cgqFfBn UUaQ== X-Gm-Message-State: AOAM531kkeb86juMWWUwFRrxcjPtmMIutJvokIN8ZZjjje9Iavr4V7xL AU9IVOOFal7im+IMfwTBhog= X-Google-Smtp-Source: ABdhPJwMXS0LhLmHStD8BV9BuY2GmvlfW65TjEA+A/juy6ovsRoUd6UqmKg2rkhQ67nBcjsD/QP0KQ== X-Received: by 2002:a17:902:9a82:: with SMTP id w2mr2689056plp.308.1597426309467; Fri, 14 Aug 2020 10:31:49 -0700 (PDT) Received: from bbox-1.mtv.corp.google.com ([2620:15c:211:1:7220:84ff:fe09:5e58]) by smtp.gmail.com with ESMTPSA id n22sm8522973pjq.25.2020.08.14.10.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 10:31:48 -0700 (PDT) From: Minchan Kim To: Andrew Morton Cc: linux-mm , Joonsoo Kim , Vlastimil Babka , John Dias , Suren Baghdasaryan , pullip.cho@samsung.com, Minchan Kim Subject: [RFC 7/7] mm/page_isolation: avoid drain_all_pages for alloc_pages_bulk Date: Fri, 14 Aug 2020 10:31:31 -0700 Message-Id: <20200814173131.2803002-8-minchan@kernel.org> X-Mailer: git-send-email 2.28.0.220.ged08abb693-goog In-Reply-To: <20200814173131.2803002-1-minchan@kernel.org> References: <20200814173131.2803002-1-minchan@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: DEB2F18140B67 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: The draining PCP of CPUs whenever we marked a pageblock MIGRATE_ISOLATE in the big range is too expensive when we consider fact that alloc_pages_bulk is just best effort approach. Thus, this patch avoids the flush when the semantic allows ISOLATE_FAILURE. Signed-off-by: Minchan Kim --- mm/page_isolation.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 6208db89a31b..e70bdded02e9 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -54,9 +54,7 @@ static int set_migratetype_isolate(struct page *page, int migratetype, int isol_ out: spin_unlock_irqrestore(&zone->lock, flags); - if (!ret) { - drain_all_pages(zone); - } else { + if (ret) { WARN_ON_ONCE(zone_idx(zone) == ZONE_MOVABLE); if ((isol_flags & REPORT_FAILURE) && unmovable) @@ -197,6 +195,8 @@ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, undo_pfn = pfn; goto undo; } + if (!(flags & ALLOW_ISOLATE_FAILURE)) + drain_all_pages(page_zone(page)); nr_isolate_pageblock++; } }