Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1120779ybg; Wed, 29 Jul 2020 06:25:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx27cSA9gfh3yhHLLGz3cIB3b5BEzT0DFidYRdGgRSSnGvyyYcEF/3zceQbaQ7nTB9yFuiR X-Received: by 2002:a17:906:2bc7:: with SMTP id n7mr31292451ejg.96.1596029119031; Wed, 29 Jul 2020 06:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596029119; cv=none; d=google.com; s=arc-20160816; b=M2ehJOCSxivSi+o1BOUEdwm4AIaE4+f1/v8a5SbJNZ6IMc91weMQJSjmbXawnPrAnJ lN1hUycSemVgKfQYRaJvVMbocxyLtP00O4CIRrALtScVqmh1tb2URCE5XeETfEvgsjjq 9vp2vcJkhBglVygkuMr/ssCp6y8dtr/m+zK5l3rv5Mwl6pVlRWsOLyTfey/QjasnO65R CTzdBWPowvirQbPN0w5Iu/cfQpYdLWCtI2GrXqrfaV49krIQQ3TtGNT7HzeUCqGewK9+ Tp8K9hKnGboWWWDoRqKJNk/sxRB61/LLEU/JUHi7VGNgW5aBsrfuWKdMjVhEQlIt3l7j zOyw== 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=e+6rKXaDig00lyfo9s/ybP+H50PWcqOHwLytlqkMNFQ=; b=zWksBrCnwVpleREQnX6TvPCDRh9uahFvHOcATBtd9zX5ez/ozHjuEkltthHz8nGG7Z 0wzbaEvWOTxveTszrAWl8fg5h+NfVCCjrdW9KqSzRXtotcs6X6zn5f1+HP55jMwWTEXD 00psNAd0+6GT4+ThmN375UJMkIB1Mmkty0oXiRDpgeVd9zsLHQuIZjpqHYtgaTuSCO5f dt4tfNL89+KjakjLfgo5+jJkp8v4Wi+a92BMpZjzY9GonnJBjlsXBf8+RRc1pX2Z7r0h io5BpfsVabewaXXhLJVWMzor1C2C8icypLI2rrDF6d7NKkwRnBv5DYRD/FX3BixP3qU7 lbJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iZ2nVyDq; 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 k25si1337684edf.434.2020.07.29.06.24.56; Wed, 29 Jul 2020 06:25:19 -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=iZ2nVyDq; 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 S1727072AbgG2NY1 (ORCPT + 99 others); Wed, 29 Jul 2020 09:24:27 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:59122 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726981AbgG2NY1 (ORCPT ); Wed, 29 Jul 2020 09:24:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596029065; 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=e+6rKXaDig00lyfo9s/ybP+H50PWcqOHwLytlqkMNFQ=; b=iZ2nVyDqG6FJbbhQZ+Fwd+3H6L/dGyGNi6xMVqa1O9if7EmrEiOAUjM2ihI6B38aZZsOyb Gr5n8r7XVXCZq3YN4OW/9KPnaG8XPOd77+mYdkw4l7lh9k/ge9jSaIL15sNSK4DKKpITEr DIJRlYvXodyvBQDBsmitXLmWrv0XcCk= 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-7-TKDYlOnqMN2Dbzl4Rd5ZAA-1; Wed, 29 Jul 2020 09:24:22 -0400 X-MC-Unique: TKDYlOnqMN2Dbzl4Rd5ZAA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C4A3E102C7F2; Wed, 29 Jul 2020 13:24:20 +0000 (UTC) Received: from localhost (ovpn-12-32.pek2.redhat.com [10.72.12.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 385D75F7D8; Wed, 29 Jul 2020 13:24:14 +0000 (UTC) Date: Wed, 29 Jul 2020 21:24:10 +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 3/6] mm/page_isolation: drop WARN_ON_ONCE() in set_migratetype_isolate() Message-ID: <20200729132410.GG14854@MiWiFi-R3L-srv> References: <20200630142639.22770-1-david@redhat.com> <20200630142639.22770-4-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200630142639.22770-4-david@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/30/20 at 04:26pm, David Hildenbrand wrote: > Inside has_unmovable_pages(), we have a comment describing how unmovable > data could end up in ZONE_MOVABLE - via "movable_core". Also, besides ~~~ 'movablecore' > checking if the first page in the pageblock is reserved, we don't > perform any further checks in case of ZONE_MOVABLE. > > In case of memory offlining, we set REPORT_FAILURE, properly > dump_page() the page and handle the error gracefully. > alloc_contig_pages() users currently never allocate from ZONE_MOVABLE. > E.g., hugetlb uses alloc_contig_pages() for the allocation of gigantic > pages only, which will never end up on the MOVABLE zone > (see htlb_alloc_mask()). > > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Michael S. Tsirkin > Signed-off-by: David Hildenbrand > --- > mm/page_isolation.c | 16 ++++++---------- > 1 file changed, 6 insertions(+), 10 deletions(-) > > diff --git a/mm/page_isolation.c b/mm/page_isolation.c > index 553b49a34cf71..02a01bff6b219 100644 > --- a/mm/page_isolation.c > +++ b/mm/page_isolation.c > @@ -58,16 +58,12 @@ static int set_migratetype_isolate(struct page *page, int migratetype, int isol_ > spin_unlock_irqrestore(&zone->lock, flags); > if (!ret) { > drain_all_pages(zone); > - } else { > - WARN_ON_ONCE(zone_idx(zone) == ZONE_MOVABLE); > - > - if ((isol_flags & REPORT_FAILURE) && unmovable) > - /* > - * printk() with zone->lock held will likely trigger a > - * lockdep splat, so defer it here. > - */ > - dump_page(unmovable, "unmovable page"); > - } > + } else if ((isol_flags & REPORT_FAILURE) && unmovable) This else if branch should be enclosed in brace? > + /* > + * printk() with zone->lock held will likely trigger a > + * lockdep splat, so defer it here. > + */ > + dump_page(unmovable, "unmovable page"); > > return ret; > } Otherwise, the patch looks good to me. Reviewed-by: Baoquan He