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 1A1E8C43334 for ; Thu, 9 Jun 2022 09:36:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D5F06B0096; Thu, 9 Jun 2022 05:36:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 785A36B0099; Thu, 9 Jun 2022 05:36:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 673CA6B009A; Thu, 9 Jun 2022 05:36:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 577826B0096 for ; Thu, 9 Jun 2022 05:36:20 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 270768107F for ; Thu, 9 Jun 2022 09:36:20 +0000 (UTC) X-FDA: 79558191720.21.D827342 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf30.hostedemail.com (Postfix) with ESMTP id 857638006E for ; Thu, 9 Jun 2022 09:36:19 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 4DB521FDA8; Thu, 9 Jun 2022 09:36:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1654767378; h=from:from:reply-to: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=VvwjhH9UWKe8FrlHHhosAdnMECDi+CI7dFYYzh8hlOA=; b=rA2U7Q/wkWcXY/kcesb3Wc6YNg2eoiuocD7bBc9TDt6MpgMS958akfsf3KG50j8LOllzNj RLdT0LG7Rpqg6i1Sy/hWGR/zXhLXblNcZTMeLEgFW/FBZBI77+awNU2qClYTlwal1XWtjl KK9eSO1+59Llj1R4qY1Z9yg+Asa4E8U= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 825A62C141; Thu, 9 Jun 2022 09:36:16 +0000 (UTC) Date: Thu, 9 Jun 2022 11:36:15 +0200 From: Michal Hocko To: cgel.zte@gmail.com Cc: akpm@linux-foundation.org, oleksandr@natalenko.name, willy@infradead.org, corbet@lwn.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, xu xin Subject: Re: [PATCH] mm/ksm: provide global_force to see maximum potential merging Message-ID: References: <20220609055658.703472-1-xu.xin16@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220609055658.703472-1-xu.xin16@zte.com.cn> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654767379; 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=VvwjhH9UWKe8FrlHHhosAdnMECDi+CI7dFYYzh8hlOA=; b=rf8qP3z7jqT4YEEU64cNKKMVT6Sv73MGQguCtBbrFcdRo6TC+jnuVPBYTgsGzHlwCMj3ab jgytecObnzqACeLSngTeIwNESYYHsnaEu02NdvXMT2sXx6hR7EKmqvWKjCH5f6Lz1pPlQd vMBSzYwubSQSQ1R30q5GWA8oZtNgZAE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654767379; a=rsa-sha256; cv=none; b=FS5lqXG/gQeynaPySruxbZGsTxXSZapFuEIZXdeSc2+iwn7CeDd32+oHxXn0g05edVOq69 g+F0zBVjWD8XwDqV+dftA8zy/bGqQX3tjena7Wj4aXwWFPOlewRxJ2cE4GRltWlSZVPVRY K5Pb/O6b0UJiVBAsn7gFEnP/jbzftBg= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="rA2U7Q/w"; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf30.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspam11 X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="rA2U7Q/w"; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf30.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Stat-Signature: xbawfopa748i67zxez97md1egaoewbqe X-Rspamd-Queue-Id: 857638006E X-HE-Tag: 1654767379-651386 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 Thu 09-06-22 05:56:58, cgel.zte@gmail.com wrote: > From: xu xin > > Up to now, KSM is apparently useful to save memory not just for VM but for > normal applications. But upper application developers might not know much > about KSM or whether they should use madvise(xxx, MERGEABLE) while there > indeed exist a lot of same pages in their apps. Some application developers > urgently need the kernel to provide an interface of KSM debugging mode to > see the maximum potential merging of the whole system, so the patch is. I disagree with this. As already discussed in previous proposals of KSM related interfaces KSM is a nice tool but it shouldn't be used without understanding of all the consequences. Maybe we should be more verbose about how to use KSM properly and also describe best practices but I do not think that enable-for-all in any form is a good interface. Nack to the interface. -- Michal Hocko SUSE Labs