From patchwork Wed Apr 3 01:32:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13614863 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 803DDC6FD1F for ; Wed, 3 Apr 2024 01:33:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2150A6B0085; Tue, 2 Apr 2024 21:32:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DE5E6B008A; Tue, 2 Apr 2024 21:32:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD6EE6B0085; Tue, 2 Apr 2024 21:32:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id BD8866B0088 for ; Tue, 2 Apr 2024 21:32:58 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 835DB140BA2 for ; Wed, 3 Apr 2024 01:32:58 +0000 (UTC) X-FDA: 81966496836.25.E26677B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 7E9CCC0014 for ; Wed, 3 Apr 2024 01:32:55 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UIyVzVU0; spf=pass (imf28.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.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=1712107975; 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: references:dkim-signature; bh=alQirahUTAy9XOHb1eUbW0PkaQ3ocBpN1TA8r3nGi4M=; b=0xPTK0G69wHZplXr6hfezLdxzFui003cE+h5NPZRe6lvULoF9/s/pVG3B7u/xsyeGrBnyr Mbm61WtEAjiWzOp2eaM5S+AWutBtBM7azE+Mtwr68OoHwHhgotirH3yi6fZmfDcEAegsF+ Alj8rqP8njLynddvDOknMZUME5zPkHo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712107975; a=rsa-sha256; cv=none; b=u0DBvnu4riE9DHFe3Zl0Hz3kXFCEzOlLRxGfnJZ9R8t0cy0ExELH9e56ufMC9EGf5QxwTE ga21qWWTSKy1INrggMA7f32OH0M2f8lfSF0y4Qnch30W+CCDNytvBKljJLqKvi3K4MSG/I AUubIrRnkAFDAo63SbpFJMlcPjFmbdo= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UIyVzVU0; spf=pass (imf28.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712107974; 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; bh=alQirahUTAy9XOHb1eUbW0PkaQ3ocBpN1TA8r3nGi4M=; b=UIyVzVU0/5sLYkhF3VlrSoVo22BQfAlynGVI1Io86QQW63iP4bMYxOkV7if9MI1hYYd0GT Bm6GKS4tLXu/ep5gXGet/SinQuVqY6JGixfzUU5OghnCpsCIG2aOnG9UeZUCvw48plYepW iUUqkEcbXhdxj5rDbSzRHSqi8Hl5YgI= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-v0AiAKc9Mg2BLOCAVPJidA-1; Tue, 02 Apr 2024 21:32:52 -0400 X-MC-Unique: v0AiAKc9Mg2BLOCAVPJidA-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-69925f44915so937206d6.1 for ; Tue, 02 Apr 2024 18:32:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712107972; x=1712712772; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=alQirahUTAy9XOHb1eUbW0PkaQ3ocBpN1TA8r3nGi4M=; b=Nzt7AbkcepAcybuCfIbC8YOyJRzeNb8N3ZGKLhZ6CDTjnO9kv9KrvMXmAeUjnDLHQO qJH0NSYm0vT9EiuFLWJGwV06fIOB0mOzMvKaZo3QL7FUjsavkbX7QpyO+wcJtaoZ/cWY tiacMBeS9poD7h/eG9c6s/H6dsIXXKdXDlzn/aFQJPlTStokecZSlM/XnhVaAvmci4y9 yjxwXJwn0mz2iL4iLFNfZ5nTU3HUTAcj4fQ2jLGbVTKMrNw2fZqi4yzVDgnLoNRs23Ys fUbeIFFIcshThU0S8U9o/XqZkY5mIZYdahv0NnfuDuYIyWLKBofivwsn3suLEpSYwGLM ilFA== X-Gm-Message-State: AOJu0YwzmGBlqMdjN3k21bQXawNN/gdFEgKSZc6qSwustZf0YOXarOy8 1dipIYQlqtrfpoac8cg9kLKi7IJida/RQ1AqOHFyQSJFnCi0AGjAcBo1VrOPvhiZSlwul4mv8Ag 1g7Z2D5h1Yfpbut9uXjwB03iMtt/1NVbOpRpXLbspiCECl51uOZfTAZKQKQO3Rk4Rb2G76BMzVt wufnN857Y0yQ+eQngNhgWO3hYgejkmpg== X-Received: by 2002:ad4:40cc:0:b0:699:278c:af6 with SMTP id x12-20020ad440cc000000b00699278c0af6mr312207qvp.6.1712107971760; Tue, 02 Apr 2024 18:32:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHzMOlQyMY3IEr2RcmrbH+njx1OvgJqSnMVNsfmQpLAp7UAnBpSBVsRsaCyba/ZRTay46pfg== X-Received: by 2002:ad4:40cc:0:b0:699:278c:af6 with SMTP id x12-20020ad440cc000000b00699278c0af6mr312183qvp.6.1712107971127; Tue, 02 Apr 2024 18:32:51 -0700 (PDT) Received: from x1n.redhat.com ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id qm18-20020a056214569200b0068ff8bda6c7sm6031687qvb.92.2024.04.02.18.32.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 18:32:50 -0700 (PDT) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Huacai Chen , peterx@redhat.com, David Hildenbrand , Jason Gunthorpe , Nathan Chancellor , Andrew Morton , Matthew Wilcox , WANG Xuerui , Ryan Roberts , loongarch@lists.linux.dev Subject: [PATCH 0/3] mm/gup: fixups for hugetlb gup rework series Date: Tue, 2 Apr 2024 21:32:46 -0400 Message-ID: <20240403013249.1418299-1-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Stat-Signature: by969anykp1jd76zpb8z3sja1fkipi8w X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 7E9CCC0014 X-Rspam-User: X-HE-Tag: 1712107975-55919 X-HE-Meta: U2FsdGVkX193ZJSO2MGmuoIHEBTKypkmZXyPkSAUztlf0d/83454WhgFqbup6Ja+5pASFt5nVnOo2AcG8yUvomHg3bp2SWnZZMVjcbFIvlcKdqODuENfkesA4ILLwe/NeH9fkpAnmNv+LWS3a5rFrmCtiHncH6QztVHvrJLgMsSEyrCRUbnuEX9mKF/ihc0BMplXNIkDZDmPJbGuV+RpqP+NQzPqIpk24OX/Idt1fzW5M+HyqCfqz9r0WjMfDr4CKHWkDdlC5916jG1X94O609NmP9Wk+4Nz9w66yLMXFpGIhF0/oHwxpZ/w42loJ8UlBa73EAbe7CWc8DUWvA/up3ptAnnocK4b3PRBYxuCV0rcDwCBjGCjxRCf94oqLDS1Ztfx1H7sMItXbMacPZHhQKJ9wQaWftwf4YBmKKdorRBn7cKr0huUgBAR9J/pm6jNlhZn4JAmcndpoD5VdqWnNlihrZABG85HTQlTy2y9epWcgMsgcPf0kLbe5CRp9aQKypK/SW1uQYHx68Y+H9FwS3FbhfWgf+VHiKyjqtED29/fp1oih99+vJut7EZKd/PFinZ0cXW0E4qIVCked3d/1yaLstq3qz+Y1egEIEmThZgNOgQYUEPIl4zbiDpbEQU+5OnzCMv+S9kOAXR6mYb5q/D8NODmPgsMGfEyLO7igHnckSmABfvgnLQDIzIyRbxkrZH0hc4ZhVExxF04z7eglIJTWg0F7AGadiKFKhfKVHMjfjO5Zq6IdvHbHO4caZX2SN2c7QQYMmTsZHLdinfksHrpFDuvSJ0DIJl5/WUWCcgiipj+Env3alEK6Dfaqm+TiYcKInoBM4UQXHHveeZ2XVEC6Enn16GzqvN/bRbKRP07OWqirl9I9IB6+YDNt/cg9cDrBSPo6L6YkABRtIGkYxU9/2uXsc2iV7ni1tz0qQv7eRDvM0gj4TgxABiWH1hL7AzZsJilPEhS6W7FHYK RlHff7JO TzVFfmjU3iyvJMzeGWxc/Dxg/9N5Ju+FtDmUoH0gwHd9F2pIruMk+QId2AGeFH+yInrEyFnbk/hqeeGpcTFPZwO7KrA== 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: From: Peter Xu Hi, This is a small patchset that will fix two known issues that got reported today on the previous hugetlb unification series on slow gup [1]. The first issue was reported by Ryan Roberts [2] on a test failure over gup_longterm. Patch 1-2 should fix it. Tested with 32MB hugepages on arm64 VM. The second issue was reported by Nathan Chancellor [3] on a build issue over loongson's defconfig (loongson3_defconfig). It can be easily reproduced with my own build setup [4], while patch 3 fixes it, and should hopefully fix similar archs where pud_pfn() is not defined even if pud_leaf() can return true. For the 2nd issue, it's debatable whether it's an arch issue, because logically speaking pud_pfn() and pud_leaf() should either be both defined or both not. But since the current fix will be the simplest and still safe (I at least checked loongarch doesn't support either pud dax or pud hugetlb), I think we can consider having this to unbreak the build first, assuming this could also happen to other archs. One note is that the last 2 patches should be squashed into corresponding patch, while the 1st patch should be kept standalone. Thanks, [1] https://lore.kernel.org/r/20240327152332.950956-1-peterx@redhat.com [2] https://lore.kernel.org/r/adfdd89b-ee56-4758-836e-c66a0be7de25@arm.com [3] https://lore.kernel.org/r/ZgyKLLVZ4vN56uZE@x1n [4] https://gitlab.com/peterx/lkb-harness/-/blob/main/config.json?ref_type=heads#L32 Peter Xu (3): mm: Allow anon exclusive check over hugetlb tail pages fixup! mm/gup: handle huge pmd for follow_pmd_mask() fixup! mm/arch: provide pud_pfn() fallback include/linux/page-flags.h | 8 +++++++- include/linux/pgtable.h | 6 +++++- mm/gup.c | 3 --- mm/internal.h | 10 ---------- 4 files changed, 12 insertions(+), 15 deletions(-) Tested-by: Ryan Roberts