Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp323550yba; Wed, 15 May 2019 01:53:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzD2wv81aW92/v0V7uQ3JLoeRL5deEoE8wyOENMKCyoBSJtWvReD9TtCFih935yF+FAZg7v X-Received: by 2002:a62:4c5:: with SMTP id 188mr46688219pfe.29.1557910409243; Wed, 15 May 2019 01:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557910409; cv=none; d=google.com; s=arc-20160816; b=zy24wkytdUoXLCbBJLAdsmp/TcxX+lXDkANJzi2FYZbv9PwpDRR8k7CjcjTSa5RTaM 2sM34ABwyoh27Ds6RuBwjHr1SArvpPTGKCi7W7efsdvgEH9nrLsgNy3Her0gYotRAqNV zR4cJZBdYIM6FOuTY8exU31BWQgMr9tF7vQ/2alS1pYaKDqkxHzdwRbIkzjn6MJ8XftG CRtq2//y9y2SDQtm1NNMz9HSUuDT/YErBSmJqAWJO4NY/OrMBl0Mj7nB6uHJzcAVgPBI ZemfmleZ0JdAKOFGDjQ+EGFcGsPNSjZWV/5iIjMM5dP85KmK+5dk09yeyjLwz/vnaEgu kG4w== 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=F6DFe62CqcWW1zROhCHNbimDkV4rEZq8vvGMAT2Is98=; b=HlqouLwHTBZ+9GVNsiTdsvsmsp+9QHJ58PjxMqvzSVWRXvNxauSjirhn9A5WEP6QpG AHprOlZGApKlt+mxmUCNaPqwolg4uBv9qvoqDnnAIGalxBYr1/kmsFquPP7oh28cejOH B4tw6EO3JDvaJNBIGHpVPcnBc5cCan6UQ7WraJzyj9H9+Z7ox96xIixdQMFNUIE3h12H Jl+P6Ibrc14BTj5W+hoqjWWsz1Rn+fyeQRPMbFcg2jNGrYf85N12odHg5P7xL3KWOcTE NXUmFr3ioms547LG9iA/gT4SnFcrN9yvWaTBlN0n0ZfXHDI2fgIh2dgwkRzOpSngRXLT Xalw== 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 m4si1659675pfb.134.2019.05.15.01.53.14; Wed, 15 May 2019 01:53:29 -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 S1725876AbfEOIwC (ORCPT + 99 others); Wed, 15 May 2019 04:52:02 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41144 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbfEOIwB (ORCPT ); Wed, 15 May 2019 04:52:01 -0400 Received: by mail-wr1-f66.google.com with SMTP id d12so1684966wrm.8 for ; Wed, 15 May 2019 01:52:00 -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=F6DFe62CqcWW1zROhCHNbimDkV4rEZq8vvGMAT2Is98=; b=n3RAxT/pe7iUiMaNhNB/CvmXdvkEH32UlNZPfDF+QzLLEfWufPRyh4kZK0cgZYisjl 9/EUiet5nYxVqriU8WCnMDy6ChQyxVeKUi8QWgBiq39KpJ4EZOSmHpeyHSkRQAcTPA39 3tYLIBzv8W1tciA0ten5bNjIr2p4Ex2C80KXKjZ+kmCdUjRFr7+Dmjy/5h8qzEqNdKXj Wum7DbLi69KHZFMj5FJWV7P/DmSJiju92yTcxo6cbqYa82yKpYVaoYz16lHFTzFIZ2dn 19trQagjWua40M3jaTPQuPuraqOlChqjWGMhjmkPgppsEMPyp4+x5cmC8Ib53KYZVdJJ uo3w== X-Gm-Message-State: APjAAAVZ5LqkRj6xUKkgCr5VO6DABmjUcbwNL1KUQaHEeQrK9yhx/6qk n0fGU/9sgMeF6JJF6jqkeYpTwQ== X-Received: by 2002:adf:ba10:: with SMTP id o16mr15326042wrg.89.1557910320163; Wed, 15 May 2019 01:52:00 -0700 (PDT) Received: from localhost (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id o16sm1915596wro.63.2019.05.15.01.51.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2019 01:51:59 -0700 (PDT) Date: Wed, 15 May 2019 10:51:58 +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: <20190515085158.hyuamrxkxhjhx6go@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> <20190515073723.wbr522cpyjfelfav@butterfly.localdomain> <20190515083321.GC16651@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190515083321.GC16651@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 On Wed, May 15, 2019 at 10:33:21AM +0200, Michal Hocko wrote: > > 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. > > What does prevent Firefox (an opensource project) to be updated to use > the explicit merging? This was rather an example of a big project. Other big projects may be closed source, of course. And yes, with regard to FF specifically I think nothing prevents it from being modified appropriately. > > 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. > > OK, this makes more sense. Please note that there are other people who > would like to see certain madvise operations to be done on a remote > process - e.g. to allow external memory management (Android would like > to control memory aging so something like MADV_DONTNEED without loosing > content and more probably) and potentially other madvise operations. > Or maybe we need a completely new interface other than madvise. I didn't know about those intentions. Could you please point me to a relevant discussion so that I can check the details? > In general, having a more generic API that would cover more usecases is > definitely much more preferable than one ad-hoc API that handles a very > specific usecase. So please try to think about a more generic Yup, I see now. Since you are aware of ongoing intentions, please do Cc those people then and/or let me know about previous discussions please. That way thinking of how a new API should be implemented (be it a sysfs file or something else) should be easier and more visible. Thanks. -- Best regards, Oleksandr Natalenko (post-factum) Senior Software Maintenance Engineer