From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B84DC5AD49 for ; Tue, 3 Jun 2025 13:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UoX6ZYAbWcKDR6KFcgyyRoqI5kTXzqc7rOw8qvSUCMg=; b=kqeQgDyU5wCypnssViHNPAYJFy ZnkczD5hnStSqDMsZbyyDRkpvfhO95No3VuYYc2D2sVof57pVog1GiGLPENJ/RU2VGwMd97CANBLt GsWHmeGX8mp1hCLY2mT++pSLe69PDLVk++aZkR+zJivKVXzRFyW+B0JeOd9mP/6j+edVXZkHPDkN6 fLtyE1t3C8pA6QoyA/d75yD2nQTDyX4Qoqf/OLwDqs0aD0RbH6WGK5V6TzJT4MWQYtm0/65z2JB3f kJHmkui4NdsWZU8QOViXddpnNprDChRkE90zO7JM95t1su7oHFTAMGFU3SZYhVtXMj2fBxgAb+weZ wQpfPB0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uMRvT-0000000B4bQ-3SN7; Tue, 03 Jun 2025 13:43:35 +0000 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uMRpm-0000000B3g2-3KhQ for linux-arm-kernel@lists.infradead.org; Tue, 03 Jun 2025 13:37:44 +0000 Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-4a5a196f057so5698471cf.3 for ; Tue, 03 Jun 2025 06:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1748957861; x=1749562661; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UoX6ZYAbWcKDR6KFcgyyRoqI5kTXzqc7rOw8qvSUCMg=; b=IOWkGIyApe4s8HuMFWOVTaqGO/1SHICkDPjfmBa0gYgJR1gdN4sg+62+7eBqtdtaXI K+OeSjhVCYLmnnPPl2OcxKctIobxaDKsfpl5m6SG8nU1SPIKI2vwG8u41myq6F/uN145 NyPx7O/8ZjWUhbS1U8yu7+qyLE3W6FQ2dYoN87+3PE6+/6aikbm0a27c/6fM4Z+7ZK29 h5J8OsxBLb5k1frhDECsCt30E2fIFF8jaUlHVeNbYKVrrgs36wa47/SF1tkC9c4O8p6q rYHeyqiZZb7PaBhR4bIL0w/J7b92C7KMEH/n0+Cont34ue8St5KnFLKyvcI5LP2Ej8P9 SBsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748957861; x=1749562661; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UoX6ZYAbWcKDR6KFcgyyRoqI5kTXzqc7rOw8qvSUCMg=; b=bQ+Y/2UbmkFC7wE1zE6Wgf8tvLCwVgQRNuzqzATY21Nh4XJonsqDKwnQsRdXzWbSXN VyNcC9/nKJsJkJC4dHlKf2JY2GboLF8Aq89C62nUJ/lrYD5TJtLTOGa7b3UgxRgylSIc UwBEwor3T+jQS108z4XHIB1SCDdixCt+xJFnx9nTBnIS0Z7VTDxzXiKyB/huu8D3Vwf0 n1CcE3PRssSFBEoI6RaISr2zKF/Mem1VWFTM96JmQrzi9MmM7Di18k2geEcFWNz6ZhRm O2nK1BPI15e7ut6xo6T0vXPEO8pudr0BEMt6hmpwDP4op4RhvB40kI/Ry+OZr8EpMZUd zB1Q== X-Forwarded-Encrypted: i=1; AJvYcCVZ5nj73HZS5fWSJ3wSJonnTb7BQHFhiH6A6O4a3+Zy7WRtQM9KzBm4RZ4/WX7Yq3ah14IyGhHTuzcT7OcalPWN@lists.infradead.org X-Gm-Message-State: AOJu0YwIkODGT3MOr+6C5iHdvw/DslJBivfkvO79uF9aR3pyD2FjtMBK c/HUyug6My0yDt4GzUiF5sSvXZXV26a1yyc2hD09//abNpEFLJGNlKZQgGYecalgC8Y= X-Gm-Gg: ASbGncuAmayhTIlK6na6ZHb2P02mOey5H5UFPQ8U5NKE5NRX8xUMwzGdK68YKXrHseE +M1Ss97HuKkJmEiaRDIF7I4TYgjDCfPZuAlQUEHiSjCVY233yLb+Ey5z651fP5n3QNYTpiq9lDf 49eBD9V/Cn9wGwERC/P0iowUJOOBkxw/+bYpj/PYOEwAoYdDPosWIWaz1Lin4NjgRuiX9tl5VgV i7lwf7yLfgMDel7YnyXzcUT/eMz9UrN427NXG7Pv7fwPvWVNf2JWPY9A91/fvG+C9hHVtJopSyw REqGVXKCks91Y6nvzChYuVSBw0Sr/TtB4rd163Mgd09Q8fOA7Srxq1dRJJgv5nFh1Db0sNRp78s iSAc6/IWGojSpBWtRslh28GZXlNXuGui1DUtIGw== X-Google-Smtp-Source: AGHT+IHIja21FGplZEuqybwyfzBxoI5k6ggct08qhelvg2n2Sr3vDQGi+qZrCCr84f/KmAHse8r0Yw== X-Received: by 2002:a05:622a:4c16:b0:4a4:2e99:3a92 with SMTP id d75a77b69052e-4a443f2d1a2mr265367291cf.38.1748957861491; Tue, 03 Jun 2025 06:37:41 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-167-56-70.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.167.56.70]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4a435a36e1bsm73924021cf.62.2025.06.03.06.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jun 2025 06:37:40 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1uMRpk-00000001h5v-1tYD; Tue, 03 Jun 2025 10:37:40 -0300 Date: Tue, 3 Jun 2025 10:37:40 -0300 From: Jason Gunthorpe To: Alistair Popple Cc: linux-mm@kvack.org, gerald.schaefer@linux.ibm.com, dan.j.williams@intel.com, willy@infradead.org, david@redhat.com, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, zhang.lyra@gmail.com, debug@rivosinc.com, bjorn@kernel.org, balbirs@nvidia.com, lorenzo.stoakes@oracle.com, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-cxl@vger.kernel.org, dri-devel@lists.freedesktop.org, John@groves.net Subject: Re: [PATCH 04/12] mm: Convert vmf_insert_mixed() from using pte_devmap to pte_special Message-ID: <20250603133740.GE386142@ziepe.ca> References: <171c8ae407198160c434797a96fe56d837cdc1cd.1748500293.git-series.apopple@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <171c8ae407198160c434797a96fe56d837cdc1cd.1748500293.git-series.apopple@nvidia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250603_063742_835446_60CBA191 X-CRM114-Status: GOOD ( 15.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 29, 2025 at 04:32:05PM +1000, Alistair Popple wrote: > DAX no longer requires device PTEs as it always has a ZONE_DEVICE page > associated with the PTE that can be reference counted normally. Other users > of pte_devmap are drivers that set PFN_DEV when calling vmf_insert_mixed() > which ensures vm_normal_page() returns NULL for these entries. > > There is no reason to distinguish these pte_devmap users so in order to > free up a PTE bit use pte_special instead for entries created with > vmf_insert_mixed(). This will ensure vm_normal_page() will continue to > return NULL for these pages. > > Architectures that don't support pte_special also don't support pte_devmap > so those will continue to rely on pfn_valid() to determine if the page can > be mapped. > > Signed-off-by: Alistair Popple > --- > mm/hmm.c | 3 --- > mm/memory.c | 20 ++------------------ > mm/vmscan.c | 2 +- > 3 files changed, 3 insertions(+), 22 deletions(-) Reviewed-by: Jason Gunthorpe Jason From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 689CCC5AE59 for ; Tue, 3 Jun 2025 14:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NE3P8hbNeWSR8FJefK/PbcyIG4MElj/325ddSkr+Ghg=; b=IMaS3LNykItMYI 7KmQufSUoqJG90MpwcByuZ8PQIqKecCIkthFS+ekWM/Rkla4WEIo5N0Nj9Ry7pU5leXwJpkbHnWco 96TluXJUhH3cpXSB7OnasxQ2jSKz0DWEWtsOdxLGj2xspbIeZa8c0dltI4TNkzdDgcv0T+REkSh+d YMi6ZPwtCH/MXXN1yDR5My56nja+l499xwveFQdjDlaEan3um7XCR+25T525n2M9/fi//Ss4DuLt7 WGqaql5smSkDR8sfRqSrrBPPWf/P1HbfQ9gN8UuLX/Zc3FcDbR3QivXCVzmwMhJeHIvZ2/nIizzHF x3KkPx9i/QCgpPcg0STg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uMSrT-0000000BBXi-1WV1; Tue, 03 Jun 2025 14:43:31 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uMRpm-0000000B3fz-3Koz for linux-riscv@lists.infradead.org; Tue, 03 Jun 2025 13:37:44 +0000 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-4a589b7dd5fso35498141cf.0 for ; Tue, 03 Jun 2025 06:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1748957861; x=1749562661; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UoX6ZYAbWcKDR6KFcgyyRoqI5kTXzqc7rOw8qvSUCMg=; b=IOWkGIyApe4s8HuMFWOVTaqGO/1SHICkDPjfmBa0gYgJR1gdN4sg+62+7eBqtdtaXI K+OeSjhVCYLmnnPPl2OcxKctIobxaDKsfpl5m6SG8nU1SPIKI2vwG8u41myq6F/uN145 NyPx7O/8ZjWUhbS1U8yu7+qyLE3W6FQ2dYoN87+3PE6+/6aikbm0a27c/6fM4Z+7ZK29 h5J8OsxBLb5k1frhDECsCt30E2fIFF8jaUlHVeNbYKVrrgs36wa47/SF1tkC9c4O8p6q rYHeyqiZZb7PaBhR4bIL0w/J7b92C7KMEH/n0+Cont34ue8St5KnFLKyvcI5LP2Ej8P9 SBsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748957861; x=1749562661; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UoX6ZYAbWcKDR6KFcgyyRoqI5kTXzqc7rOw8qvSUCMg=; b=AyOfsGnYYq8WS9HQ9SrX3LHLH+VHKdNB8Qdvs+duH2gt/WfLAdZcG9auJ6zOueQl6S ms1cO37vmfhEXcepOTvrAWVBWHKR1vVOS0326FS41kBd6/muh5UnlGNazy76goHxMH4y XRKZ/Y7cS8wIKRocjq/zog3CcqzUZIyJYTINbtA7d6mlDxxHemO0p1tdwFsa9m+HvoFJ 4mnWO2x1b7N0gd6ziajA1s46nIkmiypjvMEOol1ZXfCRHln0crPxaqAYqXFpTsojTDQj rMIFnTo/JMFj4PR1qScI728FIsTBLh7J97103EiYBNYNcVWIZDcFDQotPxOaQrxrEwbc xP/Q== X-Forwarded-Encrypted: i=1; AJvYcCULc5URdlWsbGhLX1n2uZmvWymeDUAmOU600lR82NjnL5wM+rsmQVI68MbH/dhwRszpSD3HWNGQZS0z2g==@lists.infradead.org X-Gm-Message-State: AOJu0YzCC6CUCIdrcJ/h+T457HwUlo82AweR6CfCcCWCM3rzGeJlNPm/ KdzJU2ItoTpUDxVbtn4DKjfQisaFIsEdLDGkze6r6Xn9BWP7tbqW5y/cLrE3MTD94os= X-Gm-Gg: ASbGnctRxY7uz8VPOo5nIgJFZnROpB+Y31ZIuLkcV4CAhc+pGQCaWubTq2EFLdDQwuQ JNGmCOoBBdGlNdW8oOPm9K8j3jmPn6tDVFVaTWR2SXOrt8W6kpMDDv8YSknntiqRoihmkuAYy3w 8x9/Og1dn+Gc4n2RMpAnQ3B5Y7dX2iQMMXfgs4IfakxShFwQhAwBDduiORDz9QbOoZcC7XT52Od O2sGOAFW/xeFX6rJ6GakKStfHF9XixtgI7hyz0VoYNhwGFO64USDV6FjwnD9ChCOnBxl07Z/xRs UcpLdbKopdBmm4UXYK1C+aZ4fvPoPKcFkEFFPCRyXq5H/EgVKMm1QIamkZxoOarTS4xNe208hb9 Y8STUVXcKFwqobgpZ+diE8kXI7ayl86qFQJ1KhA== X-Google-Smtp-Source: AGHT+IHIja21FGplZEuqybwyfzBxoI5k6ggct08qhelvg2n2Sr3vDQGi+qZrCCr84f/KmAHse8r0Yw== X-Received: by 2002:a05:622a:4c16:b0:4a4:2e99:3a92 with SMTP id d75a77b69052e-4a443f2d1a2mr265367291cf.38.1748957861491; Tue, 03 Jun 2025 06:37:41 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-167-56-70.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.167.56.70]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4a435a36e1bsm73924021cf.62.2025.06.03.06.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jun 2025 06:37:40 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1uMRpk-00000001h5v-1tYD; Tue, 03 Jun 2025 10:37:40 -0300 Date: Tue, 3 Jun 2025 10:37:40 -0300 From: Jason Gunthorpe To: Alistair Popple Cc: linux-mm@kvack.org, gerald.schaefer@linux.ibm.com, dan.j.williams@intel.com, willy@infradead.org, david@redhat.com, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, zhang.lyra@gmail.com, debug@rivosinc.com, bjorn@kernel.org, balbirs@nvidia.com, lorenzo.stoakes@oracle.com, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-cxl@vger.kernel.org, dri-devel@lists.freedesktop.org, John@groves.net Subject: Re: [PATCH 04/12] mm: Convert vmf_insert_mixed() from using pte_devmap to pte_special Message-ID: <20250603133740.GE386142@ziepe.ca> References: <171c8ae407198160c434797a96fe56d837cdc1cd.1748500293.git-series.apopple@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <171c8ae407198160c434797a96fe56d837cdc1cd.1748500293.git-series.apopple@nvidia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250603_063742_835358_5C7E2F66 X-CRM114-Status: GOOD ( 14.43 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Thu, May 29, 2025 at 04:32:05PM +1000, Alistair Popple wrote: > DAX no longer requires device PTEs as it always has a ZONE_DEVICE page > associated with the PTE that can be reference counted normally. Other users > of pte_devmap are drivers that set PFN_DEV when calling vmf_insert_mixed() > which ensures vm_normal_page() returns NULL for these entries. > > There is no reason to distinguish these pte_devmap users so in order to > free up a PTE bit use pte_special instead for entries created with > vmf_insert_mixed(). This will ensure vm_normal_page() will continue to > return NULL for these pages. > > Architectures that don't support pte_special also don't support pte_devmap > so those will continue to rely on pfn_valid() to determine if the page can > be mapped. > > Signed-off-by: Alistair Popple > --- > mm/hmm.c | 3 --- > mm/memory.c | 20 ++------------------ > mm/vmscan.c | 2 +- > 3 files changed, 3 insertions(+), 22 deletions(-) Reviewed-by: Jason Gunthorpe Jason _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv