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=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 63A80C5DF63 for ; Wed, 6 Nov 2019 14:09:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2036C2173B for ; Wed, 6 Nov 2019 14:09:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2036C2173B 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 A61B16B0006; Wed, 6 Nov 2019 09:09:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A37CB6B0007; Wed, 6 Nov 2019 09:09:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 976496B0008; Wed, 6 Nov 2019 09:09:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id 82E346B0006 for ; Wed, 6 Nov 2019 09:09:54 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 34E69181AEF1F for ; Wed, 6 Nov 2019 14:09:54 +0000 (UTC) X-FDA: 76126036308.09.stamp45_3932793214b0c X-HE-Tag: stamp45_3932793214b0c X-Filterd-Recvd-Size: 8439 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Wed, 6 Nov 2019 14:09:52 +0000 (UTC) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 794594E83E for ; Wed, 6 Nov 2019 14:09:51 +0000 (UTC) Received: by mail-wr1-f72.google.com with SMTP id w4so5747510wro.10 for ; Wed, 06 Nov 2019 06:09:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=Si/gHUg9E1CPG7DIHi1MiVNcMjyKuqcMnxAmn9HYxpc=; b=ttFL1ttjUC/Qe556WkHb9tD0CN3yiRRNpzT8hApaWDj2ta7dA2SHhBEewFQYSjWDjE g5ffGCUz6EZTvwEAuurJAlnVlnhiNmFtM8nChBZ0xePLvX6Tgv71vcqkg6NpVcCqej4c KYUBsCvNtbJARmtq/d7CGFw/fTWA8BmndvehxN5auX8pZbq8M0lGfw4HCMP17iDOU4hn FDnbS4axrMdCm05QIIosSiHQ/BfgaOnf7gvPcyCtnMNUtmJHINX25H9bj8c/8RWtwR8d SU9hhuZ1QeXQ1u9Bnx2M6qsF5DtNd0WCS/d/677eJqTg3LwUm7rHm5AILpJV6laEt/M8 blLw== X-Gm-Message-State: APjAAAWTN/fDZP144+8gyfFWQDtpFsXd0b9QiudpdoOZMQ3zNjgERJqz pE2BgOtixU5cZJwhb/7yiOAIyehQFLou+PhcH78DtHDW1oIO5cdOfMBcDL1N3Uf5V5E6KdrbtP/ akarA0T2HHoA= X-Received: by 2002:adf:ed49:: with SMTP id u9mr2598094wro.259.1573049390094; Wed, 06 Nov 2019 06:09:50 -0800 (PST) X-Google-Smtp-Source: APXvYqzLJD8UW9LjDtN3LeZiF93HSSeW1nja/LEUhv4PLlNO/Mup9Xyq5wj2riaQPlcHUn97kShWkA== X-Received: by 2002:adf:ed49:: with SMTP id u9mr2598085wro.259.1573049389810; Wed, 06 Nov 2019 06:09:49 -0800 (PST) Received: from [10.198.185.147] (tmo-110-108.customers.d1-online.com. [80.187.110.108]) by smtp.gmail.com with ESMTPSA id x9sm20214912wru.32.2019.11.06.06.09.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Nov 2019 06:09:49 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: David Hildenbrand Mime-Version: 1.0 (1.0) Subject: Re: + mm-introduce-reported-pages.patch added to -mm tree Date: Wed, 6 Nov 2019 15:09:47 +0100 Message-Id: References: <20191106121605.GH8314@dhcp22.suse.cz> Cc: akpm@linux-foundation.org, aarcange@redhat.com, alexander.h.duyck@linux.intel.com, dan.j.williams@intel.com, dave.hansen@intel.com, konrad.wilk@oracle.com, lcapitulino@redhat.com, mgorman@techsingularity.net, mm-commits@vger.kernel.org, mst@redhat.com, osalvador@suse.de, pagupta@redhat.com, pbonzini@redhat.com, riel@surriel.com, vbabka@suse.cz, wei.w.wang@intel.com, willy@infradead.org, yang.zhang.wz@gmail.com, linux-mm@kvack.org In-Reply-To: <20191106121605.GH8314@dhcp22.suse.cz> To: Michal Hocko X-Mailer: iPhone Mail (17A878) 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: > Am 06.11.2019 um 13:16 schrieb Michal Hocko : >=20 > =EF=BB=BFI didn't have time to read through newer versions of this patch s= eries > but I remember there were concerns about this functionality being pulled > into the page allocator previously both by me and Mel [1][2]. Have those b= een=20 > addressed? I do not see an ack from Mel or any other MM people. Is there > really a consensus that we want something like that living in the > allocator? I don=E2=80=98t think there is. The discussion is still ongoing (although qu= iet, Nitesh is working on a new version AFAIK). I think we should not rush t= his. >=20 > There has also been a different approach discussed and from [3] > (referenced by the cover letter) I can only see >=20 > : Then Nitesh's solution had changed to the bitmap approach[7]. However it= > : has been pointed out that this solution doesn't deal with sparse memory,= > : hotplug, and various other issues. >=20 > which looks more like something to be done than a fundamental > roadblocks. I second that. As I stated a couple of times already, it is totally fine to n= ot support all environments initially (hotunplug, sparse zones). The major d= ifference I am interested in is performance comparison. Then we have to deci= de if the gain in performance is worth core buddy modifications. >=20 > [1] http://lkml.kernel.org/r/20190912163525.GV2739@techsingularity.net > [2] http://lkml.kernel.org/r/20190912091925.GM4023@dhcp22.suse.cz > [3] http://lkml.kernel.org/r/29f43d5796feed0dec8e8bb98b187d9dac03b900.came= l@linux.intel.com >=20 >> On Tue 05-11-19 16:05:47, Andrew Morton wrote: >> From: Alexander Duyck >> Subject: mm: introduce Reported pages >>=20 >> In order to pave the way for free page reporting in virtualized >> environments we will need a way to get pages out of the free lists and >> identify those pages after they have been returned. To accomplish this, >> this patch adds the concept of a Reported Buddy, which is essentially >> meant to just be the Uptodate flag used in conjunction with the Buddy pag= e >> type. >>=20 >> It adds a set of pointers we shall call "reported_boundary" which >> represent the upper boundary between the unreported and reported pages.=20= >> The general idea is that in order for a page to cross from one side of th= e >> boundary to the other it will need to verify that it went through the >> reporting process. Ultimately a free list has been fully processed when >> the boundary has been moved from the tail all they way up to occupying th= e >> first entry in the list. Without this we would have to manually walk the= >> entire page list until we have find a page that hasn't been reported. In= >> my testing this adds as much as 18% additional overhead which would make >> this unattractive as a solution. >>=20 >> One limitation to this approach is that it is essentially a linear search= >> and in the case of the free lists we can have pages added to either the >> head or the tail of the list. In order to place limits on this we only >> allow pages to be added before the reported_boundary instead of adding to= >> the tail itself. An added advantage to this approach is that we should b= e >> reducing the overall memory footprint of the guest as it will be more >> likely to recycle warm pages versus trying to allocate the reported pages= >> that were likely evicted from the guest memory. >>=20 >> Since we will only be reporting one zone at a time we keep the boundary >> limited to being defined for just the zone we are currently reporting >> pages from. Doing this we can keep the number of additional pointers >> needed quite small. To flag that the boundaries are in place we use a >> single bit in the zone to indicate that reporting and the boundaries are >> active. >>=20 >> We store the index of the boundary pointer used to track the reported pag= e >> in the page->index value. Doing this we can avoid unnecessary computatio= n >> to determine the index value again. There should be no issues with this >> as the value is unused when the page is in the buddy allocator, and is >> reset as soon as the page is removed from the free list. >>=20 >> Link: http://lkml.kernel.org/r/20191105220219.15144.69031.stgit@localhost= .localdomain >> Signed-off-by: Alexander Duyck >> Cc: Andrea Arcangeli >> Cc: Dan Williams >> Cc: Dave Hansen >> Cc: David Hildenbrand >> Cc: >> Cc: Luiz Capitulino >> Cc: Matthew Wilcox >> Cc: Mel Gorman >> Cc: Michael S. Tsirkin >> Cc: Michal Hocko >> Cc: Oscar Salvador >> Cc: Pankaj Gupta >> Cc: Paolo Bonzini >> Cc: Rik van Riel >> Cc: Vlastimil Babka >> Cc: Wei Wang >> Cc: Yang Zhang >> Signed-off-by: Andrew Morton > --=20 > Michal Hocko > SUSE Labs