From patchwork Fri Nov 16 08:30:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10685713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3687A17DE for ; Fri, 16 Nov 2018 08:30:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25E3D28B22 for ; Fri, 16 Nov 2018 08:30:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A2692D681; Fri, 16 Nov 2018 08:30:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D1B228B22 for ; Fri, 16 Nov 2018 08:30:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB29E6B0883; Fri, 16 Nov 2018 03:30:40 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BE8286B0884; Fri, 16 Nov 2018 03:30:40 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F0BE6B0885; Fri, 16 Nov 2018 03:30:40 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 403666B0883 for ; Fri, 16 Nov 2018 03:30:40 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id c53so2675309edc.9 for ; Fri, 16 Nov 2018 00:30:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=LzlccDXf/yxTKP+pRsq4A6fnjdUbs9H45qb89MeJwgk=; b=YtiQEqBKUKNag2IF75DseVxO41JEcbjQpdouzQxWFdTg82tsGkBN9FGYCr+FHaGCdt f2W4xgvE/KH8SfeWVMpyHfz+4kROiGb5WGDL+YdiGKo/upRqjT44tXqJiltjuC0u8/L/ CBXdEbOtvBlxsWcEllWKSvUwqRU2+IaabI7iDlKhMBZYrc3uGqyBse27dGr/qekTJuVJ Y2d/UmdF8BbbVVAN0zF6Jr5xOomKGXj73LOOnAwEWGtUYS7XJ6BLOip39x0wuxD3692S Y//vBXy4WegVFlLmmUCvIucH3iSLu51GaFpt8PEcHCrxXu82jsr0Qpt8+PK0K5apfKSY QX0g== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Gm-Message-State: AGRZ1gLv33+yeRIL+38wSzv5zKV1bU2YiVVJUbdRqWLjcloOsLqokUpW 9rd7OuyObBKl5pf1yLQqaPTQuaFl7MQ9YhrO6onjdt3Ws32wNPu0AwAxz+qHeSY0jeb35GrAOuA TTd69Y4kGsGniI8fQIT1LUqHldJBWyhUBjKqu2Utbh8UAFr47U5WXMIm0vnuH4nj4ggRf0UlPaL t4Oxjq1C/4MoD1dL1xtmrTt+Ud8lNMcsJ8hZW0oVLgJ0ctfWI8knvUlxfVitJD06vM1yKL8KXdd jaAFeYeFXK5JzLFmDiUdmRBzQLwCZ6/tPwL43UIhC0nc90XzoqFtPPqUiL9ZQjAIcCbagCJsvuU XRS6qnwbNRBaHpaESDPasRyXQ7VuNeA48f4V5IYml5fzM5B7fVvDPUeXXiQhcpamhT2vKEk7zQ= = X-Received: by 2002:a50:ae8f:: with SMTP id e15mr8928948edd.250.1542357039839; Fri, 16 Nov 2018 00:30:39 -0800 (PST) X-Received: by 2002:a50:ae8f:: with SMTP id e15mr8928905edd.250.1542357038980; Fri, 16 Nov 2018 00:30:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542357038; cv=none; d=google.com; s=arc-20160816; b=sNBWymA8Ai1wk8vFPtIK7cXttRnap+gJYRz+F5WWLegv1lRVfKYIRKfIRKpfBQxgd8 2VHy5eO/Jm7dKUfPDKkXz3W1KeyEetYftDxvr4YewrquI++cEuJx4ySMaR51TCGkRmMo xY7/IQGaBrUh8vY1hgctAdhQHYGf74a7Gaxc0bofEOXrxfy+AkzYzJQXOL1o1+wPGjF3 vXsXm84oqQ7UCLn9PWvFcmEVveZNgrKv1w1UE4YIi6yzAv8o7EY9MogCH3++LNlhObGd 2K78ePiDV98bO4YlRBt5M2B7GKgOAYNc+wXDxuBvO22NJ3d14A7j6NXLWMhu63WNW4Ma JmIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=LzlccDXf/yxTKP+pRsq4A6fnjdUbs9H45qb89MeJwgk=; b=cvwve4ijoUCKQb9/vYf1nPm89NQ24R6yE4R8AdkLnXGEbdqRiHakrxBl0v8povcFXW PCI/Ol1/2ETF8drH86rhKFGQkgp9htxxE2IX3Eq6PV1RQN1yireasWJM++BX2OLCBLUX oaMduxCIVlvHll/6zr52NCFWHUeEpDcKgqO3NqYEYR+yO5YitBmgOLhb3hvTO5ozbfRx zSa0LDvEKk2cu2B/HHb+A+4ACkLHUnjXAWAHMXfbWPih2i+5sguA2MclQ2k40N7W5XHg bLWlw+rf0yLOOtbNlKCYhYMZUpCQOYu3vYzQcuJHmn5TANWTpKcq0qE4Ez04r73JRiS2 agOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c13-v6sor15937661edi.3.2018.11.16.00.30.38 for (Google Transport Security); Fri, 16 Nov 2018 00:30:38 -0800 (PST) Received-SPF: pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Google-Smtp-Source: AJdET5c8sPRA1OLjYdnOBPxOalFmoaWho8oqy17NWq64FbRugxfrghIX3x/y2iTbh6OilXOnPHZV5w== X-Received: by 2002:a50:be4c:: with SMTP id b12-v6mr8743984edi.46.1542357038628; Fri, 16 Nov 2018 00:30:38 -0800 (PST) Received: from tiehlicka.suse.cz (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id m13sm5305393edd.2.2018.11.16.00.30.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 00:30:37 -0800 (PST) From: Michal Hocko To: Andrew Morton Cc: Oscar Salvador , Baoquan He , Anshuman Khandual , , LKML , Michal Hocko Subject: [PATCH 5/5] mm, memory_hotplug: be more verbose for memory offline failures Date: Fri, 16 Nov 2018 09:30:20 +0100 Message-Id: <20181116083020.20260-6-mhocko@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181116083020.20260-1-mhocko@kernel.org> References: <20181116083020.20260-1-mhocko@kernel.org> MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP From: Michal Hocko There is only very limited information printed when the memory offlining fails: [ 1984.506184] rac1 kernel: memory offlining [mem 0x82600000000-0x8267fffffff] failed due to signal backoff This tells us that the failure is triggered by the userspace intervention but it doesn't tell us much more about the underlying reason. It might be that the page migration failes repeatedly and the userspace timeout expires and send a signal or it might be some of the earlier steps (isolation, memory notifier) takes too long. If the migration failes then it would be really helpful to see which page that and its state. The same applies to the isolation phase. If we fail to isolate a page from the allocator then knowing the state of the page would be helpful as well. Dump the page state that fails to get isolated or migrated. This will tell us more about the failure and what to focus on during debugging. Signed-off-by: Michal Hocko Reviewed-by: Oscar Salvador Reviewed-by: Anshuman Khandual --- mm/memory_hotplug.c | 12 ++++++++---- mm/page_alloc.c | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 88d50e74e3fe..c82193db4be6 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1388,10 +1388,8 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) page_is_file_cache(page)); } else { -#ifdef CONFIG_DEBUG_VM - pr_alert("failed to isolate pfn %lx\n", pfn); + pr_warn("failed to isolate pfn %lx\n", pfn); dump_page(page, "isolation failed"); -#endif put_page(page); /* Because we don't have big zone->lock. we should check this again here. */ @@ -1411,8 +1409,14 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) /* Allocate a new page from the nearest neighbor node */ ret = migrate_pages(&source, new_node_page, NULL, 0, MIGRATE_SYNC, MR_MEMORY_HOTPLUG); - if (ret) + if (ret) { + list_for_each_entry(page, &source, lru) { + pr_warn("migrating pfn %lx failed ret:%d ", + page_to_pfn(page), ret); + dump_page(page, "migration failure"); + } putback_movable_pages(&source); + } } out: return ret; diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a919ba5cb3c8..ec2c7916dc2d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7845,6 +7845,7 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count, return false; unmovable: WARN_ON_ONCE(zone_idx(zone) == ZONE_MOVABLE); + dump_page(pfn_to_page(pfn+iter), "unmovable page"); return true; }