Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp509119img; Thu, 21 Mar 2019 03:04:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRNO4WrIN9X8fawOH/B6im5pKivWBEcuCnX+3gWUqP9J9tUYY72/ygdpU82eDZeJS/fDho X-Received: by 2002:a17:902:8c8b:: with SMTP id t11mr2627615plo.148.1553162675617; Thu, 21 Mar 2019 03:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553162675; cv=none; d=google.com; s=arc-20160816; b=z2mzhmuSIa9C2iB1LIwyGsy7Ok9cEeEBOpAc5gD10Uh62s1b9x3mBxClzdpKHnHl55 EAGUuFXN+nnefSn3j8xhWN2BV0myW2kQrM+UmrYzirXEbJUOisjv8kcQcKJ9oiUgrdn3 /8E8Kyv1wh8x1PBvSNM3beQo1HqSCBiG6eQJjDZtLPDLJRh/K6FdfuTqzaZbRzlq+SzI DT3AzpPKsr930cc4H1NhubbVLEo1qpSn4LvT6pHJEfxmMRUtMiK9vVDe2A/+9YS7Hlay F1uwgYmLGqBC/lk6wvwkHC/sOgRkjMTHEclXj1qLO2Xa4izIcOcAbVJfivWbLW0U5sBu tZTw== 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=LzHCm0222w9//IUougpPZTLTk12UjU1d65uoLzJeIwQ=; b=NOyNcaYfKad0Ym83A9VYKR4+G3RNtilUVt7sWBsLb/TkMh4ZKCTmoJ/aDPNcF9zT9I s4e2849HEeb87bM+nT5B/R8IVb9SZDoKnVs6ounlAsSrzk24Yzbfi+qjZHLd/qMZZPmd DNX0FR/8qz0/c7LIs9rl8HOyvNGaHAM6h5NNpBFpe6FZPaean0Y6iphNAi2AdPRAHftN Y2+SwY+07KqYk7D1TdQfa6RYOhC+Pyh7IWqWCR4AM/p3gJa3K0P6b1gcfwDmSPXN7X4n nlZB9F3PJ0B2mcIkoklNZ75jr/GVC2vW864Ti/OjdvBI1YaUlZKhoqVQm52FfDGB4EDF IOEA== 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 f3si3780609pgi.487.2019.03.21.03.04.12; Thu, 21 Mar 2019 03:04:35 -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 S1728379AbfCUKDT (ORCPT + 99 others); Thu, 21 Mar 2019 06:03:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:54304 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728214AbfCUKDT (ORCPT ); Thu, 21 Mar 2019 06:03:19 -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 AB793B049; Thu, 21 Mar 2019 10:03:17 +0000 (UTC) Date: Thu, 21 Mar 2019 11:03:16 +0100 From: Michal Hocko To: Oscar Salvador Cc: Anshuman Khandual , linux-mm@kvack.org, linux-kernel@vger.kernel.org, mike.kravetz@oracle.com, zi.yan@cs.rutgers.edu, akpm@linux-foundation.org Subject: Re: [PATCH] mm/isolation: Remove redundant pfn_valid_within() in __first_valid_page() Message-ID: <20190321100316.GN8696@dhcp22.suse.cz> References: <1553141595-26907-1-git-send-email-anshuman.khandual@arm.com> <20190321094237.onu3kar2ez7xv5wj@d104.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190321094237.onu3kar2ez7xv5wj@d104.suse.de> 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 Thu 21-03-19 10:42:40, Oscar Salvador wrote: > On Thu, Mar 21, 2019 at 09:43:15AM +0530, Anshuman Khandual wrote: > > pfn_valid_within() calls pfn_valid() when CONFIG_HOLES_IN_ZONE making it > > redundant for both definitions (w/wo CONFIG_MEMORY_HOTPLUG) of the helper > > pfn_to_online_page() which either calls pfn_valid() or pfn_valid_within(). > > pfn_valid_within() being 1 when !CONFIG_HOLES_IN_ZONE is irrelevant either > > way. This does not change functionality. > > > > Fixes: 2ce13640b3f4 ("mm: __first_valid_page skip over offline pages") > > Signed-off-by: Anshuman Khandual > > About the "Fixes:" tag issue, I agree with Michal that the code is not > really broken, but perhaps "suboptimal" depending on how much can affect > performance on those systems where pfn_valid_within() is more complicated than > simple returning true. > > I see that on arm64, that calls memblock_is_map_memory()->memblock_search(), > to trigger a search for the region containing the address, so I guess it > is an expensive operation. > > Depending on how much time we can shave, it might be worth to have the tag > Fixes, but the removal of the code is fine anyway, so: Yeah, seeing a noticesable slowdown (actual numbers) would warrant a backport to 5.0. -- Michal Hocko SUSE Labs