Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp201520lqb; Thu, 23 May 2024 15:38:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjVB3FRa+HKQoT7PNJabeyvanMXj+ZwjPszOJkQ5O45kfuJ8KrEWxoXETauh2CvBW8d+aXMv+2FFrBK9aUoHQk4Ge373lU0fUG9a6S9A== X-Google-Smtp-Source: AGHT+IGBlRW5ARDLACARH11SkCuVVbX5piSZ+Bh0gJzhhk4y55Wl3MYTHpGPVbEVhNIDuuwvFT/Q X-Received: by 2002:a05:6a00:1d8d:b0:6ed:5f64:2fef with SMTP id d2e1a72fcca58-6f8f34ad015mr705783b3a.17.1716503880696; Thu, 23 May 2024 15:38:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716503880; cv=pass; d=google.com; s=arc-20160816; b=iAVtBNznCGcRyrSYaDmhfAk6Paw8Kys+s6TFLGtt5rFKzS2LDosXwkk+FILQLncskP V8Asrfz3OKYf/g2wrRkAYZ+rpTsIU8vFc6wU61LlQyRgIqnzzn6DYMulzPIhsENv+Sv5 7TyfLvG5/Eu4r0ccHgnJDCxGFWIf8szezN8wGRaqCAzxgCwPfQrZSBHd64CNqHIHZJYh SMYfd+VWRBNpgolM0vjg9MVFtJxAe/1KulNiw++4J44eZhvysnQ1yOxPw+pAzWSF/ag0 vpVYlaN1znISExM9RSBgLmObpLZz/jgF7OWAos6maN8msX5FmfydSru94zYGFxeonYJn JZjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=oIlPcbsczvmDF2ZQi1MgKZZe6E4/uUO2KRutECj88+g=; fh=jUtN+1ESL/N4h95/5AHmlKKW4T8wlnp3tVxFGEqGJLo=; b=0KzxxuOPdcvY+qU0rDzD+jIAzoPThXVfwYtFHaV1CVelnK6310MfghxqW6RYABLbTD F48HM8KS+1eJuRU4Cf26IK+9jWIOZHqq+LF98r4Nst8/ucigKaXQX+efsYLnaC1WTGjM yInTY5d0YocXkm1rI+yWyiNxZTs/Ti+kJ+7LtDfvqtYSb+oVJHCi0jUz4qYwKe34WjDp MHsSzwAtLzSZRqq+bdr1KMgZLdeUqGxmhKJME0UvY/LA3mnxnCYe+8PsfnSD0pRwuEES 8Nr/65pachaj5dzOY1qUt3EkAHWyGt9DKB95rxjfUr0ns5W2hZ7K61gsE35z4eI8PMZq VvZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Os5JHx3z; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-188079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fd4d5b26si197203b3a.246.2024.05.23.15.38.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 15:38:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Os5JHx3z; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-188079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 45B43285B4D for ; Thu, 23 May 2024 22:38:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCAEF128365; Thu, 23 May 2024 22:37:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Os5JHx3z" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 379F8101E2 for ; Thu, 23 May 2024 22:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716503874; cv=none; b=f3bV68xSwJqm+5XJom8HzRJ/0uv46DEiMczf4tX1x5ICHzCkz1P+AYmRa2Rj7S0g12pE4ScgaWhmQwZZAIMf8OlzNdMyBEg4qQtjpgjXiWumAZLpn39jk+EMvEfXks8QwmwzXEuPcsutk72VyznGbuocS1phSFU2k69oOMEJgmE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716503874; c=relaxed/simple; bh=o7KSIBRv2vAoFHVVANgtYL179nAkdwdUTEtKFYiwJWQ=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=se/9joADd9Nemxp/obo+XbE3CDZ0JS2UULjn9rh+6kiaunDg3kb1PJi9Jp9N7xqXfb2+VibxzEtDlnadp1l2xwdhO51xqALkWfYoJ3gyo0srhrsnYoYogID8usw2mazHrneR9/6aTb4dvK2YyVYxf/X+fSMmBFkszhe7C29aHjw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Os5JHx3z; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716503870; 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=Os5JHx3z+KKNXaDjBwurrE7XOcV3DotwL1yjIVbHhdVRfZqnY34Bxph1W8x/EK09rGaWAX GwNAcv0n4lSkNhlx+5RwR0ERboPmTkPQZtecqgXeo5YGGBI/8K2fLnPH+kD2IgHLhUXqg+ r7VXBq4HVpNGdkWymV/+H4cQSW/58Mc= 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-111-pzQmWWPqO4CJiSbNktzD3w-1; Thu, 23 May 2024 18:37:49 -0400 X-MC-Unique: pzQmWWPqO4CJiSbNktzD3w-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6ab871c215fso1839626d6.3 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=Xf3R4nrbLue79/mTKqZ2IzWwdemQ0PpSELlhyVP5jg0z6dusNghXM2hbtTSwiGUkC3 7sVFZVeS0etpWJFV6UwU/jys0NGoWi3M6sQv9LdUU1R19k3PQ2ta7gBSr9ZertFTDxvq hobDDxENhHyUWWPS6hyR8mvwHvnV/mYVmXqj1XlkEpLzlvZpwHx9n0GkZUDgi7UJP+TY lQn2EdbogCQaIWkLoAmD7DlvRMTp07AHEdaAA6UVOWt7OuqcnS46pwSzYplOQPAW4oCX 4hab4R2YGf/Ra5QNqEhTyGCks85BxQs07V5FrRDiJEYOsxYwEJbPKgN1V/u21fc87lV2 aBXQ== X-Forwarded-Encrypted: i=1; AJvYcCU2U/KUlOCcUP5L4XDKTbfIckvmKcTlI57fFOpdCyANM03OQ626bOgPooQLctZmkGF7j0OnDh6dkoywCs1sbi64udHNsClNrcmFHty1 X-Gm-Message-State: AOJu0Yy8VEv8N4yIxjilXIo5WkeLugnEbyXKR5HveifZiX5mHl2Trtne fM+4a2w++TQmj9EZLOxnKWHEwIfqrv+fVkPZ2h1hKr7m2gFxvvf9gU8qOh1+emLTPLK2jFi2wAi TtKnOfVPZ7L0gsLKRdpG9cFgjZqIoM3hQy/nkyijkosicCzQwH4F3zfFW49JT3g== X-Received: by 2002:ac8:5a81:0:b0:43a:b82a:5571 with SMTP id d75a77b69052e-43fb0f6977fmr4511991cf.6.1716503868842; Thu, 23 May 2024 15:37:48 -0700 (PDT) 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 Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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(-) -- 2.45.0