From patchwork Fri Jul 2 09:41:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6raM7Jik7ZuI?= X-Patchwork-Id: 12355775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E60EC11F69 for ; Fri, 2 Jul 2021 09:45:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 16340613EA for ; Fri, 2 Jul 2021 09:45:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16340613EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A9E3A6B0011; Fri, 2 Jul 2021 05:45:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 966178D0002; Fri, 2 Jul 2021 05:45:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78DF78D0001; Fri, 2 Jul 2021 05:45:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id 51D826B0036 for ; Fri, 2 Jul 2021 05:45:03 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0C3A318346301 for ; Fri, 2 Jul 2021 09:45:03 +0000 (UTC) X-FDA: 78317164086.01.5581672 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by imf01.hostedemail.com (Postfix) with ESMTP id A3FEBD0001AE for ; Fri, 2 Jul 2021 09:45:01 +0000 (UTC) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210702094458epoutp013fa3c499d102651b997821a361558ead~N8Ci92jWM2869228692epoutp018 for ; Fri, 2 Jul 2021 09:44:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210702094458epoutp013fa3c499d102651b997821a361558ead~N8Ci92jWM2869228692epoutp018 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625219098; bh=bDbXixnB4Y0V53jA7IW56VMxaCwE42cipQ84atzG2dQ=; h=From:To:Cc:Subject:Date:References:From; b=VMvWJAGSENBtkvzAAVOsyypKneloqtVJc1AYLPpljAPJm+hDP8Isb3hsoDPBveog9 hAjVp1n7zUAXZFYI/zriiYcNAhQnIF9i+ThQ99PKEzi/qqrmG0TDzfZLcDdDPayPCU 4F8yAX5/Jmw8elYl9ByAv+rPLjWlVC73fImA2kak= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20210702094457epcas1p3b019b64667baa19ec91b557a383ac11f~N8Cip74Ea2802228022epcas1p3o; Fri, 2 Jul 2021 09:44:57 +0000 (GMT) Received: from epsmges1p2.samsung.com (unknown [182.195.40.164]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4GGVYP3Gb9z4x9Ps; Fri, 2 Jul 2021 09:44:57 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 65.93.09551.910EED06; Fri, 2 Jul 2021 18:44:57 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20210702094457epcas1p295611b5799befffd016b8fccf3adceff~N8ChvI25L0305903059epcas1p25; Fri, 2 Jul 2021 09:44:57 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210702094456epsmtrp1721a2dd275185c378eb037136aabbb45~N8ChuZWNb2300123001epsmtrp1M; Fri, 2 Jul 2021 09:44:56 +0000 (GMT) X-AuditID: b6c32a36-2c9ff7000000254f-97-60dee0190181 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id C8.69.08289.810EED06; Fri, 2 Jul 2021 18:44:56 +0900 (KST) Received: from localhost.localdomain (unknown [10.253.98.78]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210702094456epsmtip18bc48ca8222b462155320c3df5a83408~N8ChdUmM70979009790epsmtip1X; Fri, 2 Jul 2021 09:44:56 +0000 (GMT) From: Ohhoon Kwon To: david@redhat.com, ohoono.kwon@samsung.com, akpm@linux-foundation.org, mhocko@suse.com Cc: bhe@redhat.com, rppt@linux.ibm.com, ohkwon1043@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] mm: sparse: remove __section_nr() function Date: Fri, 2 Jul 2021 18:41:29 +0900 Message-Id: <20210702094132.6276-1-ohoono.kwon@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKKsWRmVeSWpSXmKPExsWy7bCmrq7kg3sJBluvilrMWb+GzeL8g19s Fl/X/2K2uLxrDpvFvTX/WS3u9zlY7N3va7Hr5wpmixtTGtgcOD12zrrL7rHp0yR2jxMzfrN4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Vcjtxz lFiKMxINtZiLihMBXz0HLvgDAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprILMWRmVeSWpSXmKPExsWy7bCSnK7Eg3sJBgv+GlvMWb+GzeL8g19s Fl/X/2K2uLxrDpvFvTX/WS3u9zlY7N3va7Hr5wpmixtTGtgcOD12zrrL7rHp0yR2jxMzfrN4 TFh0gNHj/b6rbB59W1YxeqzfcpXF4/MmuQCOKC6blNSczLLUIn27BK6M5zNOsxW846jo7cpt YDzI1sXIySEhYCLx/PYlZhBbSGAHo8SjJRwQcWmJpy92sXQxcgDZwhKHDxd3MXIBlXxglGjZ uAesnk1AW2J/7wlmkBoRgXiJ+dfYQcLMAmUSV1f+ZQWxhQXsJaa/ugk2hkVAVeJUByNImFfA WuLRg1nMEJvkJVZvOMA8gZFnASPDKkbJ1ILi3PTcYsMCo7zUcr3ixNzi0rx0veT83E2M4FDT 0trBuGfVB71DjEwcjIcYJTiYlUR4Q+fdSxDiTUmsrEotyo8vKs1JLT7EKM3BoiTOe6HrZLyQ QHpiSWp2ampBahFMlomDU6qBaWr8yj/zksPDHY5rLrK+LXJK33/GO+6nMXLOkS8W5t0WuViQ OOPuX62TFnbFRjdiTnpkc0ev3/+oRYXNuzr8QTYbc+rWhH5frskH5ZylGPKr1OdHHeOvvFX4 5Vkhr67CCsV/FxZJS6vnbHOt2J5Uzn9PTJ6fbaILx0TPV/V11SLnjE5dLf6VeHLDypPP31fI vp7IGN7lrHJfWKZ094YHwg+57F+0buKX+Lj35KMZ7sZRwXyRO+YaRQsE6hyb3+dUqxjQvuqk V/zU1J/yb2v7mhMvfyv1Z/yjoDdhe87+wkqThQ+SZ9/r48oTPWPLbOUcFsf6s21dtRHj34jE zz8XZZ4vT3voeVPLefKk28FKLMUZiYZazEXFiQCZLMz3pAIAAA== X-CMS-MailID: 20210702094457epcas1p295611b5799befffd016b8fccf3adceff X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210702094457epcas1p295611b5799befffd016b8fccf3adceff References: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: A3FEBD0001AE Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=VMvWJAGS; spf=pass (imf01.hostedemail.com: domain of ohoono.kwon@samsung.com designates 203.254.224.24 as permitted sender) smtp.mailfrom=ohoono.kwon@samsung.com; dmarc=pass (policy=none) header.from=samsung.com X-Stat-Signature: 68d9cp3fc8sedf78ah83rgxoqb644suc X-HE-Tag: 1625219101-234296 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: This series contains cleanups to remove __section_nr(). When CONFIG_SPARSEMEM_EXTREME is enabled, __section_nr() could be costly since it iterates all section roots to check if the given mem_section is in its range. On the other hand, __nr_to_section which converts section_nr to mem_section can be done in O(1). The only users of __section_nr() was section_mark_present() and find_memory_block(). PATCH 1 & 2 changes both functions to use section_nr instead of mem_section. PATCH 3 finally removes __section_nr() function. More details can be found in each changelogs. Ohhoon Kwon (3): mm: sparse: pass section_nr to section_mark_present mm: sparse: pass section_nr to find_memory_block mm: sparse: remove __section_nr() function .../platforms/pseries/hotplug-memory.c | 4 +-- drivers/base/memory.c | 4 +-- include/linux/memory.h | 2 +- include/linux/mmzone.h | 1 - mm/sparse.c | 35 +++---------------- 5 files changed, 9 insertions(+), 37 deletions(-) Acked-by: Mike Rapoport