Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp269200yba; Wed, 15 May 2019 00:39:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPKFe9U20F4iajj0fvWkQY1ECl81qY2QwspRaUETJxixPywJL0rauW9gOUCE7iZEhaV9QO X-Received: by 2002:a17:902:2ae6:: with SMTP id j93mr18933027plb.130.1557905953285; Wed, 15 May 2019 00:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557905953; cv=none; d=google.com; s=arc-20160816; b=XICpqwpNEkph0RAVbEyO47UZZyWJjDg4l8k8RFavY9QBHTD/bWALL4BMP/IGg1LJOw +3CsPfcdmrsFx+HnmWCoItgrqr0CU7dIX8BXC9sSbm5WqGHmPCWVjvdQ6UztwU2FWQUX 6XodV7eXhvM+gBTtcbpSwvJ7GW1V2ETlxvg/eyMkuMj1b1ENDRuAAKF1izMID3aGOjy1 wEHPjMT+UUAxbbBaxRUIEbv4q5IGIcl46fixAndCzQsPYsm68nN6Nv2/l+q3LHsYOuMX bAhx7ICuiIzqZTCWZ0g0XKN6qBd925mAVKDEq/6sMjIbUAi4OjXZXbnIC96iqNnD5AKf om4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Yj9XZyJEigbRqa/osUD7R/GjHPQqzoncrjwPfcCT3g0=; b=QEEcFgs0QiCzS21dBoihaoLlLLCZdxEuATU7Y7T0836I+kTlByW4GEUx5tXpW5kMUs guZi8pwsNaLgRhgxLU+91io3lVD8YG7R3uh4k8faXQKVKsLTuAh4QS3fYV1qwpYr+A4x JsgzJa/TrHL64Li6iK6h/vWrHhFHci7r/XELFNryuRTEC6W/gukxIGcr+x1SX98rYZ/Q 4u+gPqx7N0QMkzv9dp96dY3z9LyORU3Pm7CasVif/XCLE3OLztbSEm+XXD0ZFq2tL5Ha r5DOQ/Y0EsBHaX/tqO0imPIQGWK8KNvtm2slZeCMvPljwLVb5ES7xCvegbdKzfNcP4rc OVPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si1151929pge.593.2019.05.15.00.38.58; Wed, 15 May 2019 00:39:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726586AbfEOHh2 (ORCPT + 99 others); Wed, 15 May 2019 03:37:28 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:39816 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725902AbfEOHh1 (ORCPT ); Wed, 15 May 2019 03:37:27 -0400 Received: by mail-wm1-f66.google.com with SMTP id n25so1377568wmk.4 for ; Wed, 15 May 2019 00:37:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Yj9XZyJEigbRqa/osUD7R/GjHPQqzoncrjwPfcCT3g0=; b=UTwxU87aVxw+hx4LoaTGbzHSWQXcUtRxhsSQnoqkiqYjq5mrS37dQ7VRMtctHbXj5d u1QcAZjFWJuNMFv91PCdF69OzSNq2cCXE4BpPCxRZ8JJy/U3+miLqM5DPQcokHCZNgM7 yN88rFqYXf4q6cTgz2VPZOrox2tCXlqWMvEKUlMnO7GUBocdbRuen70B/sdk90Zh7biH MPqEieCp4Zf2XZSQpEqRcUUHa9owfkDF7FosX9lFBGdvdfG+NVpErDzLGhQ8aVGvBLRx oCdZFYUKRRoudSMmadO9k8SmhEA9cWhpncSEUaCvNmAkyvNAKTj/u03gBNXdPFu34RsL y1xg== X-Gm-Message-State: APjAAAUk77qxZko7R8idCw3V6uqQSXGgYT4Vj2/7SLzLJIjCpJsEdTss 77KMMoNi7562pBD2jtw8dPQhBw== X-Received: by 2002:a05:600c:21d7:: with SMTP id x23mr10334074wmj.87.1557905845417; Wed, 15 May 2019 00:37:25 -0700 (PDT) Received: from localhost (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id n15sm1056219wmi.42.2019.05.15.00.37.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2019 00:37:24 -0700 (PDT) Date: Wed, 15 May 2019 09:37:23 +0200 From: Oleksandr Natalenko To: Michal Hocko Cc: linux-kernel@vger.kernel.org, Kirill Tkhai , Vlastimil Babka , Matthew Wilcox , Pavel Tatashin , Timofey Titovets , Aaron Tomlin , Grzegorz Halat , linux-mm@kvack.org, linux-api@vger.kernel.org, Hugh Dickins Subject: Re: [PATCH RFC v2 0/4] mm/ksm: add option to automerge VMAs Message-ID: <20190515073723.wbr522cpyjfelfav@butterfly.localdomain> References: <20190514131654.25463-1-oleksandr@redhat.com> <20190514144105.GF4683@dhcp22.suse.cz> <20190514145122.GG4683@dhcp22.suse.cz> <20190515062523.5ndf7obzfgugilfs@butterfly.localdomain> <20190515065311.GB16651@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190515065311.GB16651@dhcp22.suse.cz> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi. On Wed, May 15, 2019 at 08:53:11AM +0200, Michal Hocko wrote: > On Wed 15-05-19 08:25:23, Oleksandr Natalenko wrote: > [...] > > > > Please make sure to describe a usecase that warrants adding a new > > > > interface we have to maintain for ever. > > > > I think of two major consumers of this interface: > > > > 1) hosts, that run containers, especially similar ones and especially in > > a trusted environment; > > > > 2) heavy applications, that can be run in multiple instances, not > > limited to opensource ones like Firefox, but also those that cannot be > > modified. > > This is way too generic. Please provide something more specific. Ideally > with numbers. Why those usecases cannot use an existing interfaces. > Remember you are trying to add a new user interface which we will have > to maintain for ever. For my current setup with 2 Firefox instances I get 100 to 200 MiB saved for the second instance depending on the amount of tabs. 1 FF instance with 15 tabs: $ echo "$(cat /sys/kernel/mm/ksm/pages_sharing) * 4 / 1024" | bc 410 2 FF instances, second one has 12 tabs (all the tabs are different): $ echo "$(cat /sys/kernel/mm/ksm/pages_sharing) * 4 / 1024" | bc 592 At the very moment I do not have specific numbers for containerised workload, but those should be similar in case the containers share similar/same runtime (like multiple Node.js containers etc). Answering your question regarding using existing interfaces, since there's only one, madvise(2), this requires modifying all the applications one wants to de-duplicate. In case of containers with arbitrary content or in case of binary-only apps this is pretty hard if not impossible to do properly. > I will try to comment on the interface itself later. But I have to say > that I am not impressed. Abusing sysfs for per process features is quite > gross to be honest. Sure, please do. Thanks for your time and inputs. -- Best regards, Oleksandr Natalenko (post-factum) Senior Software Maintenance Engineer