From patchwork Thu Apr 8 19:15:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zack Rusin X-Patchwork-Id: 12192367 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09A10C433ED for ; Thu, 8 Apr 2021 19:15:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 614716113D for ; Thu, 8 Apr 2021 19:15:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 614716113D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vmware.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CEB726B0036; Thu, 8 Apr 2021 15:15:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C73986B006C; Thu, 8 Apr 2021 15:15:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC6076B006E; Thu, 8 Apr 2021 15:15:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0088.hostedemail.com [216.40.44.88]) by kanga.kvack.org (Postfix) with ESMTP id 8B0716B0036 for ; Thu, 8 Apr 2021 15:15:32 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 45D58824805A for ; Thu, 8 Apr 2021 19:15:32 +0000 (UTC) X-FDA: 78010153704.16.806892B Received: from EX13-EDG-OU-002.vmware.com (ex13-edg-ou-002.vmware.com [208.91.0.190]) by imf13.hostedemail.com (Postfix) with ESMTP id 94328E00011B for ; Thu, 8 Apr 2021 19:15:29 +0000 (UTC) Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Thu, 8 Apr 2021 12:15:26 -0700 Received: from vertex.vmware.com (unknown [10.16.120.5]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id B9945211E8; Thu, 8 Apr 2021 12:15:29 -0700 (PDT) From: Zack Rusin To: CC: Andrew Morton , =?utf-8?q?Thomas_Hellstr?= =?utf-8?q?=C3=B6m?= , Subject: [PATCH] mm/mapping_dirty_helpers: Guard hugepage pud's usage Date: Thu, 8 Apr 2021 15:15:29 -0400 Message-ID: <20210408191529.677958-1-zackr@vmware.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-002.vmware.com: zackr@vmware.com does not designate permitted sender hosts) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 94328E00011B X-Stat-Signature: t46h3jhy6sspw5jnk7biok7cbqp8mogt Received-SPF: none (vmware.com>: No applicable sender policy available) receiver=imf13; identity=mailfrom; envelope-from=""; helo=EX13-EDG-OU-002.vmware.com; client-ip=208.91.0.190 X-HE-DKIM-Result: none/none X-HE-Tag: 1617909329-591822 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: Lets make sure we don't use pud hugepage helpers on architectures which do not support it. This fixes the code on arm64. Signed-off-by: Zack Rusin Cc: Andrew Morton Cc: Thomas Hellström (Intel) Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Thomas Hellström (Intel) --- mm/mapping_dirty_helpers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mapping_dirty_helpers.c b/mm/mapping_dirty_helpers.c index b59054ef2e10..b890854ec761 100644 --- a/mm/mapping_dirty_helpers.c +++ b/mm/mapping_dirty_helpers.c @@ -165,10 +165,12 @@ static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end, return 0; } +#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD /* Huge pud */ walk->action = ACTION_CONTINUE; if (pud_trans_huge(pudval) || pud_devmap(pudval)) WARN_ON(pud_write(pudval) || pud_dirty(pudval)); +#endif return 0; }