From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751776AbdF1Olb (ORCPT ); Wed, 28 Jun 2017 10:41:31 -0400 Received: from m13-59.163.com ([220.181.13.59]:1577 "EHLO m13-59.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbdF1OlR (ORCPT ); Wed, 28 Jun 2017 10:41:17 -0400 X-Greylist: delayed 916 seconds by postgrey-1.27 at vger.kernel.org; Wed, 28 Jun 2017 10:41:17 EDT X-Originating-IP: [60.176.32.112] Date: Wed, 28 Jun 2017 22:25:38 +0800 (CST) From: Mark To: hugh.dickins@tiscali.co.uk, linux-kernel@vger.kernel.org Subject: The security about KSM and "adds all memory pages from all processes to KSM" X-Priority: 3 X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build 20160729(86883.8884) Copyright (c) 2002-2017 www.mailtech.cn 163com Content-Type: text/plain; charset=GBK MIME-Version: 1.0 Message-ID: <6cc450ca.e8da.15cef17e0ba.Coremail.zxm927@163.com> X-Coremail-Locale: zh_CN X-CM-TRANSID: O8GowACHoZVivFNZ7QNLAA--.42582W X-CM-SenderInfo: p20pmjqx6rljoofrz/xtbBRQ8FwlO-71U1gwABss X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v5SEfrP5029110 Hi Hugh and experts, We are trying to enable KSM in a multi-container projects to save some memory. And as the celld project suggests: "To maximize the benefit of KSM, CellD uses a custom system call which adds all memory pages from all processes to the set of pages KSM attempts to merge. " [1] Our test shows that with the patch[2], applications works stable and more memory are saved, but we are not sure if this patch brings in any more secure risks compared with ksm only. The "uksm"[3] probably works in a similar way, but somehow in our tests seems it save less memory. Do you have any comments? Thank you so much. [1] http://systems.cs.columbia.edu/archive/pub/2012/08/the-design-implementation-and-evaluation-of-cells-a-virtual-smartphone-architecture/ [2] https://cells-source.cs.columbia.edu/#/c/114/1/mm/madvise.c [3] http://kerneldedup.org/en/