Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp124342pxb; Fri, 16 Apr 2021 01:05:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRt+YlsEh/Y57CzMQ30YgwV38hX4pVkno1SQsY8wxM4eSrxc802UsNKSpUj0cWpwHZNU2w X-Received: by 2002:a17:90a:ba05:: with SMTP id s5mr8541570pjr.194.1618560351570; Fri, 16 Apr 2021 01:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618560351; cv=none; d=google.com; s=arc-20160816; b=1HEwDNoYsYC+drtgpZxbV6VjllqeB9l1NEUNSnMq0N7nX0KnGZUgSNM+ByR5asCfZn haylRMrqGBjSInJHXLACVVMfYemZvF3RAlFKh8/EzL2oCTLUBliQHPH0GD1PH5Sr85Yx H2dUQBaGZlG4tIQ/CucPGi3kFH0CY6PLEkzrCNif4Ch09d4CwqXX9NkKLn5wquCpFZQz OfdwNtbEjftLo8liqm4VqwVmMoe1LIjvLLEq8mIjUYVTaAbv/dP/1GhJO4GasKJWqg6i m1YivKwk311RQcidYomtUx8kQRmQgYaVxIuKB4oQdUwbP57mOBJdH+HXSvRrQ/nzIpcX IZSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OaFsgv5ParMzkxL08PESznMKlPiRkLaCd2KiUS8yM0E=; b=qAS7TuADHj/IPFRJUTMjpEsGBY3+XYfZUn26zW2bxHL6Bakaw/xedzPSNdQgLiWmbB 2aPCNRkNF4Vu6R3pvnTbZF5kZxMOuerIJ+T7hPm8lUBx9ob+jtT8Goq2PbWeC1BgWTol WKq9PidBpZ4SX3a2BKOPwHvs6msLGnS3gaWODZfhTd/Hh0F0DO9pSG3NzPqZadZFY28i RLtYsR49/Hfixch4HPsihlZRsKNWwCx0Bc7oFUhPSzxm8yvjinPaV8WQTV0T/v8rnqhf bO4xH/WQ5f4P5DAABSpWodujqgyzJCDw97aTrv+c4MtIY/7myug0ZnTdIUYg1/4eFJ1I FNNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si5642025pgp.451.2021.04.16.01.05.39; Fri, 16 Apr 2021 01:05:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239435AbhDPHBN (ORCPT + 99 others); Fri, 16 Apr 2021 03:01:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:49296 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239397AbhDPHBI (ORCPT ); Fri, 16 Apr 2021 03:01:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D493AAF28; Fri, 16 Apr 2021 07:00:43 +0000 (UTC) From: Oscar Salvador To: Andrew Morton Cc: Mike Kravetz , Vlastimil Babka , David Hildenbrand , Michal Hocko , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador , Michal Hocko Subject: [PATCH v9 7/7] mm,page_alloc: Drop unnecessary checks from pfn_range_valid_contig Date: Fri, 16 Apr 2021 09:00:23 +0200 Message-Id: <20210416070023.4742-8-osalvador@suse.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210416070023.4742-1-osalvador@suse.de> References: <20210416070023.4742-1-osalvador@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Oscar Salvador Suggested-by: David Hildenbrand Reviewed-by: David Hildenbrand Acked-by: Mike Kravetz Acked-by: Michal Hocko --- mm/page_alloc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b5a94de3cdde..c5338e912ace 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8901,12 +8901,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