From patchwork Wed Jun 12 07:18:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694542 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 F3FEDC27C77 for ; Wed, 12 Jun 2024 07:23:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 896B66B0177; Wed, 12 Jun 2024 03:22:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 43ED96B0178; Wed, 12 Jun 2024 03:22:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01FDA6B0171; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 627F86B0176 for ; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 17956C11E0 for ; Wed, 12 Jun 2024 07:22:58 +0000 (UTC) X-FDA: 82221394836.03.5A94A15 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP id AC7C940019 for ; Wed, 12 Jun 2024 07:22:55 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 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=1718176976; 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=8W/uCjh36hzTQNkhRo0Bf6FnikE7m/wx9QRTag7+des=; b=sh5lRUZT4wIYTp3gS1251n7+LXFsjtUTSFpQfAaMT4DVG5zREC7mFpE6n5+EdRaxG/oENw JdEBpocEs9ZcohMDJn5SHFbt1UNlRFuF3KzdDZSpH/1eskn6t7ROsp4B0BkenQb1LBM+Ji uAT3MqN1xGMttNR9oqFX7FbhkeNAg8U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176976; a=rsa-sha256; cv=none; b=yHI79BmJafak8oybXOWi4wNr7kcOeFbO2VwSCFqQMo8qhyrYQ+PAfKOCgSom3/Du7Bqnf8 ZuOQvVfT/GnHwvgWrfJOV79c0Ph5tpdzqx3/BxJnykAWN4IMLBT5r9zxgT9qrbzpLsHXfA U73O39rTg8TG2+5lYWGAjWB/UR0p8sQ= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 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.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VzcR91fP6zdfqZ; Wed, 12 Jun 2024 15:21:25 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 84D26180AA6; Wed, 12 Jun 2024 15:22:52 +0800 (CST) Received: from huawei.com (10.173.127.72) 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; Wed, 12 Jun 2024 15:22:23 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 10/13] mm/memory-failure: move some function declarations into internal.h Date: Wed, 12 Jun 2024 15:18:32 +0800 Message-ID: <20240612071835.157004-11-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Stat-Signature: uzwiw4xyn93hxc4qq1da8eufaxntsa8c X-Rspamd-Queue-Id: AC7C940019 X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1718176975-901203 X-HE-Meta: U2FsdGVkX1+weVInBiPAU4VupL9sAmHMtl4eOyWkEwhVkVOkI4NIBKNQKqrOD4X5Ga0/nMmFhe8GRnrSJE7u15gcq7nO2B5ya4DEp9h4oCoNiLYIZF7rQmL/L9TkHMnu+gcLLmvaUcqT/DZaR7ByAXMLRhNSGqab8dKLBe1x+zBtX04ZGYvjcw25iWXiADVi6cmZ6Jh1+NLD/fCYfd8EcMZOtwX0Qhkoiq22Sm4k5du1I57WNxTjdHOZL3xjekn5oL9aZAChK+n9lneiuhGg+Vn8V0TKd5PCuhgKrQE0MxMKmgZRDUedvwsWIZ4Da/cMgeTinw+xMWGYHzH/adSomvsBk4G9KLlvEphkssT54YYJDAO8/7HoAYUmeC0Nhfg0MZGO11jZcxpsXLrr/T7oadLiCGfYGYXXtJOzBSoMJpJSjhNxT/znFYio9FmX8G3drThAJZHG+fSTlL48VhZv2KcVC8i9eKftxTE+OYbFRJ8nsuwCxJTHYOPEi+Z1FfaTHyn012kXp0lcQVGReLWt66IJilQtT4sPI3h/tLJQ+jFaD6ZAfx1EHC9VKCTKIJ9MOQrcaj7jIySEsV9Y4NjoWz/BJXHpx8ZTe8PTM0F8PWE+9DtCKzYt1+xrdcBNHNH4NRqlimOM9GJT4vHr/80sK+mzM1m+zF/7uKh71UpSfNTuCRff+beZgDBO90GLxjlM0ccsEhnpgf4IDFgmSLqwOAovyK8VYzYfeFgrYkn4sxxxfX6dp5TjVSAwAkNJZxAb/ZZajAVDl7TzZvGG6xa/zkweJGqysEhS6gr+If5tr6Ux+E/5YPCpCjVux3eIkNTDaetfqOCUdCO5GJW5vn8Ka5dipDkaaNrH9jZEUSLQShTZfLsabqVgXpBoUhAV/Xtomg5cwhfQ2+pfQbV92X6RM0jxxwL5dJCmT39zfIwKAthT5NaF1t2gAH3rd74Wgy3s/SADrsv7maP+iAnpbcL P0BDP4/Q FCKXflfJ1LPQe9RY/zeLHSXd/0OzX7gmj0EYx2Sc8LeOZIn2u7oafuQMovzZJxdr7lrwdVfPuzsQ5wKOIVa2NDyJcfXd1ETkpctNPEsl3qZyD8iNgDx+4kf8BqYAMRI26pOb9DN3prkBIhAMeqlndB4hEwsZxN5ld+rImWmdykHGrFk5YeZa29Fu1CWh0GC+GoI1J1boyW9RY9JfVtcEWe+TrmnzFVO2HUj8NUN4wRemsI2z/qA9RU+8Dul/g6v33JtJUhLJNdvmr9shTF94+JnWnmt0q7BI5OYn9lh6irUkz+qw= 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 0bf0f22b32c8..587d34879865 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3981,7 +3981,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) { @@ -4002,12 +4001,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 0c9fd5250687..9a98b657ba07 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -611,11 +611,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 cae38a2a643d..b1bbe237ea4c 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -745,8 +745,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 14bab8a41baf..c9dc056a47a3 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1078,6 +1078,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 */ +void SetPageHWPoisonTakenOff(struct page *page); +void ClearPageHWPoisonTakenOff(struct page *page); +bool take_page_off_buddy(struct page *page); +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,