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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 733CDC433DB for ; Wed, 17 Mar 2021 10:07:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D6C1464F5E for ; Wed, 17 Mar 2021 10:07:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6C1464F5E 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 1F1D96B0070; Wed, 17 Mar 2021 06:07:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C9416B0071; Wed, 17 Mar 2021 06:07:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06B878D0001; Wed, 17 Mar 2021 06:07:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0003.hostedemail.com [216.40.44.3]) by kanga.kvack.org (Postfix) with ESMTP id DDED26B0070 for ; Wed, 17 Mar 2021 06:07:08 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A2816824999B for ; Wed, 17 Mar 2021 10:07:08 +0000 (UTC) X-FDA: 77928938136.09.79F2825 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf17.hostedemail.com (Postfix) with ESMTP id EABCA40001DE for ; Wed, 17 Mar 2021 10:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615975627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rBMbUNIL98a6Erxza7a1VwzaHzsaqEpqBfx8X+isFi8=; b=V+EQN405nEPCA77H6jgM3rmZwGhq7ea2m0ZlXzevAKG9Y0AQ4dSj7fYDkM1e5fZ9lqjYlX QEkYg63IZpLcKbzSvdQOeskab7j7Gqtf2Kv2mPJMtkhem8RgWC9NcLG6WiMvquxBUJqNsf sM8d0jjA02opnFM31gaLghif1oxnTz0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-f9D6mGemPYiZyWIa5S9XFw-1; Wed, 17 Mar 2021 06:07:05 -0400 X-MC-Unique: f9D6mGemPYiZyWIa5S9XFw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C358D1084C97; Wed, 17 Mar 2021 10:07:03 +0000 (UTC) Received: from [10.36.112.124] (ovpn-112-124.ams2.redhat.com [10.36.112.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6249419703; Wed, 17 Mar 2021 10:07:01 +0000 (UTC) Subject: Re: [PATCH v4 0/4] Make alloc_contig_range handle Hugetlb pages To: Oscar Salvador Cc: Andrew Morton , Vlastimil Babka , Michal Hocko , Muchun Song , Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Anshuman Khandual References: <20210310150853.13541-1-osalvador@suse.de> <01d2ee6a-f0aa-4580-b1f4-f0e8a2ded4f8@redhat.com> <20210317100518.GA16479@linux> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Wed, 17 Mar 2021 11:07:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210317100518.GA16479@linux> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: EABCA40001DE X-Stat-Signature: qa1x4s1zigi4xubyko4wgnroxe9xemc8 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf17; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615975627-168836 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 17.03.21 11:05, Oscar Salvador wrote: > On Wed, Mar 17, 2021 at 10:48:31AM +0100, David Hildenbrand wrote: >>> I was preparing v5, and I wanted to be sure I understood you here. >>> >>> Right you are that the in-use page check can be dropped, as those pages >>> can >>> be migrated away, and the Hugetlb page check can also be dropped since >>> isolate_migratepages_range is now capable of dealing with those kind of >>> pages. >>> >>>> b) Similarly, check for gigantic pages and/or movability/migratability. >>> >>> I lost you here. >>> >>> isolate_or_dissolve_huge_page() already bails out on hugetlb-gigantic >>> pages. >>> >>> Or do you mean to place an upfront check here? (hstate_is_gigantic())? >> >> Yes. But I prefer a) and keeping it simple here -- just doing basic sanity >> checks (online, zone, PageReserved()) that are absolutely necessary. > > Ok, I am probably dense as I understood as if you were lean towards having > a) + b). Sorry, I meant either a) or b) :) > > That is what I have as the last patch of the patchset: > > From e97175b7d4970cbdcbafcf8c398f72a571e817b0 Mon Sep 17 00:00:00 2001 > From: Oscar Salvador > Date: Thu, 18 Mar 2021 05:03:18 +0100 > Subject: [PATCH] mm,page_alloc: Drop unnecesary checks from > pfn_range_valid_contig > > 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. > Might want to mention that the existing checks were racy either way :) > Signed-off-by: Oscar Salvador > --- > 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; > } > -- Thanks, David / dhildenb