From patchwork Thu May 23 22:37:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13672344 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 1364AC25B75 for ; Thu, 23 May 2024 22:37:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 542A56B008C; Thu, 23 May 2024 18:37:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4F3726B0092; Thu, 23 May 2024 18:37:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 394746B0093; Thu, 23 May 2024 18:37:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1A20B6B008C for ; Thu, 23 May 2024 18:37:54 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id BEB22A05BE for ; Thu, 23 May 2024 22:37:53 +0000 (UTC) X-FDA: 82151124426.15.B14E5A7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id B49A5140005 for ; Thu, 23 May 2024 22:37:51 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NdcCgkG1; spf=pass (imf26.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716503871; a=rsa-sha256; cv=none; b=uuCoL9MrnTTmQS2YbCrAO9X8zVLuCuy2EyfsyrXzxJ6pWtxQOp+B/LLFaEJ12K/CBZz3CG QaC1mdARhqTipfASYmjPZf78rAdoC55IoFqYiw+TmWYG/slXlas6U+NbSiYp57ZbPol5Vu lJ+a419/zGN86JyMG7Ro4bqUGBUSExE= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NdcCgkG1; spf=pass (imf26.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=1716503871; 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=oIlPcbsczvmDF2ZQi1MgKZZe6E4/uUO2KRutECj88+g=; b=U9xXrkRiYGNjRPhUDOUV68sR7aXg118tUmS7lsa4ajSw1ddsgPEdcqf5WQbwSbOWcgxUhD phUfdgOqPj+yCHcH0wGjLjZcXsknNIfcF+tfz0lTI+197NA/1kZa5il5RC7zGv5Kqvoepn OStMHE4cT8tb9WCEWbSwhm4GMQr6Fo4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716503871; 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=oIlPcbsczvmDF2ZQi1MgKZZe6E4/uUO2KRutECj88+g=; b=NdcCgkG1bgyPYSf1INqgh4r/cEuIu8rbYWl19c7docLKDr+iQ7NDUvZYOoQEJCYaIC++b8 BjPTnfSuQA1rW89e/JQFQtx4LqDHQ57R8fABcjlYd73m6DpKuWL+q8ECHQHStK6gL14P/n bEYk1g003kPylN/IGV43KTFv2xyLKq8= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-428-x65VMXx3PEaurWle-A9NWQ-1; Thu, 23 May 2024 18:37:49 -0400 X-MC-Unique: x65VMXx3PEaurWle-A9NWQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6a358dbd9d1so1765096d6.2 for ; Thu, 23 May 2024 15:37:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716503869; x=1717108669; 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=oIlPcbsczvmDF2ZQi1MgKZZe6E4/uUO2KRutECj88+g=; b=k9kPEHBLFyVsB3Dg/KZ2RdSfAA0qdFIo0v7VqQNNinVPiHgtMzvdHvtekjznIAcjTx ubfNhdfHOHrQiMDizUE0xrZcuBqpUwZx1RcECOSm45xL82wnRVPEfJhvkBurIJWZAKBl LAQqdKmbLLTnHXV6JOBNVc+rHk0WQnsLMr5OJaO0nbQp6gVFu+59OFqDZu5m54KB6/5k uMbBvJMT6U0rM3/NWVMwieDO9u0N7cBc5VHJLhq8ZsKwAMaDpGyI9kUgL71P0uPsoL07 BPwU1DAXdnB8zxm730B/+P2osv2jxuA+C7eYkEgmfou+xc869SRwAULOxr2JEuh4HMc9 SazA== X-Gm-Message-State: AOJu0YyP9oKKWiQpp3a02yxGBuJvexvMZIH/ifsXV+AV+mkvmjlYOHvp BuG8nJ4dXnj/h8KVmO0vKMNzKLH7XDb8EujAeczWDzJHO9wu9bToTaD46L6Ng1PebDfccrz5no+ BQwQ+FgKzlRub5mS9Ym8bV+yQn4f4fP5t1SXa4nzF4GQ3zUEM+8X25jXx7vXEUhG3jB/Zim2LuN zpM6dE+XKc0aenQ1oPCzcOF+cCVy0Aag== X-Received: by 2002:ac8:5a81:0:b0:43a:b82a:5571 with SMTP id d75a77b69052e-43fb0f6977fmr4512071cf.6.1716503868916; Thu, 23 May 2024 15:37:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRw2DyGxB9A9IHEBFhtCHPlFJDYbxS4anIF67dyb8rs32n4ryGgsjYN9nJW93TLLvOwIC9qQ== X-Received: by 2002:ac8:5a81:0:b0:43a:b82a:5571 with SMTP id d75a77b69052e-43fb0f6977fmr4511561cf.6.1716503868157; Thu, 23 May 2024 15:37:48 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-43fb18af1d2sm1066701cf.65.2024.05.23.15.37.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 15:37:47 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Jason Gunthorpe , Andrew Morton , Al Viro , Dave Hansen , Andy Lutomirski , Matthew Wilcox , peterx@redhat.com, Dan Williams , "Kirill A . Shutemov" , Mike Rapoport , Ingo Molnar , Michal Hocko , Alex Williamson , Peter Zijlstra , Suren Baghdasaryan , Borislav Petkov , x86@kernel.org Subject: [PATCH RFC 0/2] mm/x86/pat: Fix two possible issues Date: Thu, 23 May 2024 18:37:43 -0400 Message-ID: <20240523223745.395337-1-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: B49A5140005 X-Stat-Signature: sa8qfz5b8m68tt1e9yz69i5zz6tkhe9x X-HE-Tag: 1716503871-707856 X-HE-Meta: U2FsdGVkX18AWAob/Z3kAiNldm+/QS8g/lvRx6oGBhi6OSzCxtdzI8LWm7XFxxHQLAAqU94KANcM2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OFUAz73/5fP4PSFp7cQDJV3pNruwmGNnzsjns95XUt3UESvRQO8R/3IRAV8AuD9sPFzHUYPttKsKcDIBOk22o6iD+68lz6/lSAYSaEoQ3tVSjYNnGHx2YfDW6oW92OPRyhEq96a1OcGC38RI6AOVBviiofXO1hbkE714dnNCwo1u+6B11XfoUXA0fg3FQ5BKd57xyuPYmxhtaPc0ta/FKZsANdk45TpLbCBN/gh6UAfDGyrE/s5qv25k2w9RLMK2B6/ 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: I'm recently looking at the possibility of mapping PCIe large bars to use huge mappings (just like thp or hugetlb). Then I noticed these only when reading the code. I don't think I'm familiar enough with the whole PAT system, however I figured I should post them out to collect some comments, hencing marking this small series as RFC. Please feel free to have a look at each of them; I've put more words in the commit message than here, as the two issues are not related. Any comments are welcomed. Thanks, Peter Xu (2): mm/x86/pat: Only untrack the pfn range if unmap region mm/x86/pat: Do proper PAT bit shift for large mappings mm/huge_memory.c | 4 ++-- mm/memory.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-)