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=-5.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 770EDC433E0 for ; Tue, 5 Jan 2021 09:30:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0A67A20756 for ; Tue, 5 Jan 2021 09:30:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A67A20756 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 6C59B8D0075; Tue, 5 Jan 2021 04:30:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 64EB98D006E; Tue, 5 Jan 2021 04:30:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4ED748D0075; Tue, 5 Jan 2021 04:30:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id 3434B8D006E for ; Tue, 5 Jan 2021 04:30:00 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D5A48181AEF00 for ; Tue, 5 Jan 2021 09:29:59 +0000 (UTC) X-FDA: 77671199718.02.apple18_360052d274d7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id A7A9110097AA1 for ; Tue, 5 Jan 2021 09:29:59 +0000 (UTC) X-HE-Tag: apple18_360052d274d7 X-Filterd-Recvd-Size: 4593 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Jan 2021 09:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609838998; 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=+tuu9jZl4ygMZucY8oUdrOoGRv8r43O0YhW/HHyjwp4=; b=CI7FlylPrLHNVN1I3lpeNj9jizC6y+RwN7HXfMyZbi1LHRNGJVq2/SdCnFryoaRVFnLfTp +ZsBRGY8r92j8lhJHeFVHJdRR2W80oHvfZ8vrnm4xGR49u3Gt4Az6BKLeqii2hHRyJ8w7q vPk3zxXD6Bq1DwA5jZUs7qlmFaEX2bY= 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-156-G9p_NeVKNDeNlGFrnBl8nA-1; Tue, 05 Jan 2021 04:29:55 -0500 X-MC-Unique: G9p_NeVKNDeNlGFrnBl8nA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1C564107ACE3; Tue, 5 Jan 2021 09:29:53 +0000 (UTC) Received: from [10.36.114.117] (ovpn-114-117.ams2.redhat.com [10.36.114.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id C45531002382; Tue, 5 Jan 2021 09:29:46 +0000 (UTC) Subject: Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO To: Michal Hocko , Dave Hansen Cc: Matthew Wilcox , Alexander Duyck , Mel Gorman , Andrew Morton , Andrea Arcangeli , Dan Williams , "Michael S. Tsirkin" , Jason Wang , Liang Li , linux-mm@kvack.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org References: <43576DAD-8A3B-4691-8808-90C5FDCF03B7@redhat.com> <6bfcc500-7c11-f66a-26ea-e8b8bcc79e28@intel.com> <20210105092037.GY13207@dhcp22.suse.cz> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <71953119-06ff-0bb8-1879-09e24bf80446@redhat.com> Date: Tue, 5 Jan 2021 10:29:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210105092037.GY13207@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Content-Transfer-Encoding: quoted-printable 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 05.01.21 10:20, Michal Hocko wrote: > On Mon 04-01-21 15:00:31, Dave Hansen wrote: >> On 1/4/21 12:11 PM, David Hildenbrand wrote: >>>> Yeah, it certainly can't be the default, but it *is* useful for >>>> thing where we know that there are no cache benefits to zeroing >>>> close to where the memory is allocated. >>>> >>>> The trick is opting into it somehow, either in a process or a VMA. >>>> >>> The patch set is mostly trying to optimize starting a new process. So >>> process/vma doesn=E2=80=98t really work. >> >> Let's say you have a system-wide tunable that says: pre-zero pages and >> keep 10GB of them around. Then, you opt-in a process to being allowed >> to dip into that pool with a process-wide flag or an madvise() call. >> You could even have the flag be inherited across execve() if you wante= d >> to have helper apps be able to set the policy and access the pool like >> how numactl works. >=20 > While possible, it sounds quite heavy weight to me. Page allocator woul= d > have to somehow maintain those pre-zeroed pages. This pool will also > become a very scarce resource very soon because everybody just want to > run faster. So this would open many more interesting questions. Agreed. >=20 > A global knob with all or nothing sounds like an easier to use and > maintain solution to me. I mean, that brings me back to my original suggestion: just use hugetlbfs and implement some sort of pre-zeroing there (worker thread, whatsoever). Most vfio users should already be better of using hugepages. It's a "pool of pages" already. Selected users use it. I really don't see a need to extend the buddy with something like that. --=20 Thanks, David / dhildenb