Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1019622ybg; Wed, 29 Jul 2020 03:50:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4GQR1J9l0VYw/iVz+vU0V/JcavhKVPhiPLHR57WhdvAqKBl9BW3VCreR1coMzIUGGyx6j X-Received: by 2002:a05:6402:13d0:: with SMTP id a16mr30185771edx.269.1596019834638; Wed, 29 Jul 2020 03:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596019834; cv=none; d=google.com; s=arc-20160816; b=sVJ76S+I7IgnYMhTNqk7SrWY5KOsOtQr7E8vYi4GqDlTyeD6OPhcU8kDlg68Wz8y71 WaBXsmPmAtRQqPxRD3RbdWpkFj1hfJa6kRlVOlmvK+bolPsDYInn+C+A1w3W55JBozi2 W2rpsPtqluXS2GrEIPhnbdWHF8TmJmdtqGJKv/RkZEaS1Kxn5lXgZAJvrvbzrRb+lLtt GndWoEf1OJGzG3hRt5LdsX3TmSOWmUVmUlmHCejGwkPknZYvB/eiMcxx/FxOGmBiW/q6 aoc3eNac1pe8NSXw6lZK8Pwm0umCUIS70FGp0uwbYjtnPKlextjHifkP+aKVhXM0wP8Q HoEw== 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:dkim-signature; bh=Nb/oG6MtRg7ZezXWKteZXhsfM84O+Ip9PKe2JE7RZUo=; b=vDoHqgmSSLVUaIabzFMumLCrbeYZqcqlYGxq8KlHkj2+bR32XsUvSKc3PrE7HQ3cd1 L1goGJanLZV9N5Rlh5cfZlzB3kaaeLRCXQuFTj4qVC/FAwmugFNe6MBIH3eF0vYHSpIU rzSsR7PjB0xQckxQiDF203EVSlz4o2ht+QeFNVjNWwvyhU5/WR7bF3Uojr8xJM7Xh7wN pEc3nvsRMH44p2vLkfKX1QDcG824uWAPHM5JGReq5f40TKoEPtknsNugvtkHXIc/ylZB 1YiHzqV0/QeczoNxfDq5P0mpgXVqP1EXBESlruMMsLmZE+XuRxt2aFtXDcLUesZAUjyp u0kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RPWPuGqr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m26si987314ejn.667.2020.07.29.03.50.09; Wed, 29 Jul 2020 03:50:34 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RPWPuGqr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726497AbgG2KsH (ORCPT + 99 others); Wed, 29 Jul 2020 06:48:07 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:27555 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726299AbgG2KsH (ORCPT ); Wed, 29 Jul 2020 06:48:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596019686; 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: in-reply-to:in-reply-to:references:references; bh=Nb/oG6MtRg7ZezXWKteZXhsfM84O+Ip9PKe2JE7RZUo=; b=RPWPuGqrDnegS8ZOd9pCA1BWfeoLA8hrulyao+aEle1u/gyb0AeFH2p/6lP5pgxOyh+BmR 9A9vDLzAQsXP4CyvdijgYDNWZAGVRfjm6B6LgLQSF7E7vMu2Jm9YB2Kc4EYOU9eaB3JFqT qhIBY/mPvo4d/g+z1LJsABdOIoa7gxo= 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-448-o_VbQsfvPlSCfQQ6kserAw-1; Wed, 29 Jul 2020 06:48:04 -0400 X-MC-Unique: o_VbQsfvPlSCfQQ6kserAw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 656EE79EC6; Wed, 29 Jul 2020 10:48:03 +0000 (UTC) Received: from localhost (ovpn-12-32.pek2.redhat.com [10.72.12.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 203867191C; Wed, 29 Jul 2020 10:47:55 +0000 (UTC) Date: Wed, 29 Jul 2020 18:47:53 +0800 From: Baoquan He To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, Andrew Morton , Michal Hocko , "Michael S . Tsirkin" Subject: Re: [PATCH v1 1/6] mm/page_alloc: tweak comments in has_unmovable_pages() Message-ID: <20200729104753.GF14854@MiWiFi-R3L-srv> References: <20200630142639.22770-1-david@redhat.com> <20200630142639.22770-2-david@redhat.com> <20200728134826.GC14854@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/28/20 at 04:07pm, David Hildenbrand wrote: > On 28.07.20 15:48, Baoquan He wrote: > > On 06/30/20 at 04:26pm, David Hildenbrand wrote: > >> Let's move the split comment regarding bootmem allocations and memory > >> holes, especially in the context of ZONE_MOVABLE, to the PageReserved() > >> check. > >> > >> Cc: Andrew Morton > >> Cc: Michal Hocko > >> Cc: Michael S. Tsirkin > >> Signed-off-by: David Hildenbrand > >> --- > >> mm/page_alloc.c | 22 ++++++---------------- > >> 1 file changed, 6 insertions(+), 16 deletions(-) > >> > >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c > >> index 48eb0f1410d47..bd3ebf08f09b9 100644 > >> --- a/mm/page_alloc.c > >> +++ b/mm/page_alloc.c > >> @@ -8207,14 +8207,6 @@ struct page *has_unmovable_pages(struct zone *zone, struct page *page, > >> unsigned long iter = 0; > >> unsigned long pfn = page_to_pfn(page); > >> > >> - /* > >> - * TODO we could make this much more efficient by not checking every > >> - * page in the range if we know all of them are in MOVABLE_ZONE and > >> - * that the movable zone guarantees that pages are migratable but > >> - * the later is not the case right now unfortunatelly. E.g. movablecore > >> - * can still lead to having bootmem allocations in zone_movable. > >> - */ > >> - > >> if (is_migrate_cma_page(page)) { > >> /* > >> * CMA allocations (alloc_contig_range) really need to mark > >> @@ -8233,6 +8225,12 @@ struct page *has_unmovable_pages(struct zone *zone, struct page *page, > >> > >> page = pfn_to_page(pfn + iter); > >> > >> + /* > >> + * Both, bootmem allocations and memory holes are marked > >> + * PG_reserved and are unmovable. We can even have unmovable > >> + * allocations inside ZONE_MOVABLE, for example when > >> + * specifying "movable_core". > > ~~~~ should be 'movablecore', we don't > > have kernel parameter 'movable_core'. > > Agreed! > > > > > Otherwise, this looks good to me. Esp the code comment at below had been > > added very long time ago and obsolete. > > > > Reviewed-by: Baoquan He > > > > By the way, David, do you know what is the situation of having unmovable > > allocations inside ZONE_MOVABLE when specifying 'movablecore'? I quickly > > went through find_zone_movable_pfns_for_nodes(), but didn't get why. > > Could you tell a little more detail about it? > > As far as I understand, it can happen that we have memblock allocations > during boot that fall into an area the kernel later configures to span > the movable zone (via movable_core). Seems yes, thanks a lot. Wondering who is still using movablecore|kernelcore in what use case.