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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 E82D4C43215 for ; Fri, 29 Nov 2019 19:26:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9039D207FA for ; Fri, 29 Nov 2019 19:26:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AUlgN/Zg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9039D207FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E128A6B05B3; Fri, 29 Nov 2019 14:26:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DE8406B05BF; Fri, 29 Nov 2019 14:26:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD7BF6B05C0; Fri, 29 Nov 2019 14:26:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0178.hostedemail.com [216.40.44.178]) by kanga.kvack.org (Postfix) with ESMTP id B768A6B05B3 for ; Fri, 29 Nov 2019 14:26:12 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 435DF180AF93E for ; Fri, 29 Nov 2019 19:26:12 +0000 (UTC) X-FDA: 76210295784.19.grass48_53300e159bb53 X-HE-Tag: grass48_53300e159bb53 X-Filterd-Recvd-Size: 5114 Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Fri, 29 Nov 2019 19:26:11 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id u24so31770181iob.5 for ; Fri, 29 Nov 2019 11:26:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0wi1DGf1/w4RbfpCoKGiIXoKmj2YRN9qTSNLJ8b+j9A=; b=AUlgN/ZgY5290u6RblB7c6Z1xjJFoazskwQxrUBYQ3lFnIOz5JxPm6UpoKUenad0E3 z/6eRJrcrd0DseAi14lvOyGQWVjTtQ2vc8qg3/ioASaz/PIrHFshXS+26Cz1GhoYNnQh dC4+cPSV3SIjNXr4JUqvJ1nsLN7kKxZyzMnr6kf25LI3yMzgNVOoWPqO+fJb4hS3eVly rfd3KvD9+ux0B9TTpbLfZPONqKaKqTbE6A+coVwv6K31n3uF8gSqo0ebNRVvcLworXTc OJtNZaumdE9X5xFk4TVczWqVYfQcV6c3Z9/qoij2SbKGkIR5tzBQlF6KL3Hxa8S6njJ4 eDQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0wi1DGf1/w4RbfpCoKGiIXoKmj2YRN9qTSNLJ8b+j9A=; b=DfUsrqmRKEpMrU9IEqcrQRqu0EkHL6Oq+X1j6i0oUaQxQWqhKICPlU87j309sXTSvQ zTRsL69FTAjXrUnNuluvvFsxYodRl0q6Q/yffCkO9AIHk/qszzWrdXG/9hFKsBBwgPcT uuvdQ0qvk2fJjWP0CowsRFuKCtPDRsLlw9V6yyVn5SBnOnfCqNCD3IoLRGRezPsF0KR3 +d5Dsugc6LoeqoVptrfnRLfYt6lCXnRHbRrO84acxxsZN7LgsAQCaQ5RGKPKVmTJ6QxP g+vTfb1SpyrJf//wUX6GZok4Q+5wc6ff46FAtturd+FTXnw/9wCekuR1HyTo4h/7qjuJ msKQ== X-Gm-Message-State: APjAAAUmEJSgb5qyu+Ybioop1IBTDDpUDVDY9x/Ry3SDdt7hQBGTGUZ/ 6VdHv8qg85n1pPOyGgswrjh/uflU3pCA2E1tGNw= X-Google-Smtp-Source: APXvYqw8Sn8urET5gD2wFd/upLZDQLG5v+z8uZXczZRd9PFA1AKXcUNY4ZSqQPaI78bevTsdKO25a801EwSx7xuUAX0= X-Received: by 2002:a5d:8789:: with SMTP id f9mr47221896ion.237.1575055570835; Fri, 29 Nov 2019 11:26:10 -0800 (PST) MIME-Version: 1.0 References: <20191119214454.24996.66289.stgit@localhost.localdomain> <20191119214633.24996.46821.stgit@localhost.localdomain> <20191127152422.GE3016@techsingularity.net> <0ec9b67cb45cd30f0ff0b2e9dcbc41602de1c178.camel@linux.intel.com> <20191127183524.GF3016@techsingularity.net> <6aae7be8a84e7f0622c1f7fd362e4f213aea383d.camel@linux.intel.com> <20191128092231.GH3016@techsingularity.net> In-Reply-To: <20191128092231.GH3016@techsingularity.net> From: Alexander Duyck Date: Fri, 29 Nov 2019 11:25:59 -0800 Message-ID: Subject: Re: [PATCH v14 3/6] mm: Introduce Reported pages To: Mel Gorman Cc: Alexander Duyck , kvm list , "Michael S. Tsirkin" , LKML , Matthew Wilcox , Michal Hocko , linux-mm , Andrew Morton , Vlastimil Babka , Yang Zhang , Nitesh Narayan Lal , Konrad Rzeszutek Wilk , David Hildenbrand , Pankaj Gupta , Rik van Riel , lcapitulino@redhat.com, Dave Hansen , "Wang, Wei W" , Andrea Arcangeli , Paolo Bonzini , Dan Williams , Oscar Salvador Content-Type: text/plain; charset="UTF-8" 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 Thu, Nov 28, 2019 at 1:22 AM Mel Gorman wrote: > > On Wed, Nov 27, 2019 at 01:55:02PM -0800, Alexander Duyck wrote: < snip > > > > > > > Which in itself could be an optimisation patch. Maybe it'll be enough that > > > keeping track of the count is not worthwhile. Either way, the separate > > > patch could have supporting data on how much it improves the speed of > > > reporting pages so it can be compared to any other optimisation that > > > may be proposed. Supporting data would also help make the case that any > > > complexity introduced by the optimisation is worthwhile. > > > > I'll see what I can do to break this apart. I'm just not a fan of redoing > > the work multiple times so that I can have a non-optimized version versus > > an optimized one. > > > > While I understand that, right now the optimisations are blocking the > feature itself which is also not a situation you want to be in. I'll see what I can do. I can probably replace the reference count and zone flags with an atomic state in the prdev that cycles between inactive, requested, and active. With that I can at least guarantee that we shouldn't have any races that result in us missing freed pages. The only downside is that I have to keep a boolean in the __free_one_page call so that when we free back the reported pages we don't retrigger the reporting and cause an infinite loop.