From patchwork Thu Jun 6 06:32:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687864 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF263C27C55 for ; Thu, 6 Jun 2024 06:36:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 645FE6B00A6; Thu, 6 Jun 2024 02:36:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5AEAE6B00A5; Thu, 6 Jun 2024 02:36:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 078086B00A6; Thu, 6 Jun 2024 02:36:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D3C376B00A5 for ; Thu, 6 Jun 2024 02:36:33 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 924ECA1332 for ; Thu, 6 Jun 2024 06:36:33 +0000 (UTC) X-FDA: 82199505066.03.CC04421 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf10.hostedemail.com (Postfix) with ESMTP id 34427C000D for ; Thu, 6 Jun 2024 06:36:30 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717655791; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UbSSGkJl/h0lihJAQt/PGC0DqVALRCRnb/UFL6TRjRI=; b=Ug0i+Ru244MJeud2L9+yHuR29FB0Utghe+U5GuN8oP04HToGtiU3CjdE3mFK079W92Vwt4 zOjrWjnOTh2Bif39LWNJ1Oz0Wi1k4b2ZobjIGZu2uMj+SvGqkOgyfUIuwGnHx5mDvSQFGb y8dC5DveR8eGOxkFRs8fJniNnY2xHGg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655791; a=rsa-sha256; cv=none; b=5G/+Qo07FTkV0VT5/4CHv+9HiJG8/1sVY9jXgKT/9D3Qa9h0LGd3EEZ8NzaFOn3J46nfC+ wBsREhz/61I0UhAxC5Y5iZB0lmEGkF22sLC9mDhU1fxxvFcNqm13d9DkJwfThi8g9gZDM9 Di4Xsf4y5tkiWrn+8TTzCA7Yfd5EnIk= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Vvvdn5nT7z355kv; Thu, 6 Jun 2024 14:32:45 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id BC2BD1A0188; Thu, 6 Jun 2024 14:36:27 +0800 (CST) Received: from huawei.com (10.173.135.154) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 6 Jun 2024 14:36:27 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 10/13] mm/memory-failure: move some function declarations into internal.h Date: Thu, 6 Jun 2024 14:32:44 +0800 Message-ID: <20240606063247.712575-11-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspam-User: X-Stat-Signature: doco8u3pkd4g899zbudcdxi8irc76hob X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 34427C000D X-HE-Tag: 1717655790-318285 X-HE-Meta: U2FsdGVkX18xnHrcymHj+A/4VG+apVTK/EleQVqgYV2OU0RTCoyd05+HK3XQDEiD9QpZktRAcnzuSe8XyoUlDEOcNwJljI5v7GZaLf5nptbivjnoDgSi8CAEbWGwM290a3+SQOEvzDNrQ8ezmjMOp52bif0txkaLDfGINl66hPisO3GxatsLAY/zeFzFB+eUYFa1hIqYnyUZXCZ4nqR2vCzKFuxS104Z0ROyamcswtwRdITOp1leMkRzijUjbzFXCjF+UL3EAvono5U5eqTZ7W1IJp1mGNCZZCRsJnbB6G4IhHuAVVunpWhSmb+24zppuKftpqhpBlw+IG4029e3BkfZlpehZm2ES/3gwBMSYTQ4zbp3xdF8PdBlaD9kAkzIBeOcebR49WT9C7IF3c0pkhC2lkk+6+p2wGSgtM8dFjXUhlNCvxOQ4CPkdyKBWot9KO8e2HwEtjJKl7f7M83lc0BLcsFQWJH9Xja2VxsIWZZnWpzS2jWyf7k2uv//NivHUKjBRCgHYwKSu3mGiJvRhgm1E9Uers54jnhWuih3v6Rza6411xvS5hlo+xKmmjFMTjTw2NhZnrsSgq9Ej4O7zov6UWHIz8Tca9RY//udVdLVngk05iU2vBdVQTwXFWbIS41uRaIcvDgPbusb3QhYEdD4cvGwP+1LJxB8ZdcjYJjMOBa3gAhJnKVbjoGwB0AQ/Sr5BYxNa//EaO1vamZPhyaID2skOvSZmtChAdwMNObEFAOWkdv8tfqsLc9iucV7kzS6F3Bb5n9MMSQyJGJXnC+JmsuonaVEpr0zFfUM7QfR7vEpajI3+N1s/+OLhE2rQ4JflPPNVZWmsb+WbhF9/FHzrXYJzi511diKqwVzUw7A+RtQM9kO5grod9D2mZrhpQBmyRJa+U0/YkLMiHXIyYCFzvQDzII4R+j/rGcAHW9YFFMIhXB7Fk3UDLa4vEFjRJ8NE4ioOOTCsSpw3V+ 063O/JhY vTr39MWS4MjbTp3o1ItcfBYwNVKctfPDVuKeA7Zq/qEQkDH6btLI/tDckOvdbnfDkzDXFF/If0CrbV0REVWMIHf9CanDxNX5i8qTRMJpAMThJcceNSS2wwAOvxRsUErvGutPpEPj3QU0YGisNqqm0r58u5VZpuP//AMzZ99iAC/sbVL+pmsFmrQI4V6WW7MmBnGzN/OrPwIt/KvRrSnAYjKTkQy2XAtFhmtSZjYu9CY7OZI1ycQ0U//Ns+8MT5ZJehh+Wo241s7mS23/Jzvc+OdT2nDWeFIKEgX20spPOnP83i58= 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: List-Subscribe: List-Unsubscribe: There are some functions only used inside mm. Move them into internal.h. No functional change intended. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202405251049.hxjwX7zO-lkp@intel.com/ Signed-off-by: Miaohe Lin --- include/linux/mm.h | 7 ------- include/linux/page-flags.h | 5 ----- include/linux/rmap.h | 2 -- mm/internal.h | 10 ++++++++++ 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index ec7141fb0252..5ca79aff5e39 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4011,7 +4011,6 @@ extern int __get_huge_page_for_hwpoison(unsigned long pfn, int flags, bool *migratable_cleared); void num_poisoned_pages_inc(unsigned long pfn); void num_poisoned_pages_sub(unsigned long pfn, long i); -struct task_struct *task_early_kill(struct task_struct *tsk, int force_early); #else static inline void memory_failure_queue(unsigned long pfn, int flags) { @@ -4032,12 +4031,6 @@ static inline void num_poisoned_pages_sub(unsigned long pfn, long i) } #endif -#if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_KSM) -void add_to_kill_ksm(struct task_struct *tsk, struct page *p, - struct vm_area_struct *vma, struct list_head *to_kill, - unsigned long ksm_addr); -#endif - #if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_MEMORY_HOTPLUG) extern void memblk_nr_poison_inc(unsigned long pfn); extern void memblk_nr_poison_sub(unsigned long pfn, long i); diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index f04fea86324d..b4e3444f1d9b 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -616,11 +616,6 @@ PAGEFLAG_FALSE(Uncached, uncached) PAGEFLAG(HWPoison, hwpoison, PF_ANY) TESTSCFLAG(HWPoison, hwpoison, PF_ANY) #define __PG_HWPOISON (1UL << PG_hwpoison) -#define MAGIC_HWPOISON 0x48575053U /* HWPS */ -extern void SetPageHWPoisonTakenOff(struct page *page); -extern void ClearPageHWPoisonTakenOff(struct page *page); -extern bool take_page_off_buddy(struct page *page); -extern bool put_page_back_buddy(struct page *page); #else PAGEFLAG_FALSE(HWPoison, hwpoison) #define __PG_HWPOISON 0 diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 0fd9bebce54c..8ff042c3eae2 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -723,8 +723,6 @@ int pfn_mkclean_range(unsigned long pfn, unsigned long nr_pages, pgoff_t pgoff, void remove_migration_ptes(struct folio *src, struct folio *dst, bool locked); -unsigned long page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); - /* * rmap_walk_control: To control rmap traversing for specific needs * diff --git a/mm/internal.h b/mm/internal.h index 12e95fdf61e9..7b1368d14e85 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1077,6 +1077,16 @@ extern u64 hwpoison_filter_flags_mask; extern u64 hwpoison_filter_flags_value; extern u64 hwpoison_filter_memcg; extern u32 hwpoison_filter_enable; +#define MAGIC_HWPOISON 0x48575053U /* HWPS */ +extern void SetPageHWPoisonTakenOff(struct page *page); +extern void ClearPageHWPoisonTakenOff(struct page *page); +extern bool take_page_off_buddy(struct page *page); +extern bool put_page_back_buddy(struct page *page); +struct task_struct *task_early_kill(struct task_struct *tsk, int force_early); +void add_to_kill_ksm(struct task_struct *tsk, struct page *p, + struct vm_area_struct *vma, struct list_head *to_kill, + unsigned long ksm_addr); +unsigned long page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long, unsigned long, unsigned long,