From patchwork Tue Dec 18 20:46:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 10736289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0266E13BF for ; Tue, 18 Dec 2018 20:47:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF37A2AE6C for ; Tue, 18 Dec 2018 20:47:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEC9E2AE6E; Tue, 18 Dec 2018 20:47:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F16C2AE6C for ; Tue, 18 Dec 2018 20:47:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 701B68E0007; Tue, 18 Dec 2018 15:47:09 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 68A318E0001; Tue, 18 Dec 2018 15:47:09 -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 52B928E0007; Tue, 18 Dec 2018 15:47:09 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by kanga.kvack.org (Postfix) with ESMTP id 0B8948E0001 for ; Tue, 18 Dec 2018 15:47:09 -0500 (EST) Received: by mail-pg1-f200.google.com with SMTP id d71so14743699pgc.1 for ; Tue, 18 Dec 2018 12:47:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=+xVLwI3IO6zbXfu+DYS+l9auW9a7fSsp7Ei+wAp7BUI=; b=ZVek7iIFJRSpisUYE4KEvU2i9as9RvhvlkMWJQRDVC9up4QScWzyXPbHoWCIZh3Neq EogjOHKsX97f1311ps8h6cCnNb4TcZlMouVHvJ0hnoygk+hl3RtQWTs6GSSB7VQoR2I7 sgf4ZwhsuGZF0B312fEgpJ32bzVk2rlg+FmqCOkVirPb5s7d/QIMP22yIGRmSvtQvjrV Resl04IDx0nnmIgbHzoBR1y/4wPicgqpiMX9tILzFOrXovn8VJ1h6ruTmAZfbS+karRW TrwMRa4nEgYzG2RWuDBj+QpRp+jmhS/Vk95XexCbIW2BritYptv0HlKxEA1XMfLZW231 pDeg== X-Gm-Message-State: AA+aEWa577MRkGjBB7GoeDGFJXstquqX/p0CBwXlqXYejuuVZyBanqsZ t8ef9Xk0/CuUfk9WDQzRJbgAK8Cs+7butP/mdQQ0ce0HMVNsCdZPJEtOwkWUXRCjKHfbHzm+5lG X/7ID6sve3YtZoJdib8CXjhKVLMTID/cFFeQJNCrt/XmkTpARRGCIaiaWAj2lbYZmSHaLsqs9q0 AFvfcjXDMczoTTWMuIRS4PAiQqfaJI4ErfaRrKxNB/dEvu/RzlOz6pcCsCXvhYNxb4gFhmScfHn 7pRR55e4fPCc+FyOzHE516tp3wM4Fr5f4BiAkCyqTdMdWQVzP1TDalGxVbImejP+ITDoinzr/sv maXk7DOTSO+A+IzmDabRvybqA7L3ciR59OkzcZZzNE/6B74/QKYg6k6supd4KnSHXp83AP8gPze 1 X-Received: by 2002:a63:585c:: with SMTP id i28mr17274327pgm.178.1545166028585; Tue, 18 Dec 2018 12:47:08 -0800 (PST) X-Received: by 2002:a63:585c:: with SMTP id i28mr17274296pgm.178.1545166027867; Tue, 18 Dec 2018 12:47:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545166027; cv=none; d=google.com; s=arc-20160816; b=GVizBZp+vpSUk5iQJnOvZCp5x7Xt6XVdT5/Nb10bCPkgwU6429pZ/0s51t+gUMSYuY YZJNUrPJxQJ/qD/Gh+tr+440WxyKiL0KAdAcK/rjh2uuy5EGwWx8AjcxU4kytq7o6fFb 67iQjrxhVMWh+3bmk5vIWbtYSdPgfLZNtBD7RMu/LO7Hx5Yd50ai/Ve0NrF538EZLq5N 49C8/n+vRVfbqxkKaeyqklZBqdFfuUqxl48wc/s22Xb47LM4hGpx3ZCpd/NaLqs/9rhQ p6b2wnyNHmCVBdIsDFxxF+a4QSiqVienmilhImVcfmAmul+/z+tr+dbbeMYo0S3l2eA4 YUtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+xVLwI3IO6zbXfu+DYS+l9auW9a7fSsp7Ei+wAp7BUI=; b=vdsSRz9btV4jR8X6/PorEzOXKIp9JHVWLMAQ/VwhXMB/vBuJWT5ZJuP1NJ62AV1TkG AGXBhkTpNQm/QwGH4jHO9T3zgviaY2yBxwTMAnUnvovqwhzdoXoqsuDfHJdf/kblITe7 KsKG8h7cqmC8JdLU6AUn3TPHm3RpXWyswu59qlXi6OH+YSoHJuQi1TmG943nUiKnHLK6 VC4D/4KwGodB88lgx3K2UjCOPtNt+tqjL8NDppk9dFRGMyV5KwziphD0Ue9MNVmSsnrE 5TW0GygaN+zuVfNH9w7WV8H3PAjDMir4q7jAQC7GCFvgeK7aLG50DXNIL+7T581dI2+V xeqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nvAOPdfc; spf=pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id t62sor28038256pfa.72.2018.12.18.12.47.07 for (Google Transport Security); Tue, 18 Dec 2018 12:47:07 -0800 (PST) Received-SPF: pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nvAOPdfc; spf=pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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=+xVLwI3IO6zbXfu+DYS+l9auW9a7fSsp7Ei+wAp7BUI=; b=nvAOPdfcnHpVtbV5jkLeEX8KcPjUdS8LPEH2jpIgoV0MoLGI2aQN3OCw/ycniI45cC UEibvweTpue65/sYrQZlBARuuqBK3U5xHhQQHu/8rna9SwXENwbDp7GRtuI0bq+l/5/0 cesxHZUpRdVr/WHkG+z2/oaJFnnyNZleLiM61OAdpPjHbwtEXAN7zeYMTeiNWmFtAxN4 erVlYUosI5AajhCz5x3+Jqazg+g23tPbcfTiTVB4wxiIg0b3yZqxhcH9hLUSgBen7srT RAEl7vcz+UHgky2F4JAbhIHbo6FiT2FRsr9hpi5nXxpWUwnlEZbCsgiekJM1PLKJxCBJ +2MA== X-Google-Smtp-Source: AFSGD/VdnysnkD/kDNIf4hDD7zMWwpvdfaC8bXXNeSRXYYHFTWx/imN6EVeeS7i7vP+hBSWWS3vxwA== X-Received: by 2002:a62:1f53:: with SMTP id f80mr17957620pff.92.1545166027329; Tue, 18 Dec 2018 12:47:07 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 184sm22214421pfe.106.2018.12.18.12.47.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Dec 2018 12:47:06 -0800 (PST) From: Wei Yang To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, mhocko@suse.com, osalvador@suse.de, david@redhat.com, Wei Yang Subject: [PATCH v2] mm, page_isolation: remove drain_all_pages() in set_migratetype_isolate() Date: Wed, 19 Dec 2018 04:46:56 +0800 Message-Id: <20181218204656.4297-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20181214023912.77474-1-richard.weiyang@gmail.com> References: <20181214023912.77474-1-richard.weiyang@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: X-Virus-Scanned: ClamAV using ClamSMTP Below is a brief call flow for __offline_pages() and alloc_contig_range(): __offline_pages()/alloc_contig_range() start_isolate_page_range() set_migratetype_isolate() drain_all_pages() drain_all_pages() Current logic is: isolate and drain pcp list for each pageblock and drain pcp list again. This is not necessary and we could just drain pcp list once after isolate this whole range. The reason is start_isolate_page_range() will set the migrate type of a range to MIGRATE_ISOLATE. After doing so, this range will never be allocated from Buddy, neither to a real user nor to pcp list. Since drain_all_pages() is zone based, by reduce times of drain_all_pages() also reduce some contention on this particular zone. Signed-off-by: Wei Yang Acked-by: David Hildenbrand Reviewed-by: Oscar Salvador --- v2: adjust changelog with MIGRATE_ISOLATE effects for the isolated range --- mm/page_isolation.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 43e085608846..f44c0e333bed 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -83,8 +83,6 @@ static int set_migratetype_isolate(struct page *page, int migratetype, } spin_unlock_irqrestore(&zone->lock, flags); - if (!ret) - drain_all_pages(zone); return ret; }