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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 62462C433DB for ; Wed, 17 Mar 2021 14:32:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F7B664F26 for ; Wed, 17 Mar 2021 14:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231897AbhCQObg (ORCPT ); Wed, 17 Mar 2021 10:31:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:50982 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231730AbhCQObE (ORCPT ); Wed, 17 Mar 2021 10:31:04 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1615991463; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RFm4+Qk4kqX2XZDIGRshWo3nhfXZZ/zyIpZzIP26KRM=; b=o4RnNYzAF0XVZy7kq+ZdRr9yJKIrUn3BJqtHrUj1I74F/dK5tnJXTXv+cybyeDCLy5Gt/0 47evnvHH1AcSSZuJB2N+9ZTU0tMY1CKgV6Xx7c8kgCeKPV6707q3Ndowk1zkkG6c+UgHHj EFwAztYm82mw9P6TM2WtLTiY32SyRHc= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 87E4BAEBD; Wed, 17 Mar 2021 14:31:02 +0000 (UTC) Date: Wed, 17 Mar 2021 15:31:01 +0100 From: Michal Hocko To: Oscar Salvador Cc: Andrew Morton , Vlastimil Babka , David Hildenbrand , Muchun Song , Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 5/5] mm,page_alloc: Drop unnecessary checks from pfn_range_valid_contig Message-ID: References: <20210317111251.17808-1-osalvador@suse.de> <20210317111251.17808-6-osalvador@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210317111251.17808-6-osalvador@suse.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 17-03-21 12:12:51, Oscar Salvador wrote: > pfn_range_valid_contig() bails out when it finds an in-use page or a > hugetlb page, among other things. > We can drop the in-use page check since __alloc_contig_pages can migrate > away those pages, and the hugetlb page check can go too since > isolate_migratepages_range is now capable of dealing with hugetlb pages. > Either way, those checks are racy so let the end function handle it > when the time comes. I haven't realized PageHuge check is done this early. This means that previous patches are not actually active until now which is not really greate for bisectability. Can we remove the HugePage check earlier? Act to the page_count check removal. We should rely on migrate_pages here. > Signed-off-by: Oscar Salvador > Suggested-by: David Hildenbrand > --- > mm/page_alloc.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 4cb455355f6d..50d73e68b79e 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -8685,12 +8685,6 @@ static bool pfn_range_valid_contig(struct zone *z, unsigned long start_pfn, > > if (PageReserved(page)) > return false; > - > - if (page_count(page) > 0) > - return false; > - > - if (PageHuge(page)) > - return false; > } > return true; > } > -- > 2.16.3 -- Michal Hocko SUSE Labs