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 X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A849C433DB for ; Mon, 22 Feb 2021 12:52:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A44CE64E20 for ; Mon, 22 Feb 2021 12:52:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A44CE64E20 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0B29C6B007D; Mon, 22 Feb 2021 07:52:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 03B116B007E; Mon, 22 Feb 2021 07:52:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1E4A6B0080; Mon, 22 Feb 2021 07:52:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id C97286B007D for ; Mon, 22 Feb 2021 07:52:34 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8D25E180AD802 for ; Mon, 22 Feb 2021 12:52:34 +0000 (UTC) X-FDA: 77845892628.18.F289EEE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 1E1CE80192E4 for ; Mon, 22 Feb 2021 12:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613998353; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2iEQDmFtT3qebJig5f9jd7ifXq3OPYbzSwZS/a5ZYlE=; b=ipqaRcSaf49a8AlNSXTIuNwAxFXb42xzojkgCvhJ4G5Zo4QceGNK4q7OZmJvvhrgixejq+ HnavqaUvmmQ60DysKS4F/RTwEiLhMGyMgh1Gw5RWGMUteEqFCNgv1wGGytBrBPXnM3C0VC TPQIif2rU06FNwoPzB5bNIuegpGlISQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-348-mZgLziWtMHSpoaneWBcJ5w-1; Mon, 22 Feb 2021 07:52:29 -0500 X-MC-Unique: mZgLziWtMHSpoaneWBcJ5w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4620A107ACC7; Mon, 22 Feb 2021 12:52:26 +0000 (UTC) Received: from [10.36.115.16] (ovpn-115-16.ams2.redhat.com [10.36.115.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id E65EE19CA8; Mon, 22 Feb 2021 12:52:16 +0000 (UTC) Subject: Re: [PATCH RFC] mm/madvise: introduce MADV_POPULATE to prefault/prealloc memory To: Michal Hocko Cc: Peter Xu , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Arnd Bergmann , Oscar Salvador , Matthew Wilcox , Andrea Arcangeli , Minchan Kim , Jann Horn , Jason Gunthorpe , Dave Hansen , Hugh Dickins , Rik van Riel , "Michael S . Tsirkin" , "Kirill A . Shutemov" , Vlastimil Babka , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Chris Zankel , Max Filippov , linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org References: <20210217154844.12392-1-david@redhat.com> <20210218225904.GB6669@xz-x1> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <296a1a02-f7ec-5085-f17e-eadc4bdb6a24@redhat.com> Date: Mon, 22 Feb 2021 13:52:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1E1CE80192E4 X-Stat-Signature: ny81ptdwdupgyxxyejx3j7k7iwrqfz65 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=63.128.21.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613998352-177106 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 22.02.21 13:46, Michal Hocko wrote: > I am slowly catching up with this thread. > > On Fri 19-02-21 09:20:16, David Hildenbrand wrote: > [...] >> So if we have zero, we write zero. We'll COW pages, triggering a write fault >> - and that's the only good thing about it. For example, similar to >> MADV_POPULATE, nothing stops KSM from merging anonymous pages again. So for >> anonymous memory the actual write is not helpful at all. Similarly for >> hugetlbfs, the actual write is not necessary - but there is no other way to >> really achieve the goal. > > I really do not see why you care about KSM so much. Isn't KSM an > explicit opt-in with a fine grained interface to control which memory to > KSM or not? Yeah, I think it's opt-in via MADV_MERGEABLE. E.g., QEMU defaults to enable KSM unless explicitly disabled by the user. But I agree, I got distracted by KSM details. -- Thanks, David / dhildenb