From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [160.30.148.35]) (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 DAF37373C1A for ; Wed, 20 May 2026 06:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=160.30.148.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779258410; cv=none; b=X9cH3ExsyZGI4ja/vH/cD8yypMKx+blMDvu2XBVzQooXctDV0NK1uStuxtONvyibprRIqMySoAZm57pbxUUPY4GFRUKZqdEcB4ruw55vNJA3a43iIfmm39SAfGCTzHnnm/23QLr8pSxnyTeFG4ftnbcmh6qeBkw315J92mAR0xA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779258410; c=relaxed/simple; bh=sHFYyCsowYlShT2jJ91RUt6CmOOAZCa99SjFrsP5T9g=; h=Message-ID:In-Reply-To:References:Date:Mime-Version:From:To:Cc: Subject:Content-Type; b=icf7jjqTIGhNRXPUorU6QMvpCe9JLu1z5GlYfz6iZ3xa402AC9c2+Jrx7G3ryCuFdy7q7cv0iQTrTyaGQkrMQK8gp3TxoX46w17QiZrzY7KE3IHAJZODvPLyZoueiaYpprbvjCsXz4aPalCN17I0W+VcDPivFHSFueXSVJWbE/s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.client-ip=160.30.148.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4gL1ln4rpVz8Xrrd; Wed, 20 May 2026 14:26:45 +0800 (CST) Received: from xaxapp05.zte.com.cn ([10.99.98.109]) by mse-fl1.zte.com.cn with SMTP id 64K6Qdxd006094; Wed, 20 May 2026 14:26:39 +0800 (+08) (envelope-from xu.xin16@zte.com.cn) Received: from mapi (xaxapp05[null]) by mapi (Zmail) with MAPI id mid32; Wed, 20 May 2026 14:26:41 +0800 (CST) X-Zmail-TransId: 2afc6a0d542145f-ee5e7 X-Mailer: Zmail v1.0 Message-ID: <20260520142641245K2bbRXvUcRR_Q3Gdbygi9@zte.com.cn> In-Reply-To: <20260519100156.05043f9d043889a5f60e22d3@linux-foundation.org> References: 20260519220536792dMIKRMurt3vZ5lXC5pwh8@zte.com.cn,20260519100156.05043f9d043889a5f60e22d3@linux-foundation.org Date: Wed, 20 May 2026 14:26:41 +0800 (CST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 From: To: Cc: , , , , , , , Subject: =?UTF-8?B?UmU6IFtQQVRDSCB2NSAwLzVdIEtTTTogcGVyZm9ybWFuY2Ugb3B0aW1pemF0aW9ucyBmb3Igcm1hcF93YWxrX2tzbQ==?= Content-Type: text/plain; charset="UTF-8" X-MAIL:mse-fl1.zte.com.cn 64K6Qdxd006094 X-TLS: YES X-ENVELOPE-SENDER: xu.xin16@zte.com.cn X-SOURCE-IP: 10.5.228.132 unknown Wed, 20 May 2026 14:26:45 +0800 X-CLEAN: YES X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6A0D5425.000/4gL1ln4rpVz8Xrrd > > Two key highlights: > > > > 1. Lock hold time drops from >500ms to <2ms > > - In our benchmark (20,000 VMAs sharing an anon_vma), worst-case > > anon_vma lock hold time during KSM rmap walk went from 705ms > > down to 1.67ms (max) and 1.44ms (avg). > > How real-worldish is that benchmark? > > How much effect are our users likely to see from this patchset in their > real-world workloads? Hi Andrew, Thank you for your thoughtful question. The benchmark intentionally simulates a scenario where many VMAs share the same anon_vma without any fork() involved. This happens in real systems when applications repeatedly split existing VMAs via mprotect(2) or madvise(2) (e.g., MADV_DONTNEED, MADV_FREE) on sub‑ranges of a large anonymous mapping. Real-world examples: - JVM / Go runtime: These use mmap for heap regions and later call mprotect(PROT_NONE) for garbage collection barriers or guard pages, splitting the original VMA into thousands of small pieces over time. - Database engines (MySQL, PostgreSQL): Large shared memory buffers or anonymous mappings are managed with madvise(MADV_DONTNEED) to release specific pages, which also splits VMAs. * Why the benchmark numbers are realistic: We observed ~20,000 VMAs sharing one anon_vma on a production system running a Java application with KSM enabled. The lock hold time before the patch was measured at 228 ms (max) during rmap walks triggered by memory compaction and page migration. The benchmark reproduces that VMA count and lock‑hold behavior in a controlled environment. For systems that do not have thousands of VMAs per anon_vma, the patch adds negligible overhead (a single pgoff comparison). For systems that do suffer from this issue, the improvement is dramatic: 1) Worst‑case anon_vma lock hold time drops from hundreds of milliseconds to under 2 ms.2)This directly reduces blocking of parallel operations that need the same lock – page faults, reclaim, migration, compaction, mlock, and exit_mmap. End‑users will see lower tail latency (fewer application stalls), higher throughput under memory pressure, and no more spurious lockup warnings or container timeouts caused by excessive lock hold times. In short: workloads that do not hit this pathological pattern are unaffected; those that do will see a 100x to 500x reduction in lock hold times, which translates directly into a more responsive system. I hope this clarifies the real‑world relevance. Thank you for pushing us to make the changelog clearer. Best regards, xu xi