From patchwork Sun Dec 1 01:53:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11268329 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 82E3A921 for ; Sun, 1 Dec 2019 01:53:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4FEFC2084D for ; Sun, 1 Dec 2019 01:53:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="NTV2F+09" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FEFC2084D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2509F6B02EF; Sat, 30 Nov 2019 20:53:54 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 230876B02F1; Sat, 30 Nov 2019 20:53:54 -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 163996B02F2; Sat, 30 Nov 2019 20:53:54 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id 008246B02EF for ; Sat, 30 Nov 2019 20:53:53 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id AADC4181AEF0B for ; Sun, 1 Dec 2019 01:53:53 +0000 (UTC) X-FDA: 76214901546.08.death40_21f815bd3d73c X-Spam-Summary: 2,0,0,7b511a7cf4155468,d41d8cd98f00b204,akpm@linux-foundation.org,:akpm@linux-foundation.org:cai@lca.pw:dan.j.williams@intel.com:david@redhat.com:haiyangz@microsoft.com:kys@microsoft.com::mhocko@suse.com:mm-commits@vger.kernel.org:osalvador@suse.com:pasha.tatashin@soleen.com:richard.weiyang@gmail.com:sashal@kernel.org:sthemmin@microsoft.com:torvalds@linux-foundation.org,RULES_HIT:41:355:379:800:960:966:967:973:988:989:1260:1263:1345:1381:1431:1437:1534:1542:1711:1730:1747:1777:1792:1981:2194:2196:2198:2199:2200:2201:2393:2525:2559:2563:2682:2685:2731:2741:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4385:4605:5007:6261:6653:6737:7514:7576:7688:7903:8599:9025:9545:9592:10004:10913:11026:11473:11658:11914:12043:12048:12114:12297:12438:12517:12519:12555:12679:12783:12986:13846:14096:14181:14721:14849:21080:21251:21451:21611:21627:21939:30054:30064:30 069,0,RB X-HE-Tag: death40_21f815bd3d73c X-Filterd-Recvd-Size: 4224 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Dec 2019 01:53:53 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2BA7B208E4; Sun, 1 Dec 2019 01:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575165232; bh=DELTp0hAw/1OSTKXwxXO9joXbTpcMCh6EjTSDgDOu2c=; h=Date:From:To:Subject:From; b=NTV2F+09xGpLweWQkzynjeNzTsop/NdGrEiq4Xhd71dczeSO5tXOyq+OrNuR7rYlR jIIHe2NYAYGCn+ok4iEgCz8pNSx4EZodYXt/dL8UWSgxSTZ93XKINRCaEKeWEYxrfZ RvlblEckaCuI3SFU+/1TYGtJme627Z7cd74ti6DE= Date: Sat, 30 Nov 2019 17:53:51 -0800 From: akpm@linux-foundation.org To: akpm@linux-foundation.org, cai@lca.pw, dan.j.williams@intel.com, david@redhat.com, haiyangz@microsoft.com, kys@microsoft.com, linux-mm@kvack.org, mhocko@suse.com, mm-commits@vger.kernel.org, osalvador@suse.com, pasha.tatashin@soleen.com, richard.weiyang@gmail.com, sashal@kernel.org, sthemmin@microsoft.com, torvalds@linux-foundation.org Subject: [patch 076/158] mm/memory_hotplug: export generic_online_page() Message-ID: <20191201015351.qnEi-XxC0%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 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: From: David Hildenbrand Subject: mm/memory_hotplug: export generic_online_page() Patch series "mm/memory_hotplug: Export generic_online_page()". Let's replace the __online_page...() functions by generic_online_page(). Hyper-V only wants to delay the actual onlining of un-backed pages, so we can simpy re-use the generic function. This patch (of 3): Let's expose generic_online_page() so online_page_callback users can simply fall back to the generic implementation when actually deciding to online the pages. Link: http://lkml.kernel.org/r/20190909114830.662-2-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Michal Hocko Cc: Oscar Salvador Cc: Pavel Tatashin Cc: Dan Williams Cc: Wei Yang Cc: Qian Cai Cc: Haiyang Zhang Cc: "K. Y. Srinivasan" Cc: Sasha Levin Cc: Stephen Hemminger Signed-off-by: Andrew Morton --- include/linux/memory_hotplug.h | 1 + mm/memory_hotplug.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/include/linux/memory_hotplug.h~mm-memory_hotplug-export-generic_online_page +++ a/include/linux/memory_hotplug.h @@ -102,6 +102,7 @@ extern unsigned long __offline_isolated_ typedef void (*online_page_callback_t)(struct page *page, unsigned int order); +extern void generic_online_page(struct page *page, unsigned int order); extern int set_online_page_callback(online_page_callback_t callback); extern int restore_online_page_callback(online_page_callback_t callback); --- a/mm/memory_hotplug.c~mm-memory_hotplug-export-generic_online_page +++ a/mm/memory_hotplug.c @@ -49,8 +49,6 @@ * and restore_online_page_callback() for generic callback restore. */ -static void generic_online_page(struct page *page, unsigned int order); - static online_page_callback_t online_page_callback = generic_online_page; static DEFINE_MUTEX(online_page_callback_lock); @@ -617,7 +615,7 @@ void __online_page_free(struct page *pag } EXPORT_SYMBOL_GPL(__online_page_free); -static void generic_online_page(struct page *page, unsigned int order) +void generic_online_page(struct page *page, unsigned int order) { kernel_map_pages(page, 1 << order, 1); __free_pages_core(page, order); @@ -627,6 +625,7 @@ static void generic_online_page(struct p totalhigh_pages_add(1UL << order); #endif } +EXPORT_SYMBOL_GPL(generic_online_page); static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages, void *arg)