From patchwork Sat Jun 29 01:33:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13716750 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 9B958C2BD09 for ; Sat, 29 Jun 2024 01:33:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FC086B0088; Fri, 28 Jun 2024 21:33:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AC3A6B0089; Fri, 28 Jun 2024 21:33:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0733C6B008C; Fri, 28 Jun 2024 21:33:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DF47C6B0088 for ; Fri, 28 Jun 2024 21:33:45 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 45BB41C0B65 for ; Sat, 29 Jun 2024 01:33:45 +0000 (UTC) X-FDA: 82282204410.19.D091862 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf11.hostedemail.com (Postfix) with ESMTP id A47AB40004 for ; Sat, 29 Jun 2024 01:33:43 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BMZe2qXB; spf=pass (imf11.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719624805; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=zCZbfP3u3ZH4Gvot1gex7hMp9QgO7GRM3EA/12qDQkY=; b=q2WKc/EJ0w4+ygHRfFTqnObz12HhBBGT8kUtnfA76dhUvZ3PQmbfllgXwwFRCQ+z0GJYlR uXv9xB8eZuyMTJQhl/Zz5z27mlh8kKReZOlGVa0cR5rKIA99k+K4GnRkYCi2tyCYac19HJ f9lWKWzVWM3H2vv5UcmqRrxWf1MGnJk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719624805; a=rsa-sha256; cv=none; b=7d4yGpRosuJ/YcW0B9eOOzanHCH/qK7b25XViGC8YFDbMHHl/DR3LWdxsYNHH8U4e7tdLj 4Sus6qLKZtMiWTLCZPJzMxOjhTWOSvgjUgZGfrvYOQK++ovmUTGuGwsEOA+hmM2W8mN6Qv 9wKw1fe4Da7oWggwRdL3GvopPTeWJG4= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BMZe2qXB; spf=pass (imf11.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a6fdd947967so116534166b.2 for ; Fri, 28 Jun 2024 18:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719624822; x=1720229622; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zCZbfP3u3ZH4Gvot1gex7hMp9QgO7GRM3EA/12qDQkY=; b=BMZe2qXBKXopzN1GO6+49RS/Kp+wJ5DX0vxwzazR2xFiJgMlb6o4hR7vjzn1xIQJQP AiR57LCHr1HyhF/Z3z1tR5qVS5AoYbFjQI593i+E0egaKfeaptDCyezDmrjJmB6P4iaJ HOBt4hBkR0evpKeRyfE2RXrfUvZt6z/IOg5AnWr+A6HLVix8CD0OgB3dE25K8sFQecng BX4L5Sq4Cherz2mln9mpMtGxmswz7SSV3xE39yTG58OWr6uT3U4JRkYg3wculuSokojJ UEKOji3wYWvYJENw6wdUlAQMjX90E7+5s+0VXH6x2Q8iF4mE6va8thRXbtp0dAJElsd3 DXDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719624822; x=1720229622; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zCZbfP3u3ZH4Gvot1gex7hMp9QgO7GRM3EA/12qDQkY=; b=mSad15Ng30E3dD/LQjjL6W8nkpGWNlmKjzxWXPjuEn3HQYAc7Vqt9SfzDNcGiAU7M7 /g0Tb6jrXkr+NE/QN6yyOlWOZQgHO3cQAdc+9zKdqi/voVqNTbYUEBchTs3MI9E+nxgS kmSoM59g2jAo/5wWaK1Y7MEeCicpikvJjWW/7F+aWelbuMYFNLEJD5BsDrCnekoOrxj1 w5C5xbbdzI8sFSqy6AgvnFLmWVuE+cEwYglwQ490k7V9AN0Kqu7Pv0admQyf936ymiaZ di+o5mEhyEuIMiXoD+Dl9uxU3njcGrTiq2lmLDIJl1C6zg46Zi/Z64yecg5K/ALvQc16 5ZQw== X-Gm-Message-State: AOJu0YxCHIPf3uGbtG+6u7FJXqVFiyugG4bKtK1YBvFdmr/QU5paXNpV TJQ580BEAsbRYOM89kLTVjby3lFq3ssytM8KwlL1hZ33ysDAS/vs X-Google-Smtp-Source: AGHT+IGDmYpUNHzWD89cqGNfLPfwZ4zd4GoQZX1fLzjyd3tGiw7rVm/YcLphpmadsiOiQY0Y2XnHyw== X-Received: by 2002:a17:906:3748:b0:a63:49d3:e1c5 with SMTP id a640c23a62f3a-a7245cb2444mr1314023566b.64.1719624821676; Fri, 28 Jun 2024 18:33:41 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72aaf18c99sm123762066b.2.2024.06.28.18.33.40 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jun 2024 18:33:40 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, rppt@kernel.org Cc: linux-mm@kvack.org, Wei Yang Subject: [PATCH 1/4] mm: use zonelist_zone() to get zone Date: Sat, 29 Jun 2024 01:33:19 +0000 Message-Id: <20240629013322.12364-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspamd-Queue-Id: A47AB40004 X-Stat-Signature: 46s7jbbjwecbxmtosdzehh4ihmahqx66 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1719624823-836811 X-HE-Meta: U2FsdGVkX18vP/nSK27fNk4iGufWGMnvLDEtb1MWRjEtt8eCljofGlLJhUVgpWIIERlB422M2t9owICfGUImbBiLtJ6wSqG41Xm7TFJ2a24wJ3rbv+XZy/xvPp+AiKiCqEiKWY9IMwr1+k3iQku6HVvDkhkPcPQm7f7EsEfqO2jtRmtqgzzPwScpzefeG9tN5w9UA2yM8n/3PCq0ReFAq+m1GXS99UyIgEw1KrG/+cgTJumb/0XG4V7zdfCJ9sDFvMuckjPEf7Fq8ZBOgFYEQ9t1Bgl3ozrgrBT5uyiZZjt96FhJXPKh1UUPX7NTysEDiKBjKd79VYPU+7fXPRFBzt5AzVtDwkM45I559Xs3/oYeLETL+oM1b6Q7LrhNmkXQw6FC7M7jp1ObXXoxBA7xIHtH6NJMEyqKEuI5rIM8LJlJsEecfRXtVWf6EaZVt+1BfcDpcQtVTTkS+f6SQOt4ulnr/TSaxW8ipTSrLG6A8LT4RAiZggz/FQmmkGHs0qtClfj8aRKFuUmuKtiqyp8+Rb6qDhMTWE6/RwU49vHXGsXqTI/ukWy/XV/Vr4T28UuZ3+2ZJyJsUe2yoNorrdqwbxrUHsZB5yPsfgZxfuFXBylU7cfLIQPT8dD1ZP46RpEpyqiGDYOLgVJc7PSxGF9d4HGDWlv2iPeG+ZdzBcaiN6zFVoBURSooOtQFhlc+/TZFersY0Ump10EJ7w0yXazvmD0heSt8FeV1Lko5ogpSaB+KeWt4R9N27jKvFEPy+PzrBJzRy4WyeqzDmupNzfVOhsZ0RnSbfP/84OyEmW+clmtPNmtcYrlzesLb/kOGmj/tDE7JHmizFJ7If4BKAqyHJy0cHeddDtQE0r3EKfSu1fGCToqlzoWaz51J0eAb+l7/0yT5DuS4oa2icEfgXMj3EkNdwiFz7DJUFtD25bwWMH9xtYeHZ3gudN/KYypkvk0Q8bOs/WkrGnOD2e4JjPD 4RqctbIW 3r4NJzZ9JNCkh83higWYxRjeLNSibdQUyF3Og4/3m5Ov3mrpCKc6Yj+aPHRm3VDpbJn17jekY1PH4pK+4736mgcUzX3iLQJkldsj29oq6kJC7XLyPSmuBnR5PYfoY+AKCnZZPmat6HpGYlqnSGoEIVkJtksFGAQCDuDnLLLz5Mv4uNFm9YbB6O0i92lbK2K7X7P8SLFJZxC4M3RDt9TufbWtm3HbrenpbpFZm2PN1bPAivX0ednBdO4P0I0hF2A/wZ8h5786JPS/E0ft/qlzvOmAqQ8pT4op1uPyMB6q6BDlxgkhzaDPJHK8l9/UyKyOD+NaVw6mHkMVElbmtlJqC7NwFIO+M+qTq5+jQkm/FKYNTXjhqNBpC7bJgJE/PaqXLst+PPFIWPUQqwzcTH1pv9I4VVmBjQ8KzMTizDwW+Mypuz7bVRJXP3TmQIM1tHsyQNGJBr3rDB/ugwtPcMJK+iJYL9K8ME6VL4mRICujh/JiHkLuyFbJmk/v/jk4ZL2zLe7z4tDYpcY71xRI= 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: Instead of accessing zoneref->zone directly, use zonelist_zone() like other places for consistency. No functional change. Signed-off-by: Wei Yang CC: Mike Rapoport (IBM) --- include/linux/mmzone.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 586a8f0104d7..f983a15be18b 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1688,7 +1688,7 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, zone = zonelist_zone(z)) #define for_next_zone_zonelist_nodemask(zone, z, highidx, nodemask) \ - for (zone = z->zone; \ + for (zone = zonelist_zone(z); \ zone; \ z = next_zones_zonelist(++z, highidx, nodemask), \ zone = zonelist_zone(z)) From patchwork Sat Jun 29 01:33:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13716751 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 D10C5C3064D for ; Sat, 29 Jun 2024 01:33:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B9AF96B0089; Fri, 28 Jun 2024 21:33:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B483B6B008C; Fri, 28 Jun 2024 21:33:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C2186B0092; Fri, 28 Jun 2024 21:33:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 80A066B0089 for ; Fri, 28 Jun 2024 21:33:46 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 30380C0950 for ; Sat, 29 Jun 2024 01:33:46 +0000 (UTC) X-FDA: 82282204452.09.052CFCB Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf26.hostedemail.com (Postfix) with ESMTP id 68BF614001A for ; Sat, 29 Jun 2024 01:33:44 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="m0m/o8XS"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.44 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719624810; a=rsa-sha256; cv=none; b=fgoQ06wieQG2b1jOCic8au4bq3b45n0D3yUJWYQ70bAhHukaTNCUnDFI/oNP+IiqtmrguA NJ/+UINR0SF9taFrr9TOTHtVWZs737Zm9zUm9BUN3R6m/15aX6c9GMQKPOZN8U/33ll189 kzlfhIZarFPD5RLTi4esOZTwlXOorZ0= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="m0m/o8XS"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.44 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719624810; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=/cFljxBBWTzFxiiZnk6Pd9Jll5+l7oDT2rf5v2DyvNY=; b=7CTY0HQUB/1FCKVdd/n1Ag7s5ffqMFgTibs+pHhPmEe0CLffi27JGU+ACkoQRLHeI55F5G z3HQGruVdmMjZvVovRyyYU9QBa9InXXI5q0vaiO7BnUYk+S7YMRORD9I7WlD8jcKGd3qoq ffITavbUE5fxdh+urQoNKhs28EibZSc= Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-57d1782679fso1561953a12.0 for ; Fri, 28 Jun 2024 18:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719624823; x=1720229623; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=/cFljxBBWTzFxiiZnk6Pd9Jll5+l7oDT2rf5v2DyvNY=; b=m0m/o8XSQJOBihf4zOuTWtIQxkZRtzXVvrnuJJBiBamPfzTtCTmyTLvOjctciIcZjW Rq5+CBQOrB1SKFRQyVaJcHRcbYcyp9B7vaE6jBiWJz9Zwa/Ilii3CQkv+PYmUjE7v+Bs vYNdv223t/OO+iZ2tNbsKO77TvWW3O7Vw9oNFXDcrEvaE5kaPtAwV4Hqq1rAKAmF1dZM 5KXZxMAUSZKuer53CV70zJGlZBPfAl5backg3ZjOBdWrElG/NyddJ5nWS0JBcmIP7cN0 9UjEEofCkATZVLuunalIrIBB3yPMTXHiAqFrbdQ1MyFENgWxZrtDsW8h/boNnAOsry63 ai8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719624823; x=1720229623; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/cFljxBBWTzFxiiZnk6Pd9Jll5+l7oDT2rf5v2DyvNY=; b=Be4hhvLsQHBN8JeBo5wCOjwD7p9e6DEF7aasO2etascsT52qSM34tWaIzBN+EBBT0Q eOk6tHSO0T5OfJXTr/JUYXO3MOpJOrl8vorgSA6YRakZrK8ZypGhm7IcaF0aWyLarZKY u9WAs4V3QTfDy3V5fiFOQDa6zgsKHLf8dInbdDtlGDQHdVgyrpZ6dPFrwrjpqRbyBh1o svG8P4Oe7rH3CAasj0LvaEf52uT6sTdkiZQ867n4mi9f1Pn/Sm9VTRePkQpfA8FXjC8f dGnolHwtBr1FbEk06M2M3dIpo8g1MTjBQtLjzhCvuCAePM25V7apnZCumb5Cuk6jLqDf rc7A== X-Gm-Message-State: AOJu0YyfdqLjkr29RvXW27XRLtJt8tZeTpjB6tTXxr3PUS23Ieiuhw6I zY5gNYtZDCQxH+ODKWYnIUemczNcVNtbOlxr/0+xyKoAwDbJM/tg X-Google-Smtp-Source: AGHT+IEZG466tNs8HZlvHuBRrH6qMyNDwwCL45R1g6+KYqCMygpUd4xOyKFaZJA1fS0t+mbQdQDpUA== X-Received: by 2002:a17:907:118c:b0:a6f:c167:614e with SMTP id a640c23a62f3a-a7245b64c48mr1203671766b.31.1719624822819; Fri, 28 Jun 2024 18:33:42 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72ab08d143sm122598966b.151.2024.06.28.18.33.42 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jun 2024 18:33:42 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, rppt@kernel.org Cc: linux-mm@kvack.org, Wei Yang , Nathan Zimmer , David Hildenbrand Subject: [PATCH 2/4] mm: not __SetPageReserved on initializing hot-plugged memory Date: Sat, 29 Jun 2024 01:33:20 +0000 Message-Id: <20240629013322.12364-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240629013322.12364-1-richard.weiyang@gmail.com> References: <20240629013322.12364-1-richard.weiyang@gmail.com> X-Rspamd-Queue-Id: 68BF614001A X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: y7amtx4x9i7bjnr1934gxxb61wjaf6as X-HE-Tag: 1719624824-994563 X-HE-Meta: U2FsdGVkX18/pyKqYci88pmLRzsag2andOjS318HyBAqSy6RNSRD6zM/Kr1/BPnBoUt1HAkbSbLhO8k2K9KPLyV4eFyZfV0yyX1SRRVz1H41tbQIC36fJrX4ktAl8FIeU6LeThI9mOZvWuB+1lSlcJ3KUE+6Td7KRvVcGLi8dnNMx9/LEJ8nb5gu9XCe3puWRu2ORnkBmcHfV7Tv7nId5chCBoXIR0WHpXaPYJhgyk7J+S0u/5E+nABPOzYYuU+U0d/TYUJJnPH+z+gFAPgtd1NZuMqHNNsET7aA0mSo1JGUb7WqpYW5QF3yd1f8A1xoBDaybGZaAp+mHg+Z2iK6YqRPQn/di9kuz+FZFsczq9OvK2Z48UCn/+3rd2Eeo9vkaz/PX8S4Vi3Qt8SU7LaG16/0ewlTOKxLo/hcrVANrjT3lHC2HdVcknTIzBqGoaAjtoKfYbe6fQoIr2VZdooIZn0kX0W/fGFNo48cnD9vohxj7n9D95mkLM7WS0uDzOL6WK1o7YEI6/jte+KBmRDK3jiGYVQhIt3lh2gKHvlnUSghkSDB0baGNZXTPEgQx+jBcDL3O/7IjjlxXsdL4Fx+IIh2mFWfWxBuPPtHL+vq5NfV5LuKHvdx1ZHaed1MbO/a9D1Nml7qVRB6xmM/O6f9wQqaMUEmcwzHiqe9jbX0asDHpx6yBgRFbpWb4UDzvkc2QmIi/AXQRQp3PxIab+PE3OcXjHorcH8mVRzqrVhudf314DJoPA+hyzlhGy+pEK4hEQ8r9Fc6wKXmj8DIt7Mfr6GkwZIj2knWNqICvZa82zJ+1kMvdhunMldETekqwC2fDIyT+D15Wt4UTxQTj0PRwaPFTozgPasXVTBSDkqDEA6Cd1wDo3SF7ZyQSN1Rpt8xm37nM1G+0Z/HQzb4vB65oYDHpUmQ2J9xmjRp2TihvZgXP9u6LQRoBf/ont84DfYYgce1PzhUpJ/pH5SyB/9 5eUjkJWd f9i4+tIaZJbdg19enteaNpfIpuW1JISpE7PKuPQ2/pY4zScvM9yBHiAjwxcutq+USYIlI0SlXMeZWUJ4YRZX+xOvMQ0mnjfa7+A4H11s6/Jp9ovbmK9neZAgq69XAgT5Reoh/RhAVa//jrpbDcp36+WiUt1xMaCEzZhwKZ807nCJ8NjGGko2qjlPSMo3T2MJW/lVafnlP/maI6OK/LMh6m7mE8NjM0mHF9rHph1158gHxWBjBvfPfG358kDghlHc5RBSOrPdxToqsJCaSy547gz6rPD+Ra0ZJ5oBB16t1UzHhgEYN3bCezZZ0AulrjncHAWSIIwdxWtm7Mh3ECab4Ai/KoipOi/vVFpFxlEOQMslB+8fpnp2gaUVkJr9rCnYtc6T7f4Kkxh8uBpi7jAYNl8+wCXVsTbei9R6NtuBQiq+LOJJdiWvPIeOY8nquX0RpAY576SPvhC+gqGkzyqr/bTB1JqoXE+8wwUIpBUxyU40Z8eSaSueG1dODEbz+JAt5fohXMTKGqUB6XMdfD3nzAjjGMlasDiUbb2O3SB3eh+Hay+SRcEQokf7WlFth6KMN1WNsCLcAbQy5K6q0SyPY4SI06ZnBIAEo8ryT 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: Initialize all pages reserved is an ancient behavior. Since commit 92923ca3aace ("mm: meminit: only set page reserved in the memblock region"), SetPageReserved is removed from __init_single_page(). Only those reserved pages are marked PG_reserved. But we still set PG_reserved on offline and check it on online. Following two commits removed both of them: * Commit 0ee5f4f31d36 ("mm/page_alloc.c: don't set pages PageReserved() when offlining") removed the set on offline. * Commit 5ecae6359e3a ("mm/memory_hotplug: drop PageReserved() check in online_pages_range()") removed the check on online. This means we set PG_reserved for hot-plugged memory at initialization is not helpful and a little different from bootmem initialization path. Now we can remove it. Memory hot-add and hot-remove have been tested. Signed-off-by: Wei Yang CC: Nathan Zimmer CC: David Hildenbrand CC: Mike Rapoport (IBM) --- mm/mm_init.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/mm_init.c b/mm/mm_init.c index 3ec04933f7fd..362ac4334b99 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -839,9 +839,8 @@ static void __init init_unavailable_range(unsigned long spfn, } /* - * Initially all pages are reserved - free ones are freed - * up by memblock_free_all() once the early boot process is - * done. Non-atomic initialization, single-pass. + * Free ones are freed up by memblock_free_all() once the early boot process + * is done. Non-atomic initialization, single-pass. * * All aligned pageblocks are initialized to the specified migratetype * (usually MIGRATE_MOVABLE). Besides setting the migratetype, no related @@ -892,8 +891,6 @@ void __meminit memmap_init_range(unsigned long size, int nid, unsigned long zone page = pfn_to_page(pfn); __init_single_page(page, pfn, zone, nid); - if (context == MEMINIT_HOTPLUG) - __SetPageReserved(page); /* * Usually, we want to mark the pageblock MIGRATE_MOVABLE, From patchwork Sat Jun 29 01:33:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13716752 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 30237C2BD09 for ; Sat, 29 Jun 2024 01:33:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A15416B0092; Fri, 28 Jun 2024 21:33:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 975476B0098; Fri, 28 Jun 2024 21:33:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 815CF6B0099; Fri, 28 Jun 2024 21:33:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5B0CE6B0092 for ; Fri, 28 Jun 2024 21:33:48 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0BC82409DA for ; Sat, 29 Jun 2024 01:33:48 +0000 (UTC) X-FDA: 82282204536.28.1BCC763 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by imf07.hostedemail.com (Postfix) with ESMTP id 4D56340007 for ; Sat, 29 Jun 2024 01:33:46 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=jbSo552q; spf=pass (imf07.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.167.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719624807; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=o+ki2jLUWqWH3r6+HRoqUOjdfVn/SUqjMvg75SRoSQ0=; b=sFr/ljbmunnFwXqmvsmqe8WQv+OH8LsAL6NMR/9Qlaiwbta+Q6pPRNn0m0ST8GVX3M87T/ 8lS4uqmAIyPl4usyj+e+LJA4Rni3lb7SqIXw1/1bgDk2w3dzP0dADso70Rbyz16LqDSMfO N37HvkNQsR2PFGnp0YSGbVY+JKkHWDQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719624807; a=rsa-sha256; cv=none; b=sQP5Na8K+eJ759n9BQ/0Ai891zQk+/xlTNIxZ0obxUrH2yB0h3KdTEcdfoDpHoHNkf8vUE Ahx90mgc3koMZelYtGTtNZi6Nbz36j3P/W+19lhCZqhJ7mo9K5nrj4ZTNZubg/Bym5fghs MIQ3ipHSUbJvICBoIZE38w+DE9ZAu/Y= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=jbSo552q; spf=pass (imf07.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.167.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-52e8037f8a5so329028e87.1 for ; Fri, 28 Jun 2024 18:33:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719624824; x=1720229624; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=o+ki2jLUWqWH3r6+HRoqUOjdfVn/SUqjMvg75SRoSQ0=; b=jbSo552qx4/BovYw2c0ow0tag+vwrucq96b/SApvjnkg487BJSbPaMxbmxDnjp9sSO 06Za556N6ITEOvfhT1lDZIQC7ebnZ6nVjd2TQ1h3Nfd5BkHr6mc+ekKImU8RYwKRNK8G EnkmAtMt3MYUv/mo3pKTGXRAQ+w2E+Wxkc6toqc9r7dqfd5+zN5J+2LoqdcMEVd5kzTD 8twrhA4WnS3yzquTOg868rC3/G3X2YJtB+cKAw84I2xj9luTbJTEnPBMQt1NBNAljj9U /WUHTDkblptpAl19i/XuGxSYtJ+2ZURJvU9Csi7rZsqrsqaMBISjQebW1QLBfUtVdCf3 bGVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719624824; x=1720229624; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o+ki2jLUWqWH3r6+HRoqUOjdfVn/SUqjMvg75SRoSQ0=; b=oGyhx1+9PiYqTFWUChfCNTXgzDqFzh6pJujMlPZk+DZh0TbxW8kCHjux+UqIubOo8o jy9CSQE9usaw0K6jfNqwy9cRlRPE0O+4epm668r92XnDWwo6Z+HoZXZMffHCayVfIDzD CV3Nx//2PQENplyMB+xxMwdaajLYE+3DkodnzTSk2h8rnj+S5RjMYBuu5omHvx4IITzA jCOvpZOJAgfS8RH7HRHfGcHdmkmkpkwPv4NEicYzSqhAQP5ll/EvGz2P1FeSZdY/I0jk L4tnnf7huR2SdCWpuo3nKjlTBDsdAFqz5L6G5j8KYKwMHWyVy0miktW6ACizGTMxLiAr LoUQ== X-Gm-Message-State: AOJu0YzdcOoYi6ZNshw+y4xBhfmPb4L+au9htcjtbQzbuvgTlLYx9VkB Gb6HCuGQXvk//U80sLoGSDSCxyrn67jB3J5XKfFHtmPVw46dpciTsZNS+shM X-Google-Smtp-Source: AGHT+IFJYnFjXkpittDIRh6ZykI0K6XuwphJGOVHl5Hj3DgI4b3bPxOPO8M5GapzzhkgsoEby/kssA== X-Received: by 2002:a05:6512:3e0a:b0:52c:e3c7:941e with SMTP id 2adb3069b0e04-52ce3c799f0mr17248849e87.47.1719624824466; Fri, 28 Jun 2024 18:33:44 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72ab0651d4sm123431566b.112.2024.06.28.18.33.43 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jun 2024 18:33:43 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, rppt@kernel.org Cc: linux-mm@kvack.org, Wei Yang Subject: [PATCH 3/4] mm/page_alloc: put __free_pages_core() in __meminit section Date: Sat, 29 Jun 2024 01:33:21 +0000 Message-Id: <20240629013322.12364-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240629013322.12364-1-richard.weiyang@gmail.com> References: <20240629013322.12364-1-richard.weiyang@gmail.com> X-Stat-Signature: 84b78n9hsdakotjimsp4b5rddpfmi3s7 X-Rspamd-Queue-Id: 4D56340007 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1719624826-214650 X-HE-Meta: U2FsdGVkX1+OVFoUE1z6Y0ml1aTTgjdqn1V8S7WdBsIbjLIRnyaTUSpHWZfRNYJfKtW/qgQi0NSf+k+AJPE3q4XvV/DOYnMNwoBzC6mpdmjo4t62quKP6SVfTkUVyFTgrn8gYhxgmdrlNF39bDsMUXCuVp26cgIASYp5OAYfRs7Rx/+WSVOhAHApom3FYbrAX7I8kS/bDpMT5GBkxQghQchUz3Xuknr/wK/xIP9OUEP2BmsyvAT8cY3/5iP5MOj6fjP6DZ7vuX9si5JEHjZVdopF1Lll1r2OKxFfQuQwgTWkQ6uJ+WUBbBPTbE54f9yrcqP0YyUBY18JeQxl2Bnehf0lmdCdAVdEIlXjB7gT86qxcNpND0GD3RwgfdPoljmBd8OTV0qU5CyYI6wei0X3T/JMAnBb0pf5rT9a7q9MfZ6zcTpldxpF9OW+GOTKELZR2QV5Nk/NTiDSB9Kk/3YktCnfcDrAjTEOgjMbgwK0AJVglJ2P2Fn3MyTrZTbC/66Y1wsVWcnQJfy8KWL2DcO3aoXmYx9x5nYSR2NZI+DYi5d3hPQhoUlyIoaJVPx5AGC5/Wmd/1LTzTrpKlhDC5hQKXMGWSCOKcK6qsfhvr+vzuLngWTq0SFbqMLhu7hi6QrOWCkxLMCYStRlrPbyl5/fEeDgWpMCo2oyOLcMJ7ozCfuN+4U7EsVB6wYyOYpDNbRJIkdmwz8WTL/Rd/0YnvJHL4EAsZkbfskLg1FXnlxHfG0vSQSZk2yy2qQ8GjF5pNrVTCcodrA08vLU0FFHLH5xULGoh3LIhLnyO1b6S1myqWzehBvlzUNeR+nc7ksIvp3oMBJS4tXLJDFzsP3OSVzUq1+z+R6ozB11GTs/1UJ4gMzfiHjeJf9gDND22D4HN1vSrv2vvUcg0hODOBblFNLpMTOVIlmNUzpggW4/WCnt7klUm5ngN/zto6rdQJkiEw8/QpXlazhtMehYsaeIv1c 985rk+4Y ZXZR9LkAgm6jFvuq/7EDNv9q1Ls4ieKmG3sNlxEgqGiibyJpwTkzTqAh4Tz0vxdxSyDTlePr6/773XCzBEWgeVfcQom2EolQqgAF1NtZd1w018sE3k3UVFWia92UE3qHb/I773zSRBE7TKSfUKhoFcc4kH7ZdbkQzznan2FFxzjpigGuRnGQ1ray6shSN57oh2J6ARMIT7H9112IQecnJ/Psa+JnBVFysX/1In5iSJ98OujxflR15YG0SQPPIzTRjSQtN33ZG8h23XTdRl3bQ/qwPL+neqBTT4abVWFoMCvyFwcKODsUWN+7/RlvTPsilahWNt5x7RraqCiKIDojybdLlAVAJ/R/CqlduJwTgKhMRMBHq678ZT1+F4YrCjXqhB876QGYPE1n07kVArJHatFRVa2np4rXdSc/JHZnXboE5xDyvp/f4AxHJ+nBPmRSBTM750XZco075EEJD0pNsAQ3KO97HhY1zVRXf7UU/HMyiO5TJcthSKafYVF9ej1o650OaQV4MeXrzpFY= 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: Function __free_pages_core() is only used in bootmem init and hot-add memory init path. Let's put it in __meminit section. Signed-off-by: Wei Yang CC: Mike Rapoport (IBM) --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9ecf99190ea2..51a47db375b6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1218,7 +1218,7 @@ static void __free_pages_ok(struct page *page, unsigned int order, __count_vm_events(PGFREE, 1 << order); } -void __free_pages_core(struct page *page, unsigned int order) +void __meminit __free_pages_core(struct page *page, unsigned int order) { unsigned int nr_pages = 1 << order; struct page *p = page; From patchwork Sat Jun 29 01:33:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13716753 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 96377C3064D for ; Sat, 29 Jun 2024 01:33:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C1F86B0098; Fri, 28 Jun 2024 21:33:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 248DA6B0099; Fri, 28 Jun 2024 21:33:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C4136B009A; Fri, 28 Jun 2024 21:33:50 -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 DB86E6B0098 for ; Fri, 28 Jun 2024 21:33:49 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5C5EC409F2 for ; Sat, 29 Jun 2024 01:33:49 +0000 (UTC) X-FDA: 82282204578.06.2954D4E Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by imf24.hostedemail.com (Postfix) with ESMTP id A080C180008 for ; Sat, 29 Jun 2024 01:33:47 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=E3iNYYro; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.167.52 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719624812; a=rsa-sha256; cv=none; b=4HgFN1942Ro0fS3LOm/unM5tCiPvOXpwTklGzYqWERqCrp/y5Nrp1lKU73kzAxXQ+2i7zq VdfOrYtPojGHriCQgyMQgbdzvWjDy+djFC5Ouji6AqjiMzxMJlmCSfj7TH71mZcysEa/yC WwzeYsmo7QGlaYyELCuR0VZXruY153I= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=E3iNYYro; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.167.52 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719624812; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=9J4Xd+IWU6L3qeE3ESnngjp/FE7dVNp2iZSoEAyz7Io=; b=ksLTUy1QiB9ro1nUWw80DVh2biR7+EBbswxEtyIfUFjv0C83d6xpi+4SLn/5jiUlyOnojB SZSLs36+mmsKz3ZiJtIhrxsIs3fk/z103UQ1opTRwxroyaucEh0GdPcT3HPU483hEy0tqL aRTn3L9i3JAoWL2M+xVl7TmT+BG7je4= Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-52e7d2278d8so1762814e87.3 for ; Fri, 28 Jun 2024 18:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719624826; x=1720229626; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=9J4Xd+IWU6L3qeE3ESnngjp/FE7dVNp2iZSoEAyz7Io=; b=E3iNYYro2VCtkqdNrKQpDWDtLEMth+mxlDInHNgLPOxr0MhONdT4ZWE6aD4CgqGetR KQkdrvSDC/TRmq3mkqIBbddQOKfOMveAaDIzQOdnwOBur98NGbEFsSgwgU+MfWViUJOl uNG6f+iOoIeZ7fUrYJzOm8m0QgLJMC3Jn+ciXUt1L71iOiaqxs1TB5M5X0evb2kB48i9 vmQcXgKd3EjMUgORzx1O+35nGT50hjDpDIqvyDK8QejXB891YYO0z44HheYAJwdscVZT XQ8CHZAZQwAyOUKFKXlNvo2wmvyagRrbiRvDPh6o9qf0LUoRRdw/Pdbuyy4OWsbv3CpT RBNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719624826; x=1720229626; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9J4Xd+IWU6L3qeE3ESnngjp/FE7dVNp2iZSoEAyz7Io=; b=WfsHGiViGI29uMLR6FnoED/KyLxjIXTTujnG+L38n/dQOGRD9L25okPPRAY6u/Usi9 qtCX9iWyKpY1f15140uzlFMVrmsEmsy+dkSd+/oUSztue/pUmaQ9cdyP0vTKo3pw39cB 2cTyo/PtCdui2a+f1bGJVoyWGphZD86m9wmrz2omvxINbRJZTcRhsCrMNZel03DuMs1k knXL7iRHAoo1dbUFewRDYyzc5eQKz5mybmJ9G/+9b1MTi4jCk36MUG/yfHTwGlrF0YxP QiEu0J/nHNbDiZW7pwRd4/BcPWCxZRKGE6epYHLcwrGCVifV5XesKx6jIH9HLCVajhVL U+hA== X-Gm-Message-State: AOJu0Yzi5t+njnq63SdhvpkuKU1xPk2R86KJ8uwlwcxGi6hoU/KkyYO/ eGzzGCO+pTadkJC/SUtJW2IXSm5Ys0l/Ys0jj/GrsiNgPS4bslREM3SdSi1b X-Google-Smtp-Source: AGHT+IGRIwbnSRhAQcJpJrzMc79H4+m0nEm8m0cyneHe+EmQcF8FznHNEN4e+NHsfTn0GPTXnI5EDQ== X-Received: by 2002:ac2:5392:0:b0:52e:76f6:aa5b with SMTP id 2adb3069b0e04-52e76f6ab43mr3050140e87.17.1719624825974; Fri, 28 Jun 2024 18:33:45 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7430367d55sm27255966b.87.2024.06.28.18.33.44 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jun 2024 18:33:44 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, rppt@kernel.org Cc: linux-mm@kvack.org, Wei Yang , David Hildenbrand Subject: [PATCH 4/4] mm/page_alloc: no need to ClearPageReserved on giving page to buddy system Date: Sat, 29 Jun 2024 01:33:22 +0000 Message-Id: <20240629013322.12364-4-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240629013322.12364-1-richard.weiyang@gmail.com> References: <20240629013322.12364-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: A080C180008 X-Stat-Signature: 8xafzett6hsbtahpsyxesqqdmjqzdpb3 X-Rspam-User: X-HE-Tag: 1719624827-316178 X-HE-Meta: U2FsdGVkX19gk5426x+LIwVG4gQMaLzL4JH2YRgrEQZxj/LsOqz/FTW1Fxu8b2H7Z7JcSKYKCHg8DGQqWgbhBPTUScqvGTIteB+U3AbOaTl3Mh2yih34zoL/TjMZwZoNyeJPBe0Ar2GXWMigyXMT1lWOOb0zm3K75YfNkdPruFI0TkZxhiqRkXuylc1GQYniF4v7rhyVk4ayN6BSgdUep+oHW3IXSoTxxeEqmctbOYVt3PtsV9N9DPETYea84wm/LJW0RPYKQ5cb17KbBpOMuXhoQRgNLAECFdTi7SOgDjRBkxmlaJb2hqa0GDOmBcXAUHnB7SuL6crIKf5dvU0d9BEwVtkEJv9MCbDc6zcj5KqQIvlJvR5Dr8W954x7nvEtkU8iJwt3Q3OUWzDbYk5CX5v3YRQ8ZyNW8mHm9QVax2dqbyA4LIX/QjElpA0P58U4t3OKhUTFEHbPxcy9SEzmhHaod4GEccUlxFfa7Gd/Df46vY4KhG+9NHDesFp9jq4diE3nK+VGK6lKTgeMEhQd+McgkElJrajYZkNP+cQ5v3H8mDQzsNSPMNHoID1U8P5gMS+ble7F91IzXkWMR2O42FhYVbHgBk229ELdupzp6MqLtsVpKuR5AG0WDzzdV2+HQs1yM2gpF6iBUO4ls49k0KgarNz3FMlZD5kg//mk/XCUAZg+9q2mSXppAnut9bND6YRJXdciXKQZy3xzVnq4EqGxRI+xf4hk+b8udUqgCbBuXk0ms7oAYZKuNFoSg8Ynm9yif5lzxTeJQzt6nJ8WPzT4u4Vimh2cAZF2bSc4sRi94bXMFKuCM2Gsl330pXyEvktZIzRvcL80Q4TyC+QOkyBE16T6Ml9VcmGlANN+ByUuDdHpggZtQ8oTRSJcL3PJ/XfJGefVu8eXtlaUkmwSEGPFLsyEcHkt5+xkpHkCRuP7V0SY/Z8z/KRRpEdVf0ACo7uC22FI5z7JDLGkHqv kFnPYYHs 8uePgRtcP6WbW3/rJSi59XNdubpjP58vVyXIhoDAc0n2tNDXn3w3NPX7KQ4uUDGsedEBOWqHOdDh3KtZUNsdJslpJ5QOsc4cs57rd+A3oLuozr6mvU+sjWYsP0vcdvMj0u7iIXMLQxIMV54KVouq0ApATEz3JOUhp0FJT5idn8uYW1K2XTHhcCnRTomgZWQnINb/yVpFYPqfykcfFQhQtJPFkIQmbvoySOfn/pC+a0olUmaattHJ0F8b1Er+NRpw1NERpNUdEtLIBzc+CcBeYiKS1OEbLogmEvDBhgzN6eXxoqaRaDsplK8WZwudNQUbkFkG1dMkTX2i75OFsBCeVlnhbKe2guDCcdc8jD4bbQoiDjGQWqQ7RKDBLMSI0T1fWD8Nx2YuU9WUHT9AWPkieZra1CrMx23BJDxMPiuq9cYz5tg3SBZfEL6mi02uq2JU9tUUk8IJRRJFdE4Bd9grLzz+6dHOyGbWNEV2exzSECt0CUOt2gr3pmmopEGtiVYyLadmkVDov7OaFWUavLlc0y13RziEEsRjtpSaTXiJJQIOXEGMc1WFdcN+IZ2eZ5kxb0uWl 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: Function __free_pages_core() is only used in the following two cases to put page to buddy system: * free bootmem * free hot-add memory After the above cleanup, there is no case to free page with PG_reserved set. Let's remove the clear operation. The page initialization time shows 6.5% faster with a 6G qemu virtual machine. Signed-off-by: Wei Yang CC: David Hildenbrand CC: Mike Rapoport (IBM) --- mm/page_alloc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 51a47db375b6..bc7316744a34 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1232,10 +1232,8 @@ void __meminit __free_pages_core(struct page *page, unsigned int order) prefetchw(p); for (loop = 0; loop < (nr_pages - 1); loop++, p++) { prefetchw(p + 1); - __ClearPageReserved(p); set_page_count(p, 0); } - __ClearPageReserved(p); set_page_count(p, 0); atomic_long_add(nr_pages, &page_zone(page)->managed_pages);