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 3CDB0C5473F for ; Tue, 27 Aug 2024 22:58:34 +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=AK6C3A50tnsGBsRCbow729A4DBuHr+gMMuMlTEw8uyc=; b=jL+0Bqoi7kAIHx/xYSsGTx+jcs k383eUjzt9/zm+vFidf5uCICG6lvdwjMMcw255C5HN/JjjPD+f75DRCgKybE9OZHS0E3SSW7pRQFf iC990ZS4i+MTrbvoY3qYv+duNx0Ep7Lqr102of6jXdZFxI6WaTmMhNVMnHRjzaZ01Nm6sRtf5k7ao dQX5xmoQao5/E7a1lcfmOj5kVMHO+thv6NlWC4OQzodbC/7IBxw+hhoJK5Yl3dMdxpTEVba4/IWhl x91pXvgPu5xwNt2uy7wLrN3xjXV8fetK9Wl/0ohUj+8tuqPn8EVJSUrBBtDe02qj0NXgXXROhq1Pr POyrqraw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj58o-0000000D4si-2vv0; Tue, 27 Aug 2024 22:58:22 +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 1sj580-0000000D4ki-29NM for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 22:57:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724799450; 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=AK6C3A50tnsGBsRCbow729A4DBuHr+gMMuMlTEw8uyc=; b=FOpxsQDHaahHWYkLjAGVB7qZt9pvHqYYgU6lFPIVSQG2fk9kXLjal0sk8gLmklrbWii/Ew 8E8QO0MY+nNvMvm4wgSSIQtvykqwynX+vXkxQcKSvrxF1YgX+IFReIxg+TeelgdWGt3FWk qKf7zaPmUgUiDF2/Uyj4LgrxWoSyQ28= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-663-rkHKQTBANm-G6J867tQQPA-1; Tue, 27 Aug 2024 18:57:26 -0400 X-MC-Unique: rkHKQTBANm-G6J867tQQPA-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-7a1d40f49f5so767118185a.3 for ; Tue, 27 Aug 2024 15:57:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724799446; x=1725404246; 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=AK6C3A50tnsGBsRCbow729A4DBuHr+gMMuMlTEw8uyc=; b=Ja0t8eDXpC7ul66a1MN75RL4/qcUw9ZYr83eRvuu+jl4v+FSlxdH4jK6rlHUCSM7xb 0I2I5p3/kJlQ/HInHu3ZxqxdxC8iParpsV31LrBXUlu3XELOnwD2+JY+m9ZUryHkQIXn Te5IEy7JbdXp1go0EKuVZC5/0l2GxoyWvhSG/GJu09bzZ6ZtCah+V7+N9ubp5luobnHK 4v+Bd5IgqBwfoREeJTrAtmlwovbJFK2tGC1W4I/MyY4BhGTdr+/YJaSe992ztZDN8gm4 UpgAXrdwzRes6xfHcF3ePIaJpZn7DSSOOGs4yynfYBuPPKonypHLgAAl7MoLsX30nHA/ K6tQ== X-Forwarded-Encrypted: i=1; AJvYcCXVNWwY05Np8IxXdQ6P+adKrzBlDt4TT9NXZVorYI5GkaVaNleJJhMNPL8IJq9tyTXzVQlCykoyrjbrAqlQFdSJ@lists.infradead.org X-Gm-Message-State: AOJu0YxIIvnFQ//83Tq+kZ8eiSRrIoxUxACkDiIuSdx+yjcPnLfq6TF+ wIyHojLGnTTliWAZ/dnZt7fSTR0fEZW5viKh1vfQUo+4Ah4kN+L9mOFFUM9nIYkKPIwKv42AmNA UCSNlUbuwVhsCw8tqg52uWBwD0wiMJ4peh4BCvocR44pES6knapEcAM31JLLPFH5U0x+P/RSA X-Received: by 2002:a05:620a:294a:b0:79f:d0f:2b19 with SMTP id af79cd13be357-7a6897ac51amr1874151385a.68.1724799446105; Tue, 27 Aug 2024 15:57:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFI4+OTLE/+AELbN/FBXKKldemh+MzRZdeNQ6HQxBpbtU51+fjlWi4bBqNnU0zHwgoZ09GhcQ== X-Received: by 2002:a05:620a:294a:b0:79f:d0f:2b19 with SMTP id af79cd13be357-7a6897ac51amr1874149285a.68.1724799445728; Tue, 27 Aug 2024 15:57:25 -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 af79cd13be357-7a67f3dc360sm590479185a.88.2024.08.27.15.57.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 15:57:25 -0700 (PDT) Date: Tue, 27 Aug 2024 18:57:21 -0400 From: Peter Xu To: Jiaqi Yan Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Gavin Shan , Catalin Marinas , x86@kernel.org, Ingo Molnar , Andrew Morton , Paolo Bonzini , Dave Hansen , Thomas Gleixner , Alistair Popple , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sean Christopherson , Oscar Salvador , Jason Gunthorpe , Borislav Petkov , Zi Yan , Axel Rasmussen , David Hildenbrand , Yan Zhao , Will Deacon , Kefeng Wang , Alex Williamson Subject: Re: [PATCH v2 00/19] mm: Support huge pfnmaps Message-ID: References: <20240826204353.2228736-1-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: 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-20240827_155732_651338_6E4D2BFE X-CRM114-Status: GOOD ( 15.75 ) 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 Tue, Aug 27, 2024 at 03:36:07PM -0700, Jiaqi Yan wrote: > Hi Peter, Hi, Jiaqi, > I am curious if there is any work needed for unmap_mapping_range? If a > driver hugely remap_pfn_range()ed at 1G granularity, can the driver > unmap at PAGE_SIZE granularity? For example, when handling a PFN is Yes it can, but it'll invoke the split_huge_pud() which default routes to removal of the whole pud right now (currently only covers either DAX mappings or huge pfnmaps; it won't for anonymous if it comes, for example). In that case it'll rely on the driver providing proper fault() / huge_fault() to refault things back with smaller sizes later when accessed again. > poisoned in the 1G mapping, it would be great if the mapping can be > splitted to 2M mappings + 4k mappings, so only the single poisoned PFN > is lost. (Pretty much like the past proposal* to use HGM** to improve > hugetlb's memory failure handling). Note that we're only talking about MMIO mappings here, in which case the PFN doesn't even have a struct page, so the whole poison idea shouldn't apply, afaiu. Thanks, -- Peter Xu