From patchwork Fri Jun 9 23:44:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 13274632 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 47F06C7EE29 for ; Fri, 9 Jun 2023 23:44:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7752C6B0072; Fri, 9 Jun 2023 19:44:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 727706B0074; Fri, 9 Jun 2023 19:44:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5ECE78E0002; Fri, 9 Jun 2023 19:44:51 -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 4DF046B0072 for ; Fri, 9 Jun 2023 19:44:51 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DF1DB1A03C0 for ; Fri, 9 Jun 2023 23:44:50 +0000 (UTC) X-FDA: 80884841940.13.2D171DD Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf18.hostedemail.com (Postfix) with ESMTP id 0B2611C000A for ; Fri, 9 Jun 2023 23:44:48 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=FCP0fOyz; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf18.hostedemail.com: domain of 3cLmDZAwKCB0G67L3NEGB7KL9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--ndesaulniers.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3cLmDZAwKCB0G67L3NEGB7KL9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--ndesaulniers.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686354289; a=rsa-sha256; cv=none; b=cBt0suOrbYQHupJqh6eftbGYu4TsAUeRAFEeh1Rrq5a9czfJWZGjzeM4lT0EKVqii1ZCZo ksQWiL0L4LBVtKyaNT/VMUbk5uo4Ct14UYmI+08A2msGUtYyHTE6CkwZMAoG8cFOzVmfKc UzTbNQe7f8wJE2a9iCh+0cP1Ve+Pct4= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=FCP0fOyz; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf18.hostedemail.com: domain of 3cLmDZAwKCB0G67L3NEGB7KL9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--ndesaulniers.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3cLmDZAwKCB0G67L3NEGB7KL9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--ndesaulniers.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686354289; 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:in-reply-to: references:dkim-signature; bh=Vquh/FHEiTi4dfmwC93Zb1HN75IHvU0zO7o9cBuEMsA=; b=bfQo4/e2DiBpUf4xofU7bIs0VH+UO6tJDuK0ySxpImfMggxAJtfjKp8RKzYuG1Ui8rMUic fSdVIHnobsVE1orcvOlMn183Zw6Pz8MFbmE+9gb6AJbp0ZDlhL77BKeLxyKxOSfk/ra7qH cCXQX5sr9DAAVix76oO/daankAOjJic= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-561eb6c66f6so32885167b3.0 for ; Fri, 09 Jun 2023 16:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686354288; x=1688946288; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Vquh/FHEiTi4dfmwC93Zb1HN75IHvU0zO7o9cBuEMsA=; b=FCP0fOyzN9/3Ga8MAUupyeO/SBcmgO+H3658UtCYXVKdPWWl8DD5eqYsRehY2WKGf+ AXBmBbUYWO2XvyYtM366DaHsG8JhaRe7LePLo3G06uvsAXLvJ0tUm+IWfyoNxin/VZ/X w6/1984Hd54rpFawN2H6XGIYUwMA38ZElwNNKPqd5hxVlqLajaHoK4xewnINgAySx/wY mP4GqdGEzRTqqrLK64yKC0vJwG6iLnLd3TJQhzKumTuSg5SWnFo7YDVmJDRN1anzpfzK 8NYiQQiz5PCqhobM1uRPdg+gdm54Q1fnuOsqNRieBNINyoaZ23N1tcsff1MxS9XaETCk p5Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686354288; x=1688946288; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Vquh/FHEiTi4dfmwC93Zb1HN75IHvU0zO7o9cBuEMsA=; b=KPEJIw+Nnw8j/kQbs19fTFmX463Xp5SiZYhCDpvqhTg6u5JBIUG0BOsXBHobXUq++v Zv4riObZZsJnamN/a/IY7hXNd5HHVK3U4c8lZp7v1Y89uQv0pzKaB8RHLSVDH2JgLFjp DsYuCzpSvwzd7rRkySxqFiCzEMoIRc+cJ9kI7dsVyounUUo9tKohBBS6FJdo7jwvmM6z JEvyZ5+zkeZITRH+0GtjgxkL1hahPR+ONAUnnB5+LO1gZfMcbVc7QmrpPU71o21CT34R hM7u9gqUedz+rOH6diLlafRD1R+aSe9AoHAYlqHnVr+HmLuUO/gMf/0kNZ9vKbi7QTcd GJTg== X-Gm-Message-State: AC+VfDySayrFLCD9ksY+2xOwAyxTe3QSqFBxeCi79cbH3uNMEYsK0uak anGtA4QxnYZDAJc1z4lSegIfR/tdoYEaOY8MrOA= X-Google-Smtp-Source: ACHHUZ5pDeP3eqZoDjQhSM9IDzK2EOAvUdHuzW7pPGye9KkHXA+NIDnSXfQQMQTdo2fACqri4pujW9SgulIHDBOG1d4= X-Received: from ndesaulniers-desktop.svl.corp.google.com ([2620:15c:2d1:203:1bbc:33a1:472f:b279]) (user=ndesaulniers job=sendgmr) by 2002:a81:ef0a:0:b0:56c:e0c5:de88 with SMTP id o10-20020a81ef0a000000b0056ce0c5de88mr507827ywm.1.1686354288039; Fri, 09 Jun 2023 16:44:48 -0700 (PDT) Date: Fri, 09 Jun 2023 16:44:45 -0700 Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAGy5g2QC/x2NQQrCQBAEvxLm7MKYFTV+RTzMxjY7iGuYUQmE/ D0bj0V10TM5TOF0aWYy/NT1XSrsdw31WcqAoPfK1HIb+chdeObvgFGq4A4SD5zi6Qyq+ySOkEx Kn7fiJf6BbWI0PHT6n1xvy7IC0ZCYtnQAAAA= X-Developer-Key: i=ndesaulniers@google.com; a=ed25519; pk=UIrHvErwpgNbhCkRZAYSX0CFd/XFEwqX3D0xqtqjNug= X-Developer-Signature: v=1; a=ed25519-sha256; t=1686354286; l=960; i=ndesaulniers@google.com; s=20220923; h=from:subject:message-id; bh=jjBejqM3KHdCEAqZe3eEIdjesYfxVlFu8f+bbwqWVDI=; b=6LwADhRYgxCHpTWgXm6Vbi4BQlrA1hf/HNYYJW3SMkt3KXdweCywwNx5/pdRD/qfEksCXWAAT G5iOr9EpETGAv/i6LNd+BY7ZrE9IrbFBKWN19Q46iqvYeTEpOpzOY1f X-Mailer: b4 0.12.0 Message-ID: <20230609-khugepage-v1-1-dad4e8382298@google.com> Subject: [PATCH] mm/khugepaged: use DEFINE_READ_MOSTLY_HASHTABLE macro From: ndesaulniers@google.com To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Nick Desaulniers X-Rspam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bnzeot G+xkyfEL lYaPcmR/KkfGVkXkbuRHgH8DkpU6+KNUNdQJyCBq6iSc8+4hLcsR5MMp4vCKElVBH0UnKKmOcI6IcGZVq+2wAgJm1E2y+MKtsp8SeTVIsYL3i91GpWm/t66ojKAEFC643/2/F7xv3/yvHbVHJ6uIwCcsxZIU/usBrP6jtin2xhT8Dc12E9HJpDMaFHRgNQ5s/FQG2g0GL6/GCxopGxQf3xjZ63cCCkKkGyhxw/wpHXCtFc0e/T113H+wL6QKlXQIfbZp8M//TTQnJRBy21zQ/jn4QTNNk3QNfy3bcscPTwhqLX97xXmB7EysT8loZk7c7t1M6pBBDD7rakxlI8dC3J0HQ7J6lwa6vLQugyDVFh70F5FMBo0i7W5WmqDfUIeauvgCC982/I9Mm4jWABTxJm0BuGPCCUZug614lQxd5EToFH+ijOEh2PpMBrK41tY6a1lSIm1gQYxS3NCcDTORdN7sG8rKV5WVea9DfHmGoixY7FWRRu3o0L6yEf0Jf3ylicoU5xSucMnSUdEV+q1GiyY47jYWkO0hwRqmS6kxuL6NmH+ygt1q9ZKmd9wICMCsDsFc13WAzQsAvMhEje3tYo13hcshqODV6htuUVDTlXNKSsVNZX/QeIwGM+4EL7ACxvkgLKMHX5H+XBOIBeYIxqWibcnZDYDV9XOQDiHGiSue6DbmCUK6CwuwilIAyn8qqH9zH X-Bogosity: Ham, tests=bogofilter, spamicity=0.000082, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: These are equivalent, but DEFINE_READ_MOSTLY_HASHTABLE exists to define a hashtable in the .data..read_mostly section. Signed-off-by: Nick Desaulniers Reviewed-by: Yang Shi --- mm/khugepaged.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 64569520920a3ca5d456ddd9f4f95fc6ea9b8b45 change-id: 20230609-khugepage-09ea340b378e Best regards, diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 6b9d39d65b73..e7dc49214413 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -88,7 +88,7 @@ static unsigned int khugepaged_max_ptes_swap __read_mostly; static unsigned int khugepaged_max_ptes_shared __read_mostly; #define MM_SLOTS_HASH_BITS 10 -static __read_mostly DEFINE_HASHTABLE(mm_slots_hash, MM_SLOTS_HASH_BITS); +static DEFINE_READ_MOSTLY_HASHTABLE(mm_slots_hash, MM_SLOTS_HASH_BITS); static struct kmem_cache *mm_slot_cache __read_mostly;