Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1667066pxa; Sun, 16 Aug 2020 06:54:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhBkGnCVtIgBO+RU1j+WpnjBLWC7neOyAYxVsDKUiDyJGJdEL9yEkzQq4aHhvuWy+/CYWu X-Received: by 2002:a05:6402:297:: with SMTP id l23mr11052904edv.145.1597586091895; Sun, 16 Aug 2020 06:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597586091; cv=none; d=google.com; s=arc-20160816; b=Q4i2bTRLABjedur7X43lSz9+Y7H5IOZmCWBLg4QWT/O9CDubXdqDfiFjOln4/qSi9U 2Gbm8DI9/5X4JtmuVeSRt+ds8yDWG1/l1z+RoCkW2dTdWJg3Phqr+dyS2+BEkDisk46w iZVGOoQuLJv0OhBhv3s2csPSKzF1uqF/7tPtP28XRpaoMVEEG9ErQyIxuQWYjuCviDe2 T13nJsRHV92tn2nXuWGUOJ41omkOnlXwksyiQcBr8bhQYxGTqIqcC4Ibfu/BgnFJHSA9 QuFo4u5Yku9ZqwouMECjjdVh+hQWvC3S5EoVNZq1w3R+MEYnTHmjUc2AGDV+dxWPzBIh Enqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5/ZhqaemaIZJrodfmnF3I3t2/SfX8dozv9khOOWmeJY=; b=tRxYGHRAdAMl4XPLAsbFl6Mog2Q+vT4hlqXckRezphC2ac9dC1PRLVqMD4rYWzMAH0 VtGUe/6ykKR9E8iLO5CqzpRDWT/ZbR/NKbJmQSTfJL+we5ocP0X6/zfW4NjTtKzW9fg4 lKcIZmlnbljLA0nkfR9ZlNkUJjgKBBnHi2nBoivk38Ae6kq8r2/eYm6AW0NROhc8KsgH mnv7JPMza1i+LJpPw3W28umOuLZnPafI6JDwPGv7/KK2wjdaPQPJHykPig82YW2uSAUB NNcfYSCMViXH6Xukl12IDbwVNIQUO70HUbR03Gfw6iF4iVhfIMUE0Hx8IJFoj0B0OZxe Ztvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YXanpaO2; 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 w25si9314108ejy.124.2020.08.16.06.54.02; Sun, 16 Aug 2020 06:54: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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YXanpaO2; 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 S1728816AbgHPMyJ (ORCPT + 99 others); Sun, 16 Aug 2020 08:54:09 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58576 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728440AbgHPMx5 (ORCPT ); Sun, 16 Aug 2020 08:53:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597582436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5/ZhqaemaIZJrodfmnF3I3t2/SfX8dozv9khOOWmeJY=; b=YXanpaO2QUItGuRi+bqy4bEZ94Kwr70GOVQ/uePBHzrYXdryC+rv2S49jVB+p7K0RB5NWf IIfDuisLtXNuEQB745Mgl4nlJj9YkTXmn+LXrGlb/0JMZ5txMmGzlY5w1YeyJn2MVdCp8E M3zvzul/Lm9w0YJksMEPUFG3TiFvhUQ= 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-417-k7p1B1TFNRW7MXrOOuTcsw-1; Sun, 16 Aug 2020 08:53:54 -0400 X-MC-Unique: k7p1B1TFNRW7MXrOOuTcsw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0800F1855199; Sun, 16 Aug 2020 12:53:53 +0000 (UTC) Received: from t480s.redhat.com (ovpn-112-43.ams2.redhat.com [10.36.112.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 804746E717; Sun, 16 Aug 2020 12:53:48 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: virtualization@lists.linux-foundation.org, linux-mm@kvack.org, David Hildenbrand , Baoquan He , Andrew Morton , Michal Hocko , "Michael S . Tsirkin" , Mike Kravetz , Pankaj Gupta Subject: [PATCH v5 3/6] mm/page_isolation: drop WARN_ON_ONCE() in set_migratetype_isolate() Date: Sun, 16 Aug 2020 14:53:30 +0200 Message-Id: <20200816125333.7434-4-david@redhat.com> In-Reply-To: <20200816125333.7434-1-david@redhat.com> References: <20200816125333.7434-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Inside has_unmovable_pages(), we have a comment describing how unmovable data could end up in ZONE_MOVABLE - via "movablecore". Also, besides 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()). Reviewed-by: Baoquan He Cc: Andrew Morton Cc: Michal Hocko Cc: Michael S. Tsirkin Cc: Mike Kravetz Cc: Pankaj Gupta Signed-off-by: David Hildenbrand --- mm/page_isolation.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 7d7d263ce7f4b..d099aac479601 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -57,15 +57,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) { + /* + * printk() with zone->lock held will likely trigger a + * lockdep splat, so defer it here. + */ + dump_page(unmovable, "unmovable page"); } return ret; -- 2.26.2