Message ID | 20230105101844.1893104-16-jthoughton@google.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 4A9FBC3DA7A for <linux-mm@archiver.kernel.org>; Thu, 5 Jan 2023 10:19:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DFD4794000C; Thu, 5 Jan 2023 05:19:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DAE00940008; Thu, 5 Jan 2023 05:19:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C770094000C; Thu, 5 Jan 2023 05:19:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B47A4940008 for <linux-mm@kvack.org>; Thu, 5 Jan 2023 05:19:19 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 968F1A0D04 for <linux-mm@kvack.org>; Thu, 5 Jan 2023 10:19:19 +0000 (UTC) X-FDA: 80320348038.20.AA3C863 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf23.hostedemail.com (Postfix) with ESMTP id 0F08E140009 for <linux-mm@kvack.org>; Thu, 5 Jan 2023 10:19:17 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=DiSQp6yj; spf=pass (imf23.hostedemail.com: domain of 3JaS2YwoKCGwTdRYeQRdYXQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--jthoughton.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3JaS2YwoKCGwTdRYeQRdYXQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672913958; 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:in-reply-to:references:references:dkim-signature; bh=xdV3IYpedDoNM7qUi7kHNJzHPxVnQ9DxeM3hKKmcY9U=; b=6xLu8EoczjSrCxfyOiziLYIsKZa8v56k93uEmZjbP3Y4zac1ezt5Louy2SGieBOW18B1yJ GYMZUqigEktQQ3o8yFL0xQaZRMOKCWqi2Gj9A3aJLiEXoje1mM0FHCesQq4IUd+7zl/XdW LITA8dlh4bCvvEcqA6rEqS14aIqYD+8= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=DiSQp6yj; spf=pass (imf23.hostedemail.com: domain of 3JaS2YwoKCGwTdRYeQRdYXQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--jthoughton.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3JaS2YwoKCGwTdRYeQRdYXQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672913958; a=rsa-sha256; cv=none; b=GKj43OAOJQU2Ws5r7qCit3Y5LkmffzdjyngMp9sdUMrJuusb20HxE653Z7fItgZHG65Dey dhNH2L6aN55cP0QT78XLUgHzYGtgTPiPK3IydAw/t3i18q6RSzm5wkQ8lozPpehrEL1cq9 IBEwDPWQ1mOrt6dGdrVzTxjHXhXZQe4= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-460ab8a327eso378495117b3.23 for <linux-mm@kvack.org>; Thu, 05 Jan 2023 02:19:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=xdV3IYpedDoNM7qUi7kHNJzHPxVnQ9DxeM3hKKmcY9U=; b=DiSQp6yj/Jffb5ePxq8rLXfWEn0QKWirG+DC/Z+7i72DYO+nh0hgIQIWulypFbtBD0 CNXALjMtPUpaNYD+K9/Wtem86znsi9S0XhhVza6MwF9b0Ah41Zx62xgpk0EqpvxL45Ez twNhGjN8owfKEsoU0pxg3/ZHYJoT3u5nVxsT0weZJKuU5bHZEEigDexGz6ip4UrCMr3u 3a/kheO+Wz2ofksSCLNRFL/BR4OqsTuwZPgS6RFEg5mlXviTOOl8DGf/P5TUOJfu8Kz5 jKgiNh/96tLer8BEZqipSxoSlnT5zdxZozrvn3a/BmqSquCXcaUJoYHENLG2wGTwjIMH H8MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xdV3IYpedDoNM7qUi7kHNJzHPxVnQ9DxeM3hKKmcY9U=; b=HkxwIxRKIEqc64n5g5HEQIiv2UyD/7i5zGidh915cugxft59kKLMiRJdQ0kQpoK7E2 VNAaYuVwjsfQnCG6NLbw10VnsNpBm4YRzbIpJXQ3qQCgRWhl/Avts+8rhJLQAQVP44Bd ZnlefDiUe3RZ1i8bDZpKvVpQT8QfABXCptu1CY9n967nsnf1DOx6FgGcfSHyvGFDVO5D pGXj+/AJi0Hc2iys8a0SsDqQhrFiD2T0BKdclsRYacFgq5jnnKZLyIcKh7juXShrYUqS VJT2/jNXpthjandcRy3drlAOltp5o9oUMYO8QloA4uy7HBfxz7H3NyVBFnTpnil1r1w0 117A== X-Gm-Message-State: AFqh2kodCuw6Ju6HQR8QtZz3RoQmQFuNTbBxLuoZ1/k9Bbr3oMljYpzh lbpvayIfD6OIfVNAEtSiZiBmPvwZqjyq0QGz X-Google-Smtp-Source: AMrXdXueaa4dFGcoO+ZQv8KF8N7hesWfET2q0B/yE9XBfhLadDTwF6Vz6PrsKAZSbr/jbmJmEVRWPYHXjsmbmqDZ X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a81:490c:0:b0:41f:702d:7883 with SMTP id w12-20020a81490c000000b0041f702d7883mr5495262ywa.22.1672913957258; Thu, 05 Jan 2023 02:19:17 -0800 (PST) Date: Thu, 5 Jan 2023 10:18:13 +0000 In-Reply-To: <20230105101844.1893104-1-jthoughton@google.com> Mime-Version: 1.0 References: <20230105101844.1893104-1-jthoughton@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230105101844.1893104-16-jthoughton@google.com> Subject: [PATCH 15/46] hugetlb: make default arch_make_huge_pte understand small mappings From: James Houghton <jthoughton@google.com> To: Mike Kravetz <mike.kravetz@oracle.com>, Muchun Song <songmuchun@bytedance.com>, Peter Xu <peterx@redhat.com> Cc: David Hildenbrand <david@redhat.com>, David Rientjes <rientjes@google.com>, Axel Rasmussen <axelrasmussen@google.com>, Mina Almasry <almasrymina@google.com>, "Zach O'Keefe" <zokeefe@google.com>, Manish Mishra <manish.mishra@nutanix.com>, Naoya Horiguchi <naoya.horiguchi@nec.com>, "Dr . David Alan Gilbert" <dgilbert@redhat.com>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, Vlastimil Babka <vbabka@suse.cz>, Baolin Wang <baolin.wang@linux.alibaba.com>, Miaohe Lin <linmiaohe@huawei.com>, Yang Shi <shy828301@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton <jthoughton@google.com> Content-Type: text/plain; charset="UTF-8" X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 0F08E140009 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ujPbmLyEUPcAjUuV1v7Ebx8QD9ydacQ7oh6l7LRoBtClgXiDMYX6uDwu2pqcZpCWoXD9TlOGc1ithMMNc4K9NXpo+x43tT1pU/Ld8VGa7ETO/jDgw1sQ4ubpRQt8bYqF9QEyEickhttaSfmVhSbD3pNo94Nd2LZGLVuSGDQeu56LkhkSozs5khbCIpU3GYWJlMDIq6emBkzA/46w45DnQIeohUysVWzRgnZf87B7QBkLQSOzDM9hwLOrTo0Zp3HPSNeoc25L+mntnk2ltcs+0QEp+nVgGZtd/3zNbKARiA4pWvX5OnquZw/PhO+3wSUxVKUp3bB714OnF3g40HC3U3jDUSLElsOzhHzC+UjLM+fj3lFV5noFGBBovW/XJhq+l0u7o1rSm/s/F2CsX/QwwPzU5AGzEZlGGbSPeow3gE+P1nWa 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> |
Series |
Based on latest mm-unstable (85b44c25cd1e).
|
expand
|
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 2fcd8f313628..b7cf45535d64 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -912,7 +912,7 @@ static inline void arch_clear_hugepage_flags(struct page *page) { } static inline pte_t arch_make_huge_pte(pte_t entry, unsigned int shift, vm_flags_t flags) { - return pte_mkhuge(entry); + return shift > PAGE_SHIFT ? pte_mkhuge(entry) : entry; } #endif
This is a simple change: don't create a "huge" PTE if we are making a regular, PAGE_SIZE PTE. All architectures that want to implement HGM likely need to be changed in a similar way if they implement their own version of arch_make_huge_pte. Signed-off-by: James Houghton <jthoughton@google.com> --- include/linux/hugetlb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)