From patchwork Fri Dec 14 02:39:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 10730331 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 21D4014E2 for ; Fri, 14 Dec 2018 02:39:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 047112CDE4 for ; Fri, 14 Dec 2018 02:39:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8F872CEE6; Fri, 14 Dec 2018 02:39:23 +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 7CF472CDE4 for ; Fri, 14 Dec 2018 02:39:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1967E8E018C; Thu, 13 Dec 2018 21:39:22 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 146BA8E0014; Thu, 13 Dec 2018 21:39:22 -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 00DF18E018C; Thu, 13 Dec 2018 21:39:21 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by kanga.kvack.org (Postfix) with ESMTP id B4FF48E0014 for ; Thu, 13 Dec 2018 21:39:21 -0500 (EST) Received: by mail-pl1-f198.google.com with SMTP id p3so2643712plk.9 for ; Thu, 13 Dec 2018 18:39:21 -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; bh=jeMRckIgJJ0diH0q5fYUiBgPgjBWL2fNnpbqJ5IAjtk=; b=J16DNlLfugR/xZnAr0V62rKPsAlGnTy3mw23MXEIy9wFVTjUgxji6THSdsqO5AC4fW cJUrzYRq6jwlErV71LdIavSqLWFp6Elnmn9tFccAWmUvoBcqNydFKlbi2n/Uo05ogAGQ jfaArJgcfUT+8ZFgM9DudW/TMTo4qheQszpI5kbIg491J5hfHOlAuRySo7PgC0+5zD/D Z+vB9ysyZegkpzwssrEJ6skTAI2AF/tXbTQCGBy1f20WRdp+GIh/2J51GfAuQLbBQo2d GfHx8LK03i2Ru1rYoftWqJ71MR/5EM+ficwBw5hYnS/flpFWFQIJlTW75URFNx+Xg2ha Ndsw== X-Gm-Message-State: AA+aEWY44JXGYi4j2wdrLPR0OWPg41k/9rQyoeyBJe/vHdeoDJ5CAncs 8wNw8q0ehDZf65b7UlKfxuJ7GUDUBEi5ER18Tw9c/Z5cjZ6W29u9YwTbBRr6v63y+lds8lskkFl QxWHHTbkBJNcQDTftA+PWuXbv21Dr18xi5LJWoGisOUOFyCCv+aWW7wHU2Lq0jM+SuetaJY1DWQ mSzlfVF7H3q4Uwf6pgLm3nXkrJyWFbGpjjg0yimSleNnUv/rKzpvIcsnWiRjBELAiZRFJi6IFQu 6PIoOlUxXJ+aZvaOQ3p7v5rBRE7RH+yBwMNIZ70IjpczyzMij74GjgICkJXvYNKVq0kcuyITswW GjTBFEvxdcG7jgeaHJE8qQlUeswvX32vPknn869A0/l1z2g1j6JeWlkKMsUCplB3dnOXFHTqRAw 5 X-Received: by 2002:a62:1709:: with SMTP id 9mr1161526pfx.249.1544755161430; Thu, 13 Dec 2018 18:39:21 -0800 (PST) X-Received: by 2002:a62:1709:: with SMTP id 9mr1161480pfx.249.1544755160449; Thu, 13 Dec 2018 18:39:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544755160; cv=none; d=google.com; s=arc-20160816; b=xEfJowCSjNptBJP99hAL5jOoz+GLZVSUY/ZDD/Dzm1BWGSapVn/wNphqprlCWtCZ0S wnjvd20J2Y6dlUcX5NKS2RBRmA0Nk+r0bLGVpLt23Gcz/LOBjGxAAj/NG6ZU27bfM/Id MyfuxoxsXKQlrimlOgEJaO97wuXmiZlxMZ4FE2jQF1b0xWgjKEBZy9PU0dBdSKooieIZ hCUAPEPb9/wjG5XPTpdVz7s2m7gjNRRRAw4t1HicCrPgI09QSkt1BM1R+c5pW5WRlXnc RL/p0ADjHDGjLJDyBRTRHvtvaPb1fWSwPnDh3UKOWW9WmXwl2jetto1e0kKehPkr3Xpu 7sIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=jeMRckIgJJ0diH0q5fYUiBgPgjBWL2fNnpbqJ5IAjtk=; b=UvM8WP1t536EKlDoqt7fbtOISP7I/406/ffwi9vLDBdBQXxwgm+K8vPmgSLCalq/50 DNbDVK3yyjtsvtrxrddH7K0rKq9aus9f0D4DnhRMDLszfyZSJdtXpQ8lUzI9X+8T5POc aennI9HVYj6bPcTrP1OXbEZqJpoTplhReMqPMLng7jdEHHkus6x7qZKCupP35NdBXlyj KJUv0NuWoR2h0QKztzQLMOZm0GWebNZVegiisgf6nzywQKOrilZasc1bNh4/jw5XF3i2 DIgeRgzuOB5TFjrvnThM6YOicrqJOXc3uS/EHWR9CzCm9DvtmFdjESlOOf5bDd0oXlWs sC9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HtNOqxB6; 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 z83sor5868780pfd.11.2018.12.13.18.39.20 for (Google Transport Security); Thu, 13 Dec 2018 18:39:20 -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=HtNOqxB6; 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; bh=jeMRckIgJJ0diH0q5fYUiBgPgjBWL2fNnpbqJ5IAjtk=; b=HtNOqxB6I84nWu7T/DoIa+HE9Xo2qAhujt9PEtLfCohUc7dTDN0+Y2ui/rGS1u3W/L CRvKIx5Xe49vKXraCgjkT54BNQKU0fM2+AYS2mPf+zAwPUUcdLJkcLE2TteHoqmqqwhl P3pwyk6u8HzmtzmX+3zI9CihD46UA0LNcVn6TUES5Hus6VWDxu9o8wM7SQmJhPcCCHWP +jaV7Qys3hNVah18A2kBpmUepKzR9jr04DfTrfY1x8Xo2aoGmghpwt7iG8mgHsqvb8HZ KhYp2PJgIhSbXel+A9ZrBYepxc6xVYbc0p43xFPajUet47MELFpVe5wPZliv3iQlVZlD E7DA== X-Google-Smtp-Source: AFSGD/UBjGZ9vhhwaugpYjkxWCC12gEMep0PT88trCtZCU0Yl4m7JRAvULJFwbRKotrjsX+NAz3Dag== X-Received: by 2002:a62:2702:: with SMTP id n2mr1229861pfn.29.1544755159974; Thu, 13 Dec 2018 18:39:19 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id d11sm4224903pgi.25.2018.12.13.18.39.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Dec 2018 18:39:19 -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] mm, page_isolation: remove drain_all_pages() in set_migratetype_isolate() Date: Fri, 14 Dec 2018 10:39:12 +0800 Message-Id: <20181214023912.77474-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.15.1 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() Since set_migratetype_isolate() is only used in start_isolate_page_range(), which is just used in __offline_pages() and alloc_contig_range(). And both of them call drain_all_pages() if every check looks good. This means it is not necessary call drain_all_pages() in each iteration of set_migratetype_isolate(). By doing so, the logic seems a little bit clearer. set_migratetype_isolate() handles pages in Buddy, while drain_all_pages() takes care of pages in pcp. Signed-off-by: Wei Yang --- 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; }