Message ID | 20240318200404.448346-5-peterx@redhat.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 04498C54E58 for <linux-mm@archiver.kernel.org>; Mon, 18 Mar 2024 20:04:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C4466B0085; Mon, 18 Mar 2024 16:04:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 770D56B0089; Mon, 18 Mar 2024 16:04:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5ECEF6B008C; Mon, 18 Mar 2024 16:04:17 -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 485BA6B0085 for <linux-mm@kvack.org>; Mon, 18 Mar 2024 16:04:17 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 10C811608D4 for <linux-mm@kvack.org>; Mon, 18 Mar 2024 20:04:17 +0000 (UTC) X-FDA: 81911236554.03.CA92D11 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf12.hostedemail.com (Postfix) with ESMTP id E21134001F for <linux-mm@kvack.org>; Mon, 18 Mar 2024 20:04:14 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RghpMXmc; spf=pass (imf12.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710792255; 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:dkim-signature; bh=vtZJyICZEGrBJHpYWSu5beimQ7UmPGzVa4S5UCB/Dcs=; b=cJ3XgVwQ597FG7hKZyEy/wzN/cuL0W0peSyCeZcRWr8ihH1DXiEa92t+fZewVHsoiI8LD/ HUcoWvLAX7uji7Uw6rE7K4seRcSdClMCDyC68yTyAC3u187y6pcbXpGP+5YtYcdYCWWIsy nFQDmYvVzcEBMDDTHDi96bhkjoEcfLY= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RghpMXmc; spf=pass (imf12.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710792255; a=rsa-sha256; cv=none; b=S5nMHpSjcAAHQk8Qh32jqyr0L9TV4HT4J7S/SIDjUhpbirCN5XmfCJSkR4Mym+0eQnf5T/ I1GtRzMeY34S6tyFNg5h4Q32aKUxew3LdZCpD+Sb1D9iW4mBER0QrHFrDcxDiWpZ5SVFcJ gvcGDVYaclTwd0yNl1AdcqMAXy7rCz8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710792254; h=from:from: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=vtZJyICZEGrBJHpYWSu5beimQ7UmPGzVa4S5UCB/Dcs=; b=RghpMXmcmYmGS250nfwprZ5nJJJW+A0lma9Zlm8Wkgxz67MnsHnDEQA5DCMVZAJOSn/5ru 2RWU/aoearGtLy1uLhnWHbO1FOgdYkAsU0ke1dTbn1a2Efh2uHpKd7BNiInMq7HVYaLRwp jzcZz1e0Db7llGdZGFFMxEI5T0x2sdk= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-evHMpCAfNjOd-eu3Vw8pZA-1; Mon, 18 Mar 2024 16:04:13 -0400 X-MC-Unique: evHMpCAfNjOd-eu3Vw8pZA-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-430c76df729so6672541cf.0 for <linux-mm@kvack.org>; Mon, 18 Mar 2024 13:04:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710792252; x=1711397052; h=content-transfer-encoding:mime-version: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=vtZJyICZEGrBJHpYWSu5beimQ7UmPGzVa4S5UCB/Dcs=; b=vmJ9FHzDawyx1wMp2rSZ7Rq1QgJpHeeKsazZlu3CelVAJqv7IDPL+1VWa694va91yu DSOXUyfAt5So02p7nPmmhDa6EMA32gstnqxmxaQ3YyhsAiHRPDC3XBtQEn/uGT6wtPB1 9eqoAsrum6OyKE48Fj8q4NxC82RRXwdwj24Etu2ZaORd8sGO6HWPFsaTBdsguB8qzXW7 5D91RYl4m1dodWGyJo38JMFbA5hgWtztJh8INSwChFJrR636jhIUnQ0gL+r0/b5hNZa9 UN/7FwnMbA0oE9mvNmNmztCbXKGB8kh88SpBHN9k87IrY0rfvAAciJs+1YEG/xDCVYPq zxWQ== X-Forwarded-Encrypted: i=1; AJvYcCUQvE0cprbrzz3L1U/4k6fJ7MoI7jOEZfE31ymaI51ITJb3kbILNNWgjaIeVoCN02vvWWzJtbWaPGYnUdEjtUpdXoA= X-Gm-Message-State: AOJu0YwMHYBlbgO4zg5RH3Lx/xJIbJL+mrL3FVYnrCceK/4aFdvaRXQN swDlsxd/qezpNJJwkogKaIBnmGuCoVt6X04I98NEgekakCUp5xslvVtcZnNBxD3eWG2juGknXSu u808UdqJqpjTaIHFPk0PX2m5DPPPZbTpVoiU8VdXOzMhdY1tj X-Received: by 2002:a05:622a:134e:b0:430:c82f:b9ab with SMTP id w14-20020a05622a134e00b00430c82fb9abmr6625413qtk.0.1710792252328; Mon, 18 Mar 2024 13:04:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFopBSFWwBK3v15ombZ7ZQDo2UFCgzW4nradhEvm8gSdWhrm9dq3oWG6x2VBEnxvd6M1ShIXA== X-Received: by 2002:a05:622a:134e:b0:430:c82f:b9ab with SMTP id w14-20020a05622a134e00b00430c82fb9abmr6625362qtk.0.1710792251793; Mon, 18 Mar 2024 13:04:11 -0700 (PDT) Received: from x1n.. ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id hj10-20020a05622a620a00b0042ebbc1196fsm3484491qtb.87.2024.03.18.13.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 13:04:11 -0700 (PDT) From: peterx@redhat.com To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton <akpm@linux-foundation.org>, x86@kernel.org, Muchun Song <muchun.song@linux.dev>, Mike Rapoport <rppt@kernel.org>, Matthew Wilcox <willy@infradead.org>, sparclinux@vger.kernel.org, Jason Gunthorpe <jgg@nvidia.com>, linuxppc-dev@lists.ozlabs.org, Christophe Leroy <christophe.leroy@csgroup.eu>, linux-arm-kernel@lists.infradead.org, peterx@redhat.com, Naoya Horiguchi <naoya.horiguchi@nec.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com> Subject: [PATCH v2 04/14] mm/x86: Change pXd_huge() behavior to exclude swap entries Date: Mon, 18 Mar 2024 16:03:54 -0400 Message-ID: <20240318200404.448346-5-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240318200404.448346-1-peterx@redhat.com> References: <20240318200404.448346-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E21134001F X-Rspam-User: X-Stat-Signature: cnjykqf3u9dmeyr4nbseq7ocaqgszdsd X-Rspamd-Server: rspam01 X-HE-Tag: 1710792254-743348 X-HE-Meta: U2FsdGVkX1+u1kkcL4Bwx007Rz2GoKEJO+6b3tlsusB7Z2g8o3JWkhFfxtj5WuyJ1lMAGRROQbw/m52XbP0EqwXY5Gh2EOGVQNqhApzCAK7RREPrrNbcjquaPRzE+vFOxCQODF6TFpcEogsAwZzdSAaai1+LYysyKaU8vPTrK6Cs4BnQinzKFhAot5YZwz5uz5HK7syf2r9ZUBwI837SG5VXdzIjkiULoS+YlXx6x/7Wa/Yti+pBUuFByffnGE+IB1+FF5mObm0ArvOmCYRW/IdzFFu4zD9r7cD+kSnxUfFiC/TCDc5P03Oj41eVhcAo/PchAQeHawGg34BMg9y4RANQT359+LMXi5+nCD79s8qr3fmY2NPfVe4YVzh1druk48fT7Wt6sS5R4D1fCDP2Lj7RTRnX4stA+qFRLeYaC5TfQmHovarYr7PyyO0rex/6gLS0maeFco0tXUq6fPI8y24TXS51T3uiMo/cSSk3doZ0zJD8cLE+n9AjvWflqC9tdotYI5h6IyKI6pi4gX0uFTwuKkDpWrt5cyT1s/kpj61Ttzd38l0f1vKz3b8uze3hKqs/IJ0+TZz4c2mObfAO+Ww/aiQTaNBSJzfztyDn5u37XlMMfmHZd5nXT10tm5TM4T8mHwSi+I39RytwFjKMhnFaExbBsN5qi2ZPeYwWubT1utNwLfsuusbiHcC1biie95C24bb4pafyRyaAgAEezU3AbIIKUE4+7R5uVdWs/cZx2B32zvsjJW9fvRR27hFhhTBY8tPHw2rSchATFMOxpwmCRxJ98dse6wrGEKe4WyIqspZaFtqPWby0O+wKH4jWJhHRUD/W3Mbzo3heyCZ+wF05JCVj1trA+kspES2npdqz6dAf9qlB2Vj5XOBkd2oghE1H4vHxW3ozV7zrYp8cgIFNDctIWe+s1Ec9OHz2dxyUYnBWy7AIhwUuQC5lbI6b+lkXd4K/AE8mDpdmNAL cU4Gq0yB jLfZuhD9F/sg4KiL21i5rypdQCZOOBG5bruDmq2fQ5nbmk05atW0yZw8cT7TIZhjtzA8BacYyEbh1jgVShgjndtu8p1rwYzw7Sv3blS20ljnsq0y9bFA9E3frjSXLl8ZkTz+tw7tGcMt1GdXil3e6wAxa+N6YzHyB1t08KWBoJUGMAWm9006V1Fx3SXMJB+8v+3qaU8itAutLc1+k9R3jNCA5Q3OP9zLW9EonbUJ9zOC8pTOT4MMO7vomyVPfvXB6dC1To32GECm1tH1BQEILDbtfjbY65Z8XTAdpDn5czhxeX4mdfYjrQnmipg2q1r2Ne2dcbjOyXfczxYdEl8Shc6tp8kIAQMd/oq/GIJqDkMmca0Tktaqe955B3q91Y/7gwqdNF9TI8PF0SpjYQ3qZUb+GZX6bGGQE+OiRc+/x3J1vMoGuDjoPcb3Sm0/IQq+1zFLxY/Q5Fm2lfLIL/a7+X/VQDIQ+4qBoXJPdija5z2Kbm5DwifOXvQp3kMiiUXXcmUPkUq62sCSN00ATVRIsu68lMBqMz69LhIaOKCsPZFjkE+WsKqIt3ICHl5Id8kLYcf8h+Bh2Cp6h9r4vtIafScKufA== 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/treewide: Remove pXd_huge() API
|
expand
|
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c index 5804bbae4f01..8362953a24ce 100644 --- a/arch/x86/mm/hugetlbpage.c +++ b/arch/x86/mm/hugetlbpage.c @@ -20,29 +20,19 @@ #include <asm/elf.h> /* - * pmd_huge() returns 1 if @pmd is hugetlb related entry, that is normal - * hugetlb entry or non-present (migration or hwpoisoned) hugetlb entry. - * Otherwise, returns 0. + * pmd_huge() returns 1 if @pmd is hugetlb related entry. */ int pmd_huge(pmd_t pmd) { - return !pmd_none(pmd) && - (pmd_val(pmd) & (_PAGE_PRESENT|_PAGE_PSE)) != _PAGE_PRESENT; + return pmd_leaf(pmd); } /* - * pud_huge() returns 1 if @pud is hugetlb related entry, that is normal - * hugetlb entry or non-present (migration or hwpoisoned) hugetlb entry. - * Otherwise, returns 0. + * pud_huge() returns 1 if @pud is hugetlb related entry. */ int pud_huge(pud_t pud) { -#if CONFIG_PGTABLE_LEVELS > 2 - return !pud_none(pud) && - (pud_val(pud) & (_PAGE_PRESENT|_PAGE_PSE)) != _PAGE_PRESENT; -#else - return 0; -#endif + return pud_leaf(pud); } #ifdef CONFIG_HUGETLB_PAGE