From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9770C3E0758 for ; Thu, 28 May 2026 16:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779987022; cv=none; b=EETqB/VWLGDd1tj1/1sjdBTMA41bMtB7AXobvbuVhTb5DRlZvy2W5mxosDSbLzLyoSY4xrv6hrwyUG2zyby3KQ4mW5wrM560lZ58i24AYpETJ0GKC+S9yuQzlG0XcLm40TprZ7SSis4Euf9nCN0kQQhKi5KJqeoPrCkmAnMwtZo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779987022; c=relaxed/simple; bh=yzlo3xmXqUYFotfdaId9HTkqzJoOffcAET7WuagY9zo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=S+1W8X53v04EAVa14YdCrzAV1TW0w8bsZErwITCbmtSr1gS4r/l0Tr73hfqtNeTvxFLstweTKdKSWf78aXodxg4GrnpHqHGs8+UEB3Ndj6v0EaUS5DW90Y+ENWtYnYOCIxM07WI8IHe2B/RAXxSFUxBAenqRv7lVTbaY9qztqkM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=vjPIq6ZD; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="vjPIq6ZD" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E811922EE; Thu, 28 May 2026 09:50:15 -0700 (PDT) Received: from [10.163.163.35] (unknown [10.163.163.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4F9863F905; Thu, 28 May 2026 09:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1779987020; bh=yzlo3xmXqUYFotfdaId9HTkqzJoOffcAET7WuagY9zo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=vjPIq6ZDu7S+lXbMMtbiAQqjvZhkELukdEvuZFJQjnXp/y97U/1n/LcWMAeS0FZng SWQhjYd2EqRs0YnPPesizRKGwqpQoEZJ9//BO6jwsQ13NqkIkYawgnPIwaYF0U31B2 JJAQAvP+JDgsvU27Ur3+iwU81Yb5NwYpOCzMEtX4= Message-ID: Date: Thu, 28 May 2026 22:20:02 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 00/12] Optimize anonymous large folio unmapping To: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org, chrisl@kernel.org, kasong@tencent.com, hughd@google.com, liam@infradead.org Cc: riel@surriel.com, vbabka@kernel.org, harry@kernel.org, jannh@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, qi.zheng@linux.dev, shakeel.butt@linux.dev, baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, shikemeng@huaweicloud.com, nphamcs@gmail.com, bhe@redhat.com, youngjun.park@lge.com, baolin.wang@linux.alibaba.com, pfalcato@suse.de, ryan.roberts@arm.com, anshuman.khandual@arm.com References: <20260526063635.61721-1-dev.jain@arm.com> Content-Language: en-US From: Dev Jain In-Reply-To: <20260526063635.61721-1-dev.jain@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sashiko: Patch 9: About anon-exclusivity: At this point, the batched helper is not called with nr_pages > 1. Later, anon-exclusive uniformity is handled. On PUD folio: that is never passed to folio_try_share_anon_rmap. I was following the pattern followed elsewhere, given that PUD THP is not supported yet. Although there is no harm in changing the check to (level != PGTABLE_LEVEL_PTE). On hugetlb folio: that is never passed. Patch 11: Existing bug: doesn't look like it. uffd-wp is not there for a migration-writable softleaf entry. Patch 12: ABout sparc64: Yep I'll change this to #ifdef or something. Apparently is_defined() doesn't work in case the macro doesn't have a value. About dirty young and uffd-wp bits: we don't care about dirty and young bits since we are converting to swap ptes. uff-wp uniformity is preserved through folio_pte_batch. About stale nr_pages: The patch initializing nr_pages = 1 at the start of the loop is already in mm-hotfixes. About O(N): Yes I will update this to retain the nr_pages == folio_nr_pages() early bail out.