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 883F8C433FE for ; Mon, 17 Oct 2022 23:55:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C2FE6B0072; Mon, 17 Oct 2022 19:55:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0728F6B0075; Mon, 17 Oct 2022 19:55:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA2F96B0078; Mon, 17 Oct 2022 19:55:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D7FAE6B0072 for ; Mon, 17 Oct 2022 19:55:44 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A83361A0A42 for ; Mon, 17 Oct 2022 23:55:44 +0000 (UTC) X-FDA: 80032101408.01.CA24817 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf11.hostedemail.com (Postfix) with ESMTP id 396F940032 for ; Mon, 17 Oct 2022 23:55:44 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3ADBA612FD; Mon, 17 Oct 2022 23:55:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49EC9C433D7; Mon, 17 Oct 2022 23:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1666050942; bh=FWVxs/EBT34NoYhpfHxvCyPhbWyihGkkEtNt4KcjUGk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BywyYc1jquVaPwVyqQDEEuYsdBmfW72u4WzGLeCOxS7QcZE4dln6r3MbT4AIxGBAP lzh3ki/P2n9olzPQJLCgPZISguSCRMJ0z768huSis/0RYlUCfgLVLWETgQB8DoxOsB Of2STBMdJbssr6yojL8+bf70uBWieaqAQJcxAOX4= Date: Mon, 17 Oct 2022 16:55:41 -0700 From: Andrew Morton To: xu.xin.sc@gmail.com Cc: ran.xiaokai@zte.com.cn, yang.yang29@zte.com.cn, jiang.xuexin@zte.com.cn, imbrenda@linux.ibm.com, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, xu xin Subject: Re: [PATCH v3 0/5] ksm: support tracking KSM-placed zero-pages Message-Id: <20221017165541.6e2d3cebdc1ba13861ea4b2b@linux-foundation.org> In-Reply-To: <20221011022006.322158-1-xu.xin16@zte.com.cn> References: <20221011022006.322158-1-xu.xin16@zte.com.cn> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=BywyYc1j; spf=pass (imf11.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666050944; a=rsa-sha256; cv=none; b=38RuJurVgWT79CIKNP99kM1vO7LF86KAMRkLF3jG5iFEOBhMz1piN3/tbWH3uMphYCIzZw xIKdD0eL0eVGDj7iH/vdeoM2lA2I4O8rsnyxziQEnwAPIzcL/N/ot6VHaGcvtXx3eEcTlR 2KhQZDDOSfm2R+dlQU0cq1n4CK8zvHE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666050944; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vr2YY8F/9Lg3fwekPccEa+jrnpWICQof2Z4CYKw0HWE=; b=m9IAYqOEKAuOPdozWW0KH+r+M0FVjjUeK8tfv7COkoXHG5N5N9cSB90p78ac54C/K2oDcS 6R+rswfsB279YpWPF7kmQMLtB/gLYiIyKpNMHQeGpcrBDn7MKnx0zB++OBujY5Cn83UOrb 7FOqHKFac2AAHWi013LIvBcwS23XbjA= X-Stat-Signature: axbr8yoqq5o5k6pthydqrdxsi4hg1ruz X-Rspamd-Queue-Id: 396F940032 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=BywyYc1j; spf=pass (imf11.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1666050944-137801 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 11 Oct 2022 02:20:06 +0000 xu.xin.sc@gmail.com wrote: > From: xu xin > > use_zero_pages is good, not just because of cache colouring as described > in doc, but also because use_zero_pages can accelerate merging empty pages > when there are plenty of empty pages (full of zeros) as the time of > page-by-page comparisons (unstable_tree_search_insert) is saved. > > But there is something to improve, that is, when enabling use_zero_pages, > all empty pages will be merged with kernel zero pages instead of with each > other as use_zero_pages is disabled, and then these zero-pages are no longer > managed and monitor by KSM, which leads to two issues at least: Sorry, but I'm struggling to understand what real value this patchset offers. > 1) MADV_UNMERGEABLE and other ways to trigger unsharing will *not* > unshare the shared zeropage as placed by KSM (which is against the > MADV_UNMERGEABLE documentation at least); see the link: > https://lore.kernel.org/lkml/4a3daba6-18f9-d252-697c-197f65578c44@redhat.com/ Is that causing users any real-world problem? If not, just change the documentation? > 2) we cannot know how many pages are zero pages placed by KSM when > enabling use_zero_pages, which leads to KSM not being transparent > with all actual merged pages by KSM. Why is this a problem? A full description of the real-world end-user operational benefits of these changes would help, please.