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 808E0C531DC for ; Wed, 14 Aug 2024 16:30:58 +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:Content-Type:In-Reply-To: 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=rj2ZyeWKjea3ZB5hLuY/mn/YSKMmrc3bYlHWoh9tPIo=; b=qIc18MT9pZCLCYeD7lb+xot4uU ahJfN9kX/CSQzu6KpRqeSV4lw76RZxL7eWogfBJ3GC8gNB5upJuhh7eEXRryelrSxECja2/9XyZBA LeSC2Zw381Fziptm4rtwbuNZ9IXh/YOxENyXDxfC6lPMVmaQbnoNAQ2ZXRMrTl4GJQo5Zv1rYR/30 yHxFdNsdzATGs+C1fCDN9lNV6eIJI7/li0nNAuxW2u/LNr4U0lJu33MGoEB/4LP+ytyi2P+DxtFA9 YlPcv6z7jUWvDx0okM5T8nWdBG+cVEaupb9QgVRyIETwbk7zSd+/YziVXom+w3PA7vVFfsEOm0EZW K/Pcqm5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1seGtc-00000007g4w-2xM1; Wed, 14 Aug 2024 16:30:48 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1seFqn-00000007SnN-3sjw for linux-arm-kernel@lists.infradead.org; Wed, 14 Aug 2024 15:23:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723649027; 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: in-reply-to:in-reply-to:references:references; bh=rj2ZyeWKjea3ZB5hLuY/mn/YSKMmrc3bYlHWoh9tPIo=; b=FXJ3VaJM2gPLM/lHc3sMt/yAam4jDygN34xbHfSDgywcDVbctCIt4EU8yKoXwoiZJTAhXf iZESJ3VZUlSusEvf9mxgKCnw+dzm/PUU3TBqEDMJfSAkLy101+43ofhbqSzO0QktWJ7WNE mMTnFDUV4gOO3THPQ04WktN07wgF4fY= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-307-7V5hRt-wPAKkFcCfTFki2A-1; Wed, 14 Aug 2024 11:23:45 -0400 X-MC-Unique: 7V5hRt-wPAKkFcCfTFki2A-1 Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3daf1458b58so977679b6e.0 for ; Wed, 14 Aug 2024 08:23:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723649024; x=1724253824; 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=rj2ZyeWKjea3ZB5hLuY/mn/YSKMmrc3bYlHWoh9tPIo=; b=XFq4OUH292K3QoWnS5iZyFSmvMsR0JX5KXGG7sJm16SCoLG7birKTzH2kjfXp7UM5M 0ZyRoAQ+jOk0o95etN3ymmWq3ctr9tyXW7/5lB38UE17bvb5cS5b7ja9a5pRbQCfXNnE NV5YIZYLcQ8BphzsYEhYdvRELGlCoVGEG4HfwnhLQGKAjocXc+ytLVOhU+SBAh+tR3Sn TKoIdsSSqlf7At/GiMOU6rotZoOP/SAcN/ceMVWG+4oPvxjGlcC0eOJeenjJ5zcy77wy /Nv5Z8t+GtxqnAV7qhD/IegVnQCkPVq+sfFrwSzgGZhKBP5V/ZQ2utUs2TVzkQmmPiN9 lGEA== X-Forwarded-Encrypted: i=1; AJvYcCWojf0eVYa5PSnj+87Sq2AAbBKuYItaWpVY0wYIjxjjUI9F9/Sa85MJ3SEdFg6gXzne4jzBbBML6bGymd/CshnZTCGJVQSfUFo9q54pn9OzTjmFfYk= X-Gm-Message-State: AOJu0YxryMf2Cu5TiFFiG9zIHNzQC0EkjnwpvgIajVwG3zTfnFZdCeYU xQJWVZOBaomqZw2IaBk2LZ4rTy1zEDNTVArvCtTS1KBBzZDjWtDGpdlw6s9VXMeYGipkUOCJw8+ aAxFmO/ntjfrY8CN7V4powolpZKJKG/82btRwG0hgwlpCpjl294rpODxP912w73eBhoysQo8Ht+ WKt/G+Ygw= X-Received: by 2002:a05:6830:90d:b0:703:5c3e:c134 with SMTP id 46e09a7af769-70c9d982a41mr2127136a34.2.1723649024467; Wed, 14 Aug 2024 08:23:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGKA0i3nrg2nuMRX62k+dnMOQIF1k4Xa29cLk2aSCaOULEklqxi3Psl4Me7eY1Bt4qi3az3A== X-Received: by 2002:a05:6830:90d:b0:703:5c3e:c134 with SMTP id 46e09a7af769-70c9d982a41mr2127112a34.2.1723649024175; Wed, 14 Aug 2024 08:23:44 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bd82c7eb2fsm45155866d6.40.2024.08.14.08.23.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 08:23:43 -0700 (PDT) Date: Wed, 14 Aug 2024 11:23:41 -0400 From: Peter Xu To: Jason Gunthorpe Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sean Christopherson , Oscar Salvador , Axel Rasmussen , linux-arm-kernel@lists.infradead.org, x86@kernel.org, Will Deacon , Gavin Shan , Paolo Bonzini , Zi Yan , Andrew Morton , Catalin Marinas , Ingo Molnar , Alistair Popple , Borislav Petkov , David Hildenbrand , Thomas Gleixner , kvm@vger.kernel.org, Dave Hansen , Alex Williamson , Yan Zhao Subject: Re: [PATCH 03/19] mm: Mark special bits for huge pfn mappings when inject Message-ID: References: <20240809160909.1023470-1-peterx@redhat.com> <20240809160909.1023470-4-peterx@redhat.com> <20240814124000.GD2032816@nvidia.com> MIME-Version: 1.0 In-Reply-To: <20240814124000.GD2032816@nvidia.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240814_082350_055330_4FD04537 X-CRM114-Status: GOOD ( 17.51 ) 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 Wed, Aug 14, 2024 at 09:40:00AM -0300, Jason Gunthorpe wrote: > On Fri, Aug 09, 2024 at 12:08:53PM -0400, Peter Xu wrote: > > We need these special bits to be around to enable gup-fast on pfnmaps. > > It is not gup-fast you are after but follow_pfn/etc for KVM usage > right? Gup-fast needs it to make sure we don't pmd_page() it and fail early. So still needed in some sort.. But yeah, this comment is ambiguous and not describing the whole picture, as multiple places will so far rely this bit, e.g. fork() to identify a private page or pfnmap. Similarly we'll do that in folio_walk_start(), and follow_pfnmap. I plan to simplify that to: We need these special bits to be around on pfnmaps. Mark properly for !devmap case, reflecting that there's no page struct backing the entry. > > GUP family of functions should all fail on pfnmaps. > > > Mark properly for !devmap case, reflecting that there's no page struct > > backing the entry. > > > > Signed-off-by: Peter Xu > > --- > > mm/huge_memory.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > Reviewed-by: Jason Gunthorpe So I'll tentatively take this with the amended commit message, unless there's objection. Thanks, -- Peter Xu