Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp643000img; Tue, 26 Feb 2019 06:18:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IZPUjOEEQ/IRWDBSnvIi28PzWieOEri2F3etvkpBLJve+iAQCY79IsdtohvzMvB/PoimU95 X-Received: by 2002:a62:1303:: with SMTP id b3mr27028163pfj.147.1551190729682; Tue, 26 Feb 2019 06:18:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551190729; cv=none; d=google.com; s=arc-20160816; b=H10enlj9djtHnSfyrv1seTWwmTOpNV8nBb+TTXdTdbVmhde574jfyBQwwBsZxYFVPQ Yq4wYX2If0UvSh9s7hj1+QDmfrsjjBkY1e1E+7H6D6GCCOmtS6m1+6IUSwjQ4AJyzMCH 5u+QYu0kKq7Elu4VibQxR6X1OSGc1rteYQJVdS/1GjBHNMMwwP5+S7SLWh6Tsr99UEfh 2r3MmFNgTj50OhToSh5/DyssAi8quZxYl5xb1sSWw7nxaq+hQqpXr8+Ik1hCWPEmX67d HsWpFTuWGrNWBPHiyrnWuKjhxzvXj392dAsqi6kf9UjChLCyXlYElwJis2/HusA7t2Ux LsBw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=1VOsHpqNa6LTsxo2nkxb4h40F31APusw6iNn5tYasUU=; b=f8PANq9Iq3qL5tHxN/hxds8wq6zN7HkGnQ7kGd1TNDUUfS20vL+xUqliN0ZosgSV3R 3yt1MxSPrgsLbOvKRBfV2Gfx+CVquKL7o/nbvqolTsURezj95+h0txHcblJnvuJkbAv4 Lys8hTeVIVTO/4yoYKXrmayyP48DsL5YIKn3fLvRBgZ/5gtfObKgLAaEhGMCO2BMuTo8 UfBblv6D7tebu5L8oxlR/7mIKgWfJKUBKPb1Erko1UFQOW9IR+ngvTRvSlwFTvfZL7f+ oFhgUpMZx6F+mHnsGUaDqttkmSvLciSp0byKjpoefKcwnCtrK2q67fWPwg9K8+Kh2xWS 89ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=VpnHDEnE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u14si10800659pgh.561.2019.02.26.06.18.29; Tue, 26 Feb 2019 06:18:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=VpnHDEnE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727312AbfBZOQd (ORCPT + 99 others); Tue, 26 Feb 2019 09:16:33 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:32821 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725977AbfBZOQd (ORCPT ); Tue, 26 Feb 2019 09:16:33 -0500 Received: by mail-qt1-f194.google.com with SMTP id z39so15011564qtz.0 for ; Tue, 26 Feb 2019 06:16:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1VOsHpqNa6LTsxo2nkxb4h40F31APusw6iNn5tYasUU=; b=VpnHDEnE169AhLVJM0OL/pdD5WNAdf7Z5iZGZ6Lryup9dB6oqqy0DobWbMhOAn6Wub KE3UNHnAW317nAshfjaHsJGH7wFVeKDEtuKAKWmmD3zvU8hD5Md66y89ce0JZcYhNZfS Itd8ytY4ciWf9T3fxUp3aFQNtJNzn4csfJE6XXsmXd6VOGFakrOdYVCh1u4x9cJaDyHJ UY7yml1X3iQxnW6R/+XUIIVV8HRZixbg3etXjrGsvEOCavTJYuyccwu3oRmsKb6MFPQ/ rGXesSqSzVAJQs4KYfVSo2BHcMHAEPhW+dZdBxS24XRrFV9U3DIoIJPbpNaWRzEHhMl5 gQZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1VOsHpqNa6LTsxo2nkxb4h40F31APusw6iNn5tYasUU=; b=qDW6Ha6eJvhHk/3aswgZXs2+icmOu/imoXOkRBU/Vgv9AVGNQS2rhJ0l/LxM5S3Wif 3xXDk/9eZA8y8vn43p8QfGvteWQMqO1kL3kT8q4SlD7DZn/qI9etFr1RFGTvudssuRR5 vu7e03hDx0UN20wsIw8tgFJ1EbNKqBjeJNvkBZ/OSRwbcx9HEDdJJBvlsuj54TGSe5zP Z59DS36tEyYN7iTQGvy2Hrt8ROQFMrixSbWPtTiAGKpMG8QO2sn/mirUJaNi815RW0eX Kxry2EpYz7wnGq0YhI14/hxqlII16sj72gvqKXID9aTqcZ6WBUZKOtDezrXaPNL2P4XQ k0Ug== X-Gm-Message-State: AHQUAuZXmi7Th86BHwQWhztqZpIArNFLpol0xTEDe2tkWEe45yRWF65Z O7uC30iddlbEjzH2mNOmYCWx/knCi3o= X-Received: by 2002:ac8:33bc:: with SMTP id c57mr19051000qtb.63.1551190592171; Tue, 26 Feb 2019 06:16:32 -0800 (PST) Received: from ovpn-120-150.rdu2.redhat.com (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id e184sm14174372qka.31.2019.02.26.06.16.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 06:16:31 -0800 (PST) Subject: Re: [PATCH] mm/hotplug: fix an imbalance with DEBUG_PAGEALLOC To: Michal Hocko Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20190225191710.48131-1-cai@lca.pw> <20190226123521.GZ10588@dhcp22.suse.cz> From: Qian Cai Message-ID: <4d4d3140-6d83-6d22-efdb-370351023aea@lca.pw> Date: Tue, 26 Feb 2019 09:16:30 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20190226123521.GZ10588@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/26/19 7:35 AM, Michal Hocko wrote: > On Mon 25-02-19 14:17:10, Qian Cai wrote: >> When onlining memory pages, it calls kernel_unmap_linear_page(), >> However, it does not call kernel_map_linear_page() while offlining >> memory pages. As the result, it triggers a panic below while onlining on >> ppc64le as it checks if the pages are mapped before unmapping, >> Therefore, let it call kernel_map_linear_page() when setting all pages >> as reserved. > > This really begs for much more explanation. All the pages should be > unmapped as they get freed AFAIR. So why do we need a special handing > here when this path only offlines free pages? > It sounds like this is exact the point to explain the imbalance. When offlining, every page has already been unmapped and marked reserved. When onlining, it tries to free those reserved pages via __online_page_free(). Since those pages are order 0, it goes free_unref_page() which in-turn call kernel_unmap_linear_page() again without been mapped first.