From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14C9257C9F for ; Tue, 24 Feb 2026 02:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.112 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771898504; cv=none; b=TZn9b47ZLtTvx87WU6kxZ6D5CCUJNN/4Ob99fdjQrqJrGuCPORXsc9oievgcEbThOFtQiUOJY/iTV3L4jM/rLRl+E69vucXtkwNREquA1T0PHOdPDDd6Q01cc3gpbdffrlYxYPhNMNtlSZ+zCHFgZjJvrmnYqtmxLKpWlnKo/Jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771898504; c=relaxed/simple; bh=zrXNKvfgL4gcsY8WR58dPuE0M9lutgIRbYSHpWhixBo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XTwJw4IYTh14ns2AmKTx8TJXY6KYhJRaz/gMosZKn9Hj0DlGMVDdeaUWNOdJTfPoWA5nelV4t0yAfZnhbV6s2KQzn6TV6l36UqFtCXymL1FQ5CFUMCDBODNKLclKs34zEC0ajK3rLp9BMjGbdD1y756xR/L/rE/dpfZo2i8nyNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=FDZ3SQr0; arc=none smtp.client-ip=115.124.30.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="FDZ3SQr0" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1771898501; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=iJQ/3IUSXREjv6iEZ/pBqdTwKOa9f+25GyeUUpRX5oY=; b=FDZ3SQr0UjRw7bryPRDngNKaMnqawCH+leqSdC5qP39zrVQ+se1/w4Ax+cEHv2Gnc5PC6tHq6ojV+XvyQdOB2lrWiuxpB2yh3Jeajw89uQkY5DNd/GA7LNFTXnTFRfxc/cQWdhcSmnGK+toRus5XkAPemU6Fu99cMwVQQgptquA= Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0Wzhndj1_1771898181 cluster:ay36) by smtp.aliyun-inc.com; Tue, 24 Feb 2026 09:56:22 +0800 From: Baolin Wang To: akpm@linux-foundation.org, david@kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, lorenzo.stoakes@oracle.com, ryan.roberts@arm.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, riel@surriel.com, harry.yoo@oracle.com, jannh@google.com, willy@infradead.org, baohua@kernel.org, dev.jain@arm.com, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, hannes@cmpxchg.org, zhengqi.arch@bytedance.com, shakeel.butt@linux.dev, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/5] support batched checking of the young flag for MGLRU Date: Tue, 24 Feb 2026 09:56:03 +0800 Message-ID: X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is a follow-up to the previous work [1], to support batched checking of the young flag for MGLRU. Similarly, batched checking of young flag for large folios can improve performance during large-folio reclamation when MGLRU is enabled. I observed noticeable performance improvements (see patch 5) on an Arm64 machine that supports contiguous PTEs. All mm-selftests are passed. Patch 1,2: cleanup patches. Patch 3: add a new generic batched PTE helper: test_and_clear_young_ptes(). Patch 4: support batched young flag checking for MGLRU. Patch 5: implement the Arm64 arch-specific test_and_clear_young_ptes(). [1] https://lore.kernel.org/all/cover.1770645603.git.baolin.wang@linux.alibaba.com/ Baolin Wang (5): mm: use inline helper functions instead of ugly macros mm: rmap: add a ZONE_DEVICE folio warning in folio_referenced() mm: add a batched helper to clear the young flag for large folios mm: support batched checking of the young flag for MGLRU arm64: mm: implement the architecture-specific test_and_clear_young_ptes() arch/arm64/include/asm/pgtable.h | 18 +++++++---- include/linux/mmu_notifier.h | 54 -------------------------------- include/linux/mmzone.h | 5 +-- include/linux/pgtable.h | 36 +++++++++++++++++++++ mm/internal.h | 54 ++++++++++++++++++++++++++++++++ mm/rmap.c | 31 +++++++++--------- mm/vmscan.c | 37 +++++++++++++++++----- 7 files changed, 151 insertions(+), 84 deletions(-) -- 2.47.3