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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F9B1C54742 for ; Tue, 27 Aug 2024 22:57:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3E8B6B0083; Tue, 27 Aug 2024 18:57:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EEE466B0085; Tue, 27 Aug 2024 18:57:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8ECC6B0088; Tue, 27 Aug 2024 18:57:32 -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 BD0D66B0083 for ; Tue, 27 Aug 2024 18:57:32 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6235641BEC for ; Tue, 27 Aug 2024 22:57:32 +0000 (UTC) X-FDA: 82499538744.25.E4D2812 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 40607180018 for ; Tue, 27 Aug 2024 22:57:30 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=agCNzYOY; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724799379; a=rsa-sha256; cv=none; b=CVRm0wdEnck+kGiyDkIqrg3lxahguIorVpQiiEqvFirIq9dCusV0WbuA1I5TP6XPCwx9eE r1jIpfBCsP8o99uA2trv87JGUb6kmOU6xGXWVf7OVNQ7Pl0aH/jN9DXxM/7U42CevuX/9R uET3scesGi4JQ6KQIpbiAv3Ch1dG3BI= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=agCNzYOY; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724799379; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AK6C3A50tnsGBsRCbow729A4DBuHr+gMMuMlTEw8uyc=; b=fC3bdp2Fm8Abx+vOfb3PUb20OAWiwyB0qsVzRrdfa6ttUNcxJM3WQCOQyabz0cRU0TA7gc 07/etO3EbywxLshFBAQFkLUBBCb6hh25rNVmOI3iEqJbfW02rImERCvDi0eePPWG21SYBy jt+6G3mGFsG2umeP+d7dvZJrAbbmwTU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724799448; 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=agCNzYOYWvxGwNXXvuwggo4YdvckjkcYhCJdO/aZX/WrOoI2Pjs+ajQaMwqB3dkFFbnRud HWVoJv1G7PyQKe5733qH6wrnPFOfF2PiqXGctO4Xe3zjntg4TPrgAKmIq2t+bs7wn1Zv+a ISSy8A6onLSkB797PizT2d3EbQ3Sppo= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-473-mzITRJnvNhmtjGh8-k9MLg-1; Tue, 27 Aug 2024 18:57:26 -0400 X-MC-Unique: mzITRJnvNhmtjGh8-k9MLg-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7a1d40f49f5so767118285a.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=DxDUqXJ5Ok0KGgGgckg8s1Z+iYr1RHgqPk2sZOwJt2hWJbXzRLAtoElARxKdDY0GWK tec9KAxlAOWk1lsDSL/frRHUwZBEbzxLrj2OYOjNmWXpFojKJRyHjJMMcHCDoaQo6OL3 GEneD8pwaef4Jj8GiYOtNHajuhKtElsQpVq1deqnzBSWVMo+oMORxlUTdNbI9NY6vTre DN9wEpJUxy/Jw/cy2KGC2mfODD6c5LWr9la63QEoHKjt3ecXD9GXfX1vStKBhgnMRchz 3VeE9Q9l0scWr7uc8Ikbg5WFXgYzHLJQF9gzq8w12NQB3d094AAA0F0631wf4YNwIt5E 9m7g== X-Forwarded-Encrypted: i=1; AJvYcCXWyfHSloWopDf2AdoKnVY57mv2e7774yqhTc1xZp0DtQ9IDh0fa1r6WkZ/ge1C1OZIYHN3zIQ96g==@kvack.org X-Gm-Message-State: AOJu0YxjA9/+7xv/HZ8ZH6dIkpj298bEPgI2yyPCxKXfncEAUktBrkz6 F6eJJ3ypLeaALcr2SSidUvaA7V6jm4+KwZouUVUkISMBsDGbfNnxE/tVdxObAVgNVKEqstYjBWa +CDpgIfABu32TXxdOcmwK/28fKkVB3rJV4IlwtO0LhscB93Hm X-Received: by 2002:a05:620a:294a:b0:79f:d0f:2b19 with SMTP id af79cd13be357-7a6897ac51amr1874151685a.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-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 40607180018 X-Stat-Signature: fjjykyfadnj3mptfzxmo119zd7iczaxd X-Rspam-User: X-HE-Tag: 1724799450-460640 X-HE-Meta: U2FsdGVkX18r1bPmD1AOB9Mu/sKuqTZYcpe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Bt4m27xQ9q6CJgYyU2ueR9w5mfyKhnD3YqtTy/+rn1YkuigY7SjOFVOK7Ko39/RoNbRteSeIJxJJwjSKeIebXmctjAxLGn70VNft4DEVCRqQIqd2Gfihfrsd4MdI0D91nPdWTF2H1OG22ah4ijEz9yIUqruPQtSnwgoa6P0Pf2sVaecAqrV8Lv3uzpWHqWVf11NQsaeMFtE33OmDew9TTafPzr0eth3BZoUqiPUoeOKTNMF6XE2Hh5M0CD2lXyknb+k8g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000189, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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