Message ID | 20231205030530.3802-1-songmuchun@bytedance.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 694D3C4167B for <linux-mm@archiver.kernel.org>; Tue, 5 Dec 2023 03:06:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DAF346B007E; Mon, 4 Dec 2023 22:06:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D5FAC6B0082; Mon, 4 Dec 2023 22:06:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C27506B0085; Mon, 4 Dec 2023 22:06:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B20746B007E for <linux-mm@kvack.org>; Mon, 4 Dec 2023 22:06:01 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 685A6C050B for <linux-mm@kvack.org>; Tue, 5 Dec 2023 03:06:01 +0000 (UTC) X-FDA: 81531275322.20.04F8E86 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) by imf11.hostedemail.com (Postfix) with ESMTP id F0C3640004 for <linux-mm@kvack.org>; Tue, 5 Dec 2023 03:05:58 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Ls8zlb5r; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf11.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.167.172 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701745559; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=jzYDmmhRG2n20WSmvmn2jO+KOPCtoJ3u06D8mep65Xg=; b=toYxDpSdEtbU72/id/MqicFGxx7db3waNDAkPr8uY0/qUkCuiwLtV5GvfU6YOYzcjUVW+n UTSh5a2bXrQrPcuB3Y2U+KZ6AfOBqUh3RILmBMBkp7gmBcjJBscnk4KsjSB7KqfIkjkAvE Mb3PALrbz0LIMBO1m7m5GSJgqgBZqA8= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Ls8zlb5r; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf11.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.167.172 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701745559; a=rsa-sha256; cv=none; b=D7k6twHoJgW+vZRnB1ETiEC+j/Ovzrqi0noJhzFeqmeWca3K09fjEmd3CiuUdKYE6Bll1E Ph0r4CTEtVUnwnjuXL3DYdbmB6n51yFjkUIONjyo2pMw8/16VpUJKbg6EywToMp4sQTbDX sonWrwtv7gW+/ZnEoubN5mFaYC0bWOk= Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-3b84e328327so2893570b6e.2 for <linux-mm@kvack.org>; Mon, 04 Dec 2023 19:05:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1701745558; x=1702350358; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jzYDmmhRG2n20WSmvmn2jO+KOPCtoJ3u06D8mep65Xg=; b=Ls8zlb5rEbTTVuzMsEbv25rOwCujBZfy2KSm/C780pzAoqU2uZv+MdIvLPA9voOhnk 3e6EWaeRZqib+vPs8tWfVhLnk/knEBRysbk347GyED7oo9NEvUysLupPap0XZxQot+wt wLtAkUwz23csuXwRlbb7K8WN4X7MtwVwYA7s1EhH3dXDZjR6kLEHp49pZW+06q5Lf03W nlS7jpqDsnbkRdd9Dhj5MjB8mo0Za0KM7AIwvzcLmp6iqM4U1U6R51YDrX8fqTJyoo0G ZEfOEJPBhwdqBPSmC7NEzBU9nJV9YZcxf+QCgCe5ZFLLqMSB5qsNAaLhQx2RA03adOtO uuJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701745558; x=1702350358; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jzYDmmhRG2n20WSmvmn2jO+KOPCtoJ3u06D8mep65Xg=; b=JixSkJbmgSb5H4olZUwmm6T3mvrl9+lOGEux/gDnUDBTbNlgYWUxRr1dfHsBhlKMbO JWS2K7lLBYYD7RQntDcLprBUeWAzA3dGCMNPRWQ2EOdAzdpmK3HQawydOVMYLuFc+DB5 X1KZBiN5dmav9F8VtOyyzprPT1qAe2ZKGPTQfns2aqyjWd5phncMXp/ctW0XZdhCEe24 EUVmCGhopqCXYuGjxUCZdxZEM0LyG0XVYFw5wh5CJeu22URKRuKjWxRSh3sJzeU6lwp/ DPKuOR/k1zhtI6Zs3SpGmx7VTeAbvd/g5FBGLk6uSbMWu45obQJzdJrUCZ/CSWAPVbzi qZ/w== X-Gm-Message-State: AOJu0YyToA611uX7lT7tL6HWhrG7bifYiPTiMDArHiYAgi1M7aeKwmqC CPb4IccHGOa3C2SrZ5dTJJ4jwA== X-Google-Smtp-Source: AGHT+IFBb0oP0UUkjKTxK2YQOmu7n4p4NPrrmlEXlUiLFndQCEE3Su2u+A+v5yzj06Eyu8u5+f6z9A== X-Received: by 2002:a05:6808:23cb:b0:3b8:b063:6b90 with SMTP id bq11-20020a05680823cb00b003b8b0636b90mr6290092oib.63.1701745557781; Mon, 04 Dec 2023 19:05:57 -0800 (PST) Received: from PXLDJ45XCM.bytedance.net ([61.213.176.12]) by smtp.gmail.com with ESMTPSA id ff22-20020a056a002f5600b006cbafa4b426sm92435pfb.110.2023.12.04.19.05.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Dec 2023 19:05:56 -0800 (PST) From: Muchun Song <songmuchun@bytedance.com> To: mike.kravetz@oracle.com, muchun.song@linux.dev, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song <songmuchun@bytedance.com> Subject: [PATCH] mm: hugetlb_vmemmap: add check of CONFIG_MEMORY_HOTPLUG back Date: Tue, 5 Dec 2023 11:05:30 +0800 Message-Id: <20231205030530.3802-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: F0C3640004 X-Stat-Signature: ytxd9hj8jay7xf3ntbftefw6brbay3w8 X-Rspam-User: X-HE-Tag: 1701745558-429422 X-HE-Meta: U2FsdGVkX19wkFLNHIXwV036X2tA2bVcwkDqQ1/z4tSVlOtevib9P7oYx1xTgXc2vXCC82JOpIh39vyYlNET2iYdgjDWqw7MC9Nfz5dVee8UBuw03YgWnwdojQ1cYWqXGTCNqxjRLE+VIsbFjBhC3FHO7KzAuAbemSHEMKnY4lH7mhDjXuY+0V0ksTlz6DTumAJKyAvrba3pfFsxk/EtqISdnkmW6RF1HwByNNkItwrfmkNsz0Mo6DnLxtfw+2pa59ZiFESWhh48DyEwyf5U3+TK+FgQbUFv+0uBQEFYnZgN4B7HhoLEXRQyhbXxWdgYxgT8xIcygvEsHxYlGDK3vWjJ7jZ363untS4FY0+5BLGjgcGVu+c6fqrRSB1dGeGunsEKMlOV74j2KgoK0oHfr52in7Aq0CjA2A3+cbVQ/HyFKCAyK+2rhFcIcE2WoqajxVEjKAoioWCjxInMc5/56+Buh4P/SQtuRMHcyf0xfMp7+wybUecfDF3OZK1aTqxXCapwtw4ELRUTEQPwyOBUXci3CwDY86woQybZNUQ+ZOpZqSAIUy7YRJjLRh8lRq1Xb1PgsWPjl98m44eKWrlnqMIbmDj7zFAXZopikliQagJuAQr45fbQRRI39qdON0rEzqDnQuQThkL8d611ACBSryae3TePROwL/dXp2o1C2lzY1+2GZBXMblZMBrP0lnQprOJzMeB+wsroz8WRgou6isjjdWWpXKXGgP969hYnAQMZPipaZhWmIlbhRB8swbtBxvqb9bLUVKGAsJU5WJqAMa0wPFJTLj++FYfgBTL6uSniZM4zZ2Xby3UTNRBhv44bEgBJnOE0yW5lp6QZsDt1+hBQEdOtDcGQj4NR9fdUIc89gRknnsco4ffVsD8bQ2WtFnt6yeJz4EILLlmkrq16WLpRKngmarD5V2hJZR/jNm5PEyLtFeUamVOWQpBYo2RRGSMdha/vjHrltnnSoXI vAzMUM3W 5r34h8IqL3YYcZsZrg6heQilk8XRF13QDg2ZN20xeL0ZsQjdDmac4KJ7p6D81gnpTgchJe616ZDA0sZEcMmK1/swXb9lGHI6xoZJp18qWah22zEbQ0K4EVEPS5pe55egIH0KBGMDU6+iwV1tQI0UEZ53TSn4V/RIvBNgIutOd62/LGpdlTnYQoWVsB3uOc2icgKgjGmpd0zwUCI3C8tQvA+vi3LXfMj0GgYoGapEZ90F1lXQxesbtokJf27r7MJeFqAx4oG97EncO4ju3kP5W2E9JyAwzf4c45qRzoOjrR0YZe4u/o1g1HkJFEItq40d9gBwikqbUAD5b79fBbOClu2ug9WwX4GWRo1FSAn/s+j2vP1vlssVG/I8HNwj+O+f5iaz91XuphHVc5fYFEm7A/y82up0WrGCSkAbywK3IqI1v4F0Whpg5mbDumrSjK6R0IQcBoDGoIef7Rbw= 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: hugetlb_vmemmap: add check of CONFIG_MEMORY_HOTPLUG back
|
expand
|
diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c index eb05596662d42..be1586a114ce1 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -119,7 +119,7 @@ static int vmemmap_pmd_entry(pmd_t *pmd, unsigned long addr, * +--+ | | * +------------------------+ */ - if (unlikely(!vmemmap_walk->nr_walked)) { + if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG) && unlikely(!vmemmap_walk->nr_walked)) { struct page *page = head ? head + pte_index(addr) : pte_page(ptep_get(pte_offset_kernel(pmd, addr)));
The compiler will optimize the code as much as possible if we add the check of CONFIG_MEMORY_HOTPLUG back. Signed-off-by: Muchun Song <songmuchun@bytedance.com> --- mm/hugetlb_vmemmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)