Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp310990yba; Wed, 15 May 2019 01:36:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxN1cwyP2TksjbCs/fiAZscIcH0KxaP7LQ3xVZfcF/HHVPtBnzRTFF7rfiyFW02XYUvvAQj X-Received: by 2002:aa7:951c:: with SMTP id b28mr28100999pfp.99.1557909372738; Wed, 15 May 2019 01:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557909372; cv=none; d=google.com; s=arc-20160816; b=c2shEhjPxdIhOzh7wm2WAbTgydObGniheifAy9Uv9SDIi+CyVL4otjJS0Nh/w7wlNx bnG86XNo0z9hf0MW9nPfgi8ZKHWiXz6p942V+8BVJN5YAJqrjpzuZGRuXZI5saHPYrji /pRSJBEotXvIh4fir4OyN4xJ/jfppAi7JFSH5S8bjt437wdtHR9wlmFOJZQy0lw4oUE6 wnoHVIiRyrymBANMxiq24qzhYzqehlCB2fv0u8QkadqZSO3PI/l8ECLUijGXoKkDWwiv CSCX5sr/Vz9/JDz+M8eIdS2gW66i3hkiFmV/QDx7oL+OftKvPPpLIz543gHZjW9Epu6I YXQQ== 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=w/mCSJ42tMOjHxwrKiZFswluDHd9J+p4R9eSNk8N1rA=; b=UPddIq/uKWA12pUWXIeqMDkJhL8QnyldmWuBGi0jzst9m9LylCzVPcjItqLNfq0c3C dkh3/Z0ChMgTwYFOY/aSZEbqRFnDC6Dl1vA18Xs3R3Ewpmyb29SQ5WV+C9NTJ2CREUEi g1YHzEAO9unBWEAwC7Wnpe+FjPkj/r92cW6KGn8QD8tjDivh2ibuT7z3AlVNlJXAq0IP zB/NnGrdKvHkkWOmPAPDhdelOO3PT+w/nz1J28WDyE7VD3Pj9MRZHS+E8x8iCPVx07vz IJJT/XFOWpKViQ0ALPmmVtL/Pfg32tYHfxGY/ynyO1ea45LI1ZwK/el3Q3k8y7ogxwwo Cvww== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si1229294pld.61.2019.05.15.01.35.57; Wed, 15 May 2019 01:36:12 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbfEOIdY (ORCPT + 99 others); Wed, 15 May 2019 04:33:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:34892 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725871AbfEOIdY (ORCPT ); Wed, 15 May 2019 04:33:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 92802AFA7; Wed, 15 May 2019 08:33:22 +0000 (UTC) Date: Wed, 15 May 2019 10:33:21 +0200 From: Michal Hocko To: Oleksandr Natalenko 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: <20190515083321.GC16651@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190515073723.wbr522cpyjfelfav@butterfly.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 15-05-19 09:37:23, Oleksandr Natalenko wrote: [...] > > 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. What does prevent Firefox (an opensource project) to be updated to use the explicit merging? [...] > 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. 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 -- Michal Hocko SUSE Labs