Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2499781imm; Thu, 16 Aug 2018 10:29:11 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwjw7Z2UcpwW818oF1lwwhJvtSjsBdzBP1L7bO4gzx0skhvttD512/6gWs3fNy7tnFiDS0K X-Received: by 2002:a63:c742:: with SMTP id v2-v6mr29528093pgg.331.1534440551520; Thu, 16 Aug 2018 10:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534440551; cv=none; d=google.com; s=arc-20160816; b=zu8aDsxDigcErKUwhVTZNAUk1HQcOal8IQe5wouZGLCzuelJ0YNLK0U4izYuFlMkOK zC5jNi/KYFklNhSJeU0cn/fJXK0zzfvDCge5LK0EpjaYiFB9myd1WiwYUqm1XklQp/wy Ep1lRkS5KbI72RMFdpCIVYvCZtCbPXlJKL1RkeAl6CH8rtksn04H7rp5sYLY9ONn0QYC QKOWpFSWytzyeP6ag6f3L+GxDo7gjyMGoAn1kwjTTy1txVJYsQo8IgwOtAwNgxZvWUsq 2iVAV/HrSZ+DsPLtli/vgN7G++CK732hYFeAXuG1tSNzex7GMeDLlcR9o9nGO+tXgmUV E7hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=GMxWoyaTfcY/teE3rvj2CFkSo11yCG42GDLXPss+Y88=; b=rTY6uRq2Ae5dO6LXuJiiGy2/dEWICJ8pOpAGMAldp4hOV61twulZK6/CRpl8EhMeTS Pi0bPn2Ah1saXPlIikqrOj82U61zbvu/kyc612fufuDjPRpbZdt/enHOF24OWtELJipp /YAkZClCZvPOnONQOQ/WtahhbO2R1j6743cQmseARx282p9iMCr+ugOtiHSHghGpe18o Iqs/O91/BaN0irw3iGfp2UI6b8YSVvpM0aDGoLiorxoneWwu+rApwBEJ+7grgSDfPvSE w3dHoBLrhmwRd4rD+tSC1RC6Rxb53IMs3ZtYyIdObbPZNiiFNACO7R12JNQpGcZocOW/ VLNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc3-v6si14952537plb.389.2018.08.16.10.28.55; Thu, 16 Aug 2018 10:29:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390751AbeHPNEK (ORCPT + 99 others); Thu, 16 Aug 2018 09:04:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55788 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728018AbeHPNEJ (ORCPT ); Thu, 16 Aug 2018 09:04:09 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B7E20401C090; Thu, 16 Aug 2018 10:06:39 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-94.ams2.redhat.com [10.36.116.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD02210F1C1D; Thu, 16 Aug 2018 10:06:36 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Andrew Morton , Michal Hocko , Vlastimil Babka , Stephen Rothwell , Pavel Tatashin , Kemi Wang , David Rientjes , Jia He , Oscar Salvador , Petr Tesarik , Andrey Ryabinin , Dan Williams , David Hildenbrand , Mathieu Malaterre , Baoquan He , Wei Yang , Ross Zwisler , "Kirill A . Shutemov" Subject: [PATCH v1 1/5] mm/memory_hotplug: drop intermediate __offline_pages Date: Thu, 16 Aug 2018 12:06:24 +0200 Message-Id: <20180816100628.26428-2-david@redhat.com> In-Reply-To: <20180816100628.26428-1-david@redhat.com> References: <20180816100628.26428-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 16 Aug 2018 10:06:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 16 Aug 2018 10:06:39 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's avoid this indirection and just call the function offline_pages(). Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 6a2726920ed2..090cf474de87 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1589,10 +1589,10 @@ static void node_states_clear_node(int node, struct memory_notify *arg) node_clear_state(node, N_MEMORY); } -static int __ref __offline_pages(unsigned long start_pfn, - unsigned long end_pfn) +/* Must be protected by mem_hotplug_begin() or a device_lock */ +int offline_pages(unsigned long start_pfn, unsigned long nr_pages) { - unsigned long pfn, nr_pages; + unsigned long pfn, end_pfn = start_pfn + nr_pages; long offlined_pages; int ret, node; unsigned long flags; @@ -1612,7 +1612,6 @@ static int __ref __offline_pages(unsigned long start_pfn, zone = page_zone(pfn_to_page(valid_start)); node = zone_to_nid(zone); - nr_pages = end_pfn - start_pfn; /* set above range as isolated */ ret = start_isolate_page_range(start_pfn, end_pfn, @@ -1700,12 +1699,6 @@ static int __ref __offline_pages(unsigned long start_pfn, undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE); return ret; } - -/* Must be protected by mem_hotplug_begin() or a device_lock */ -int offline_pages(unsigned long start_pfn, unsigned long nr_pages) -{ - return __offline_pages(start_pfn, start_pfn + nr_pages); -} #endif /* CONFIG_MEMORY_HOTREMOVE */ /** -- 2.17.1